Modify

Opened 3 months ago

Closed 3 months ago

Last modified 3 months 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 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 (12)

comment:1 Changed 3 months ago by Don-vip

Description: modified (diff)

comment:2 in reply to:  description ; Changed 3 months ago by Don-vip

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 Changed 3 months ago by Don-vip

Milestone: 17.06

comment:4 in reply to:  2 Changed 3 months ago by TobWen

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 Changed 3 months ago by TobWen

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 Changed 3 months ago by Don-vip

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

comment:7 Changed 3 months ago by Don-vip

Resolution: fixed
Status: needinfoclosed

In 12439/josm:

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

comment:8 Changed 3 months ago by TobWen

Thx.

comment:9 Changed 3 months ago by Klumbumbus

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

comment:10 in reply to:  9 Changed 3 months ago by Don-vip

Replying to Klumbumbus:

Any objections?

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

comment:11 Changed 3 months ago by Klumbumbus

In 12440/josm:

see #14974 - use man_made=surveillance only on nodes

comment:12 Changed 3 months ago by TobWen

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 3 months ago by TobWen (previous) (diff)

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.