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

Guard against non-numeric id in GeoJSON features #4581

Merged
merged 5 commits into from
Apr 12, 2017
Merged

Conversation

anandthakker
Copy link
Contributor

Closes #4494

Since we're using the vector tile binary format even for geojson-vt tiles, make
sure we conform to the MVT requirement that feature.id is an integer

@jfirebaugh
Copy link
Contributor

#4494 reports that the issue didn't occur in v0.32.1. Were you able to confirm that and determine why?

@anandthakker
Copy link
Contributor Author

@jfirebaugh yep - v0.32.1 is the last release before cf031a6, which is when the geojson-vt wrapper started copying feature.id.

@@ -17,8 +17,8 @@ class FeatureWrapper {
this.rawGeometry = feature.geometry;
}
this.properties = feature.tags;
if ('id' in feature) {
this.id = feature.id;
if ('id' in feature && !isNaN(feature.id)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment here explaining the original issue and the reason for !isNaN/parseInt?

@anandthakker anandthakker merged commit a2dc4fa into master Apr 12, 2017
@anandthakker anandthakker deleted the fix-4494 branch April 12, 2017 19:19
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

Successfully merging this pull request may close these issues.

2 participants