Given geospatial data as GeoJSON, how can I filter this data to exclude geometries within a specified polygon?

I need this to work in JavaScript. Example:

function filter(featureCollection, filterPolygon) {
    return //geometries in featureCollection not within filterPolygon

closed as primarily opinion-based by Vince, user30184, Hornbydd, xunilk, LaughU Nov 23 '18 at 7:26

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    There are likely dozens of such libraries. Please Edit your question to specify the language, though you might be better off asking such a subjective question in Software Recommendations – Vince Nov 22 '18 at 15:43
  • It needs to be a JavaScript Lib – ill Nov 22 '18 at 15:57

Take a look at turf.js (http://turfjs.org/). Combine with a js filter on the features array

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