From b24c346fc4b6bbc02e71ebdf186b4d58e89d85fc Mon Sep 17 00:00:00 2001 From: = <33870734+Mr-Ixolate@users.noreply.github.com> Date: Mon, 6 May 2024 17:38:55 +0100 Subject: [PATCH] updated ignore_index param docstring and related error msg --- topojson/core/extract.py | 4 ++-- topojson/core/topology.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/topojson/core/extract.py b/topojson/core/extract.py index e5539a5..9e8132f 100644 --- a/topojson/core/extract.py +++ b/topojson/core/extract.py @@ -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 diff --git a/topojson/core/topology.py b/topojson/core/topology.py index 4e91d5b..a10d483 100644 --- a/topojson/core/topology.py +++ b/topojson/core/topology.py @@ -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. """