readGeometriesFromObject()

in src/lib/components/molecules/canvas-map/lib/formats/GeoJSON.js [102:128]


  readGeometriesFromObject(geometry) {
    const geometries = []
    if (geometry.type === "Polygon") {
      const polygon = this.readPolygonForCoordinates(geometry.coordinates)
      geometries.push(polygon)
    } else if (geometry.type === "MultiPolygon") {
      for (const polygonCoordinates of geometry.coordinates) {
        const polygon = this.readPolygonForCoordinates(polygonCoordinates)
        geometries.push(polygon)
      }
    } else if (geometry.type === "LineString") {
      const lineString = this.readLineStringForCoordinates(geometry.coordinates)
      geometries.push(lineString)
    } else if (geometry.type === "MultiLineString") {
      for (const lineStringCoordinates of geometry.coordinates) {
        const lineString = this.readLineStringForCoordinates(
          lineStringCoordinates,
        )
        geometries.push(lineString)
      }
    } else if (geometry.type === "Point") {
      const point = this.readPointForCoordinates(geometry.coordinates)
      geometries.push(point)
    }

    return geometries
  }