Modify

Opened 7 years ago

Closed 7 years ago

Last modified 4 years ago

#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 Don-vip)

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 Don-vip, 7 years ago

Description: modified (diff)

in reply to:  description ; comment:2 by Don-vip, 7 years ago

Owner: changed from team to TobWen
Status: newneedinfo

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.

comment:3 by Don-vip, 7 years ago

Milestone: 17.06

in reply to:  2 comment:4 by TobWen, 7 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 TobWen, 7 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 Don-vip, 7 years ago

Yes, the polygon is guessed from tags based on standard style. But it should only concern closed ways.

comment:7 by Don-vip, 7 years ago

Resolution: fixed
Status: needinfoclosed

In 12439/josm:

fix #14974 - geojson export: use Polygon only for closed ways

comment:8 by TobWen, 7 years ago

Thx.

comment:9 by Klumbumbus, 7 years ago

I think we should remove the area rendering of man_made=surveillance in the internal mappaint style. Any objections?

in reply to:  9 comment:10 by Don-vip, 7 years ago

Replying to Klumbumbus:

Any objections?

Go on. It was added long ago in r1006 but it was a mistake (copy/paste).

comment:11 by Klumbumbus, 7 years ago

In 12440/josm:

see #14974 - use man_made=surveillance only on nodes

comment:12 by TobWen, 7 years ago

Maybe we should have a look here. It up to date and used in many applications: https://wiki.openstreetmap.org/wiki/Overpass_turbo/Polygon_Features

Last edited 7 years ago by TobWen (previous) (diff)

comment:13 by Don-vip, 4 years ago

Component: CoreCore geojson

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain TobWen.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.