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

Handle nodes without coordinates #143

Open
wants to merge 3 commits into
base: gh-pages
Choose a base branch
from

Conversation

jleedev
Copy link

@jleedev jleedev commented Dec 5, 2023

When a node has no coordinates, treat it as missing for the purpose of constructing the multilinestring, multipolygon, or way geometry, to avoid producing coordinates of [NaN, NaN].

When a piece of a multipolygon or multilinestring contains no coordinates, remove it, to avoid inserting an empty array into the coordinates array.

Fixes #142

Treat nodes without coordinates the same as if they are absent, in
construct_multipolygon, construct_multilinestring, and when processing
ways, to avoid producing coordinates of NaN/null.

When a segment of a relation (either a line string, or a polygon ring)
consists entirely of invalid nodes, omit this empty array, to avoid
producing a coordinates element which is an empty array.

Both of these changes will cause such features to be omitted from the
output when they have no coordinates, just as they already are for ways
which reference nodes that are absent, and relations which reference
ways that are absent.
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.

Broken geometry produced from references to objects without coordinates
1 participant