I am using leaflet 1.0.0 to display the GeoJSON. The GeoJSON contains data for the whole bounding box but I want to display the feature in some location only.

Is it possible to clip the GeoJSON with another GeoJSON or something like that to display on the leaflet map?


Yes, it's possible, but it's not something that Leaflet can (or should) do.

Instead, research into other tools specialized in geoprocessing, like e.g. turf.js's bboxClip().

  • Not sure if turf's bboxclip can do but I do not want bounding box clip but rather a polygon clipping. – Biplov Nov 9 '17 at 8:54
  • Looks like github.com/wandergis/turf-clip might work. I will give it a try. – Biplov Nov 9 '17 at 9:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.