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

Broken geometry produced from references to objects without coordinates #142

Open
jleedev opened this issue Dec 5, 2023 · 0 comments · May be fixed by #143
Open

Broken geometry produced from references to objects without coordinates #142

jleedev opened this issue Dec 5, 2023 · 0 comments · May be fixed by #143

Comments

@jleedev
Copy link

jleedev commented Dec 5, 2023

I discovered this through using out center, which produces object without coordinates but also produces separate Feature items from the center point; I think this is a red herring and this is only caused by the missing coordinates but I mention it for completeness. (Difficult to make a nice reproduction.)

(As a workaround, I can, of course, remember to instead use out center tags; in my overpass queries.)

1: A way that has references to nodes which lack coordinates: way(387635995);out;node(w);out ids;

Input:

{ "elements": [
{ "type": "way", "id": 1, "nodes": [2, 3] },
{ "type": "node", "id": 2 },
{ "type": "node", "id": 3 }
] }

Output:

{"type":"FeatureCollection","features":[
{"type":"Feature","id":"way/1","properties":{"id":"way/1"},
"geometry":{"type":"LineString","coordinates":[[null,null],[null,null]]}}
]}

2: A relation that has references to ways which lack coordinates: rel(544634);out;way(r);out;

Input:

{ "elements": [

{ "type": "relation", "id": 1,
"members": [ {"type":"way","ref":2},{"type":"way","ref":3 } ],
"tags": {"type":"route"} },

{ "type": "way", "id": 2, "nodes": [4, 5] },
{ "type": "way", "id": 3, "nodes": [6, 7] }
] }

Output:

{"type":"FeatureCollection","features":[
{"type":"Feature","id":"relation/1",
"properties":{"type":"route","id":"relation/1"},
"geometry":{"type":"MultiLineString","coordinates":[[],[]]}}
]}

I believe in both of these cases the geometry should either be tainted (if some geometry is present) or null (if no geometry is present), in which case I believe the library will simply discard the feature; it's valid GeoJSON to have a null geometry but I don't think this library does that.

@jleedev jleedev linked a pull request Dec 5, 2023 that will close this issue
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 a pull request may close this issue.

1 participant