#14974 closed defect (fixed)
GeoJSON export: some ways gets exported as polygons
Reported by: | TobWen | Owned by: | TobWen |
---|---|---|---|
Priority: | normal | Milestone: | 17.06 |
Component: | Core geojson | Version: | latest |
Keywords: | GeoJSON, polygon | Cc: |
Description (last modified by )
Ways with some tags get exported as polygons when exporting to GeoJSON.
Try this fake way:
<?xml version='1.0' encoding='UTF-8'?> <osm version='0.6' generator='JOSM'> <node id='-76119' lat='51.5099031' lon='6.8806761'> <tag k='highway' v='footway' /> </node> <node id='-76121' lat='51.5097885' lon='6.9040016'> <tag k='highway' v='footway' /> </node> <way id='-76135' action='modify'> <nd ref='-76119' /> <nd ref='-76121' /> <tag k='highway' v='footway' /> <tag k='man_made' v='surveillance' /> </way> </osm>
When exporting it to GeoJSON, it gets:
{ "type":"Feature", "properties":{ "highway":"footway", "man_made":"surveillance" }, "geometry":{ "type":"Polygon", "coordinates":[ [ [ 6.88067610000, 51.50990310000 ], [ 6.90400160000, 51.50978850000 ] ] ] } }
Changing a non-closed ways into an area produces lots of trouble of course.
Furthermore, according to the wiki, man_made = surveillance is mainly used on points, but can also be used on ways and polygons.
Attachments (0)
Change History (13)
comment:1 by , 8 years ago
Description: | modified (diff) |
---|
follow-up: 4 comment:2 by , 8 years ago
Owner: | changed from | to
---|---|
Status: | new → needinfo |
comment:3 by , 8 years ago
Milestone: | → 17.06 |
---|
comment:4 by , 8 years ago
Replying to Don-vip:
Replying to TobWen:
Furthermore, according to the wiki, man_made = surveillance is mainly used on points, but can also be used on ways and polygons.
Where do you read that? The wiki states the exact opposite. And taginfo counts 48.143 nodes against only 449 ways and 14 relations.
Hm? That's what I said: it's mainly used on nodes (48.143), but is also used on ways (of course, not very few only). But this makes the behavior of JOSM's GeoJSON-export to polygon even more confusing :)
comment:5 by , 8 years ago
Is "elemstyles.mapcss" controlling the GeoJSON export? That's the only place, where I've found k=man_made and v=surveillance as an area.
comment:6 by , 8 years ago
Yes, the polygon is guessed from tags based on standard style. But it should only concern closed ways.
follow-up: 10 comment:9 by , 8 years ago
I think we should remove the area rendering of man_made=surveillance in the internal mappaint style. Any objections?
comment:10 by , 8 years ago
Replying to Klumbumbus:
Any objections?
Go on. It was added long ago in r1006 but it was a mistake (copy/paste).
comment:12 by , 8 years ago
Maybe we should have a look here. It's updated and used widely: https://wiki.openstreetmap.org/wiki/Overpass_turbo/Polygon_Features
comment:13 by , 5 years ago
Component: | Core → Core geojson |
---|
Replying to TobWen:
Where do you read that? The wiki states the exact opposite. And taginfo counts 48.143 nodes against only 449 ways and 14 relations.