Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions packages/turf-line-overlap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ function lineOverlap<
tolerance === 0
? booleanPointOnLine(coordsSegment[0], match) &&
booleanPointOnLine(coordsSegment[1], match)
: nearestPointOnLine(match, coordsSegment[0]).properties.dist! <=
tolerance &&
nearestPointOnLine(match, coordsSegment[1]).properties.dist! <=
tolerance
: nearestPointOnLine(match, coordsSegment[0]).properties
.pointDistance! <= tolerance &&
nearestPointOnLine(match, coordsSegment[1]).properties
.pointDistance! <= tolerance
) {
doesOverlaps = true;
if (overlapSegment) {
Expand All @@ -102,10 +102,10 @@ function lineOverlap<
tolerance === 0
? booleanPointOnLine(coordsMatch[0], segment) &&
booleanPointOnLine(coordsMatch[1], segment)
: nearestPointOnLine(segment, coordsMatch[0]).properties.dist! <=
tolerance &&
nearestPointOnLine(segment, coordsMatch[1]).properties.dist! <=
tolerance
: nearestPointOnLine(segment, coordsMatch[0]).properties
.pointDistance! <= tolerance &&
nearestPointOnLine(segment, coordsMatch[1]).properties
.pointDistance! <= tolerance
) {
// Do not define (doesOverlap = true) since more matches can occur within the same segment
// doesOverlaps = true;
Expand Down
2 changes: 1 addition & 1 deletion packages/turf-line-split/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function findClosestFeature(
var closestDistance = Infinity;
featureEach(lines, function (segment) {
var pt = nearestPointOnLine(segment, point);
var dist = pt.properties.dist;
var dist = pt.properties.pointDistance;
if (dist < closestDistance) {
closestFeature = segment;
closestDistance = dist;
Expand Down
6 changes: 6 additions & 0 deletions packages/turf-nearest-point-on-line/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,16 @@ function nearestPointOnLine<G extends LineString | MultiLineString>(
lineDistance: number;
segmentDistance: number;
pointDistance: number;
// deprecated properties START
/** @deprecated use `lineStringIndex` instead */
multiFeatureIndex: number;
/** @deprecated use `segmentIndex` instead */
index: number;
/** @deprecated use `totalDistance` instead */
location: number;
/** @deprecated use `pointDistance` instead */
dist: number;
// deprecated properties END
[key: string]: any;
}
> {
Expand Down
2 changes: 1 addition & 1 deletion packages/turf-point-to-line-distance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function distanceToSegment(
const nearest = nearestPointOnLine(lineString([a, b]).geometry, p, {
units: "degrees",
});
return nearest.properties.dist;
return nearest.properties.pointDistance;
}

// Perform scalar calculations instead using rhumb lines.
Expand Down
6 changes: 6 additions & 0 deletions scripts/generate-readmes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ const yaml = require("yamljs");
if (res === undefined) return console.warn(packagePath);
console.log("Building Docs: " + name);

// Workaround to exclude @deprecated tags from docs
// See https://github.com/documentationjs/documentation/issues/1596
res = res.filter((item) =>
item.tags.every((tag) => tag.title !== "deprecated")
);

// Format Markdown
documentation.formats
.md(res, { paths })
Expand Down
Loading