Closed simonepri closed 6 years ago
hi @simonepri, the library currently only supports FeatureCollections
not GeometryCollections
but we would be happy to review a PR to add this functionality.
This should be enough:
function geometryCollection2featureCollection(geojson) {
const feats = geojson.geometries.map(geom => {
return {
type: 'Feature',
geometry: geom
};
});
return {type: 'FeatureCollection', features: feats};
}
I'll open a PR soon
Hi @missinglink, since I found difficult to improve this package without change everything I've decided to build a new package from scratch that supports more types of lookups.
You can find it here: https://github.com/simonepri/geojson-geometries-lookup
I think we can close this issue.
If this is passed to the constructor, the package throws an error:
{ type: 'GeometryCollection', geometries: [ { type: 'MultiPolygon', coordinates: [Array] } ] }