Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

discuss: duplicate id property in geojson #1389

Open
missinglink opened this issue Nov 14, 2019 · 2 comments
Open

discuss: duplicate id property in geojson #1389

missinglink opened this issue Nov 14, 2019 · 2 comments

Comments

@missinglink
Copy link
Member

we have a property called id in the geojson which appears to be a dupe of source_id

would it be possible to deprecate and remove one of these two properties?

Screenshot 2019-11-14 at 14 24 35

@missinglink missinglink changed the title discuss: duplicate id property from geojson discuss: duplicate id property in geojson Nov 14, 2019
@orangejulius
Copy link
Member

Deprecating properties from the GeoJSON response that comes from Pelias would be hard and painful, I don't think we have a good process around it, and it might not be too valuable.

However we should definitely remove the underlying data duplication, which is tracked in pelias/schema#383

@missinglink
Copy link
Member Author

missinglink commented Jul 14, 2020

I was sitting with someone recently who was new to Pelias, they were using React, which requires a unique key to render a list of items (so it can correctly track state changes).

He naturally assumed that id was the correct field to use for this purpose but was later confused why fewer results were being rendered in React than were provided in the raw geojson response.

What was happening here was that the results contained both a venue and an address from the same OSM source ID and so keying the data using id was removing one of the two disparate records

I think you're right that completely removing the field could easily break integrations but it's still unintuitive as-is, maybe we can resolve this by having id as a duplicate of the gid field instead of the source_id field?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants