mattijn / topojson

Encode spatial data as topology in Python! 🌍 https://mattijn.github.io/topojson
BSD 3-Clause "New" or "Revised" License
183 stars 27 forks source link

Geojson ids option #220

Closed Mr-Ixolate closed 6 months ago

Mr-Ixolate commented 6 months ago

PR for #219

Change makes it so that geojson.FeatureCollections with Features that have ids will have those ids passed through to the output of Topology. A new option ignore_index that allows that behavior to be reverted to what it was before also added. Left off by default

Added three tests.

  1. Checking index is passed through extract
  2. Checking duplicate index raises an error
  3. Checking that ignore_index=True uses the original "feature_0", "feature_0" index

Two tests that counted the number of options were modified to increase the expected count by one.