here-cli icon indicating copy to clipboard operation
here-cli copied to clipboard

more meaningful error messages when assigning feature IDs with -i

Open jonahadkins opened this issue 5 years ago • 1 comments

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"}

jonahadkins avatar Feb 05 '20 21:02 jonahadkins

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 -i and we assign a unique feature id), offer to skip it over

    • perhaps we should offer to add a duplicates_skipped:true property? (might need another flag to specify this)
  • 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

csv.zip parcels.zip

burritojustice avatar Feb 05 '20 23:02 burritojustice