Skip to content

Commit

Permalink
updated ignore_index param docstring and related error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Ixolate committed May 6, 2024
1 parent 8d38b09 commit b24c346
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions topojson/core/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,8 @@ def _extract_featurecollection(self, geom):

# check for overwritten duplicate keys
if len(data) < len(obj["features"]):
# slight problem here is it doesn't say which one/ones were duplicated
raise IndexError("id in geojson data duplicated")
msg = "index in data duplicated, use `ignore_index=True` to overwrite index"
raise IndexError(msg)

# new data dictionary is created, throw the geometries back to main()
self._is_single = False
Expand Down
4 changes: 2 additions & 2 deletions topojson/core/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ class Topology(Hashmap):
combination with an equal length list of `data` objects.
Default is a single object named `data`.
ignore_index : bool
If set to true existing ids/indexes will be ignored and overwritten otherwise
they will be passed through into the output.
If set to true existing ids/indexes of geojson FeatureCollections will be
ignored and overwritten. Otherwise features with ids will use their existing one.
If indexes are not ignored and a duplicate id exists an exception will be raised.
Default is false.
"""
Expand Down

0 comments on commit b24c346

Please sign in to comment.