Skip to content

Commit

Permalink
added point densification
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielJDufour committed Oct 20, 2023
1 parent 3548fb1 commit ae305a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"quick-promise": "^0.1.0",
"quick-resolve": "^0.0.1",
"reproject-bbox": "^0.12.0",
"reproject-geojson": "^0.3.0",
"reproject-geojson": "^0.5.0",
"snap-bbox": "^0.5.0",
"terraformer-arcgis-parser": "^1.1.0",
"underscore": "^1.13.6",
Expand Down
7 changes: 6 additions & 1 deletion src/wrap-geom.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ export default function wrapGeom(func) {
if (Array.isArray(geometry) && geometry.length === 4 && geometry.every(n => typeof n === "number")) {
geom = reprojectBoundingBox({ bbox: geometry, density: 10, from: srs, to: georaster.projection });
} else {
geom = reprojectGeoJSON(geometry, { from: srs, to: georaster.projection });
geom = reprojectGeoJSON(geometry, {
// adds 3 points to every edge, basically dividing each edge into quarters
densify: typeof geom.densify === "number" ? Math.round(geom.densify) : 3,
from: srs,
to: georaster.projection
});
}
} else {
geom = geom.geometry;
Expand Down

0 comments on commit ae305a3

Please sign in to comment.