How to use @turf/combine - 1 common examples

To help you get started, we’ve selected a few @turf/combine examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GeoTIFF / geoblaze / src / utils / utils.module.js View on Github external
getGeojsonCoors (geojson, debug=false) {
    let result;
    if (geojson.features) { // for feature collections

      // make sure that if any polygons are overlapping, we get the union of them
      geojson = combine(geojson);

      // turf adds extra arrays when running combine, so we need to remove them
      // as we return the coordinates
      result = geojson.features[0].geometry.coordinates
        .map(coors => coors[0]);
    } else if (geojson.geometry) { // for individual feature
      result = geojson.geometry.coordinates;
    } else if (geojson.coordinates) { // for just the geometry
      result = geojson.coordinates;
    }
    return result;
  },

@turf/combine

turf combine module

MIT
Latest version published 3 years ago

Package Health Score

80 / 100
Full package analysis

Popular @turf/combine functions