geo-data-merger icon indicating copy to clipboard operation
geo-data-merger copied to clipboard

Support feature id of geojsons and topojsons

Open sraimund opened this issue 3 years ago • 0 comments

Thank you for developing this practical tool!

It would be nice if the feature id of geojsons and topojsons would be also recognized as a column. See the last bullet point of section 3.2 in the geojson specification for further details: https://datatracker.ietf.org/doc/html/rfc7946#section-3.2

Here an exemplary geojson file for testing:

{
  "type": "FeatureCollection",
  "name": "switzerland",
  "features": [{
      "type": "Feature",
      "id": "CH",
      "geometry": {
        "type": "Polygon",
        "coordinates": [[[8.558133691490156, 47.807404569040386], [10.403686252119602, 46.639241157337544], [7.098859573783153, 45.860465549535654], [6.111703552981356, 46.580832986752405], [8.558133691490156, 47.807404569040386]]]
      }
    }
  ]
}

Currently no column is recognized when the file is uploaded to the Geo Data Merger. The same applies for topojsons like this:

{
  "type": "Topology",
  "arcs": [[[57, 100], [43, -60], [-77, -40], [-23, 37], [57, 63]]],
  "transform": {
    "scale": [0.042919826991382456, 0.019469390195047325],
    "translate": [6.111703552981356, 45.860465549535654]
  },
  "objects": {
    "country": {
      "type": "GeometryCollection",
      "geometries": [{
          "arcs": [[0]],
          "type": "Polygon",
          "id": "CH"
        }
      ]
    }
  }
}

Supporting this case would save the user an additional conversion step, namely including the "id" in the properties of a feature. Often ids are used for joining.

sraimund avatar Aug 04 '21 12:08 sraimund