here-cli
here-cli copied to clipboard
more meaningful error messages when assigning feature IDs with -i
hi 👋
I was assigning a feature id during an upload using -I {column_name} and got this message:
OPERATION FAILED : {"type":"ErrorResponse","error":"IllegalArgument","errorMessage":"Unable to process the request input.","streamId":"d9ea9225-5034-43e7-a03c-9a5f8cc895ea"}
Thanks @jonahadkins, this is interesting.
I saw this with both the shapefile and the CSV. These files contain both duplicates (along with some null values) in the property being selected.
-
we should report a more meaningful error -- "duplicate unique values found"
-
if the record is an exact duplicate (which we can detect by using the same hash function we don't upload with
-iand we assign a unique feature id), offer to skip it over- perhaps we should offer to add a
duplicates_skipped:trueproperty? (might need another flag to specify this)
- perhaps we should offer to add a
-
if the record is not an exact duplicate, we can offer to merge/patch them
- if just the properties are different, we simply add the new property
- if the geometries are not unique (but are the same type), we can change them to multi geometries (so in the case of multiple polygons with the same feature ID, the original feature's Polygon geometry object and the new polygon would become a MultiPolygon (an array of Polygon coordinates)http://wiki.geojson.org/GeoJSON_draft_version_6#MultiPolygon ) -- same could work for lines and points