Skip to content

Suggestion: Generalise bboxClip to support all GeoJSON object types #2813

@stevage

Description

@stevage

There is not really an easy way to crop a featureCollection (or other geometry type) to a polygon or bbox.

There are times when I just want to do:

const newFC = turf.crop(oldFC, [xmin, ymin, xmax, ymax])

or

const newFC = turf.crop(oldFC, cropPolygon)

It's relatively easy to use intersect to crop Polygons, and booleanPointInPolygon to filter out Points, but I'm not even sure if there's a straightforward way to crop LineStrings currently.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions