Modify

Opened 2 years ago

Closed 2 years ago

Last modified 8 months ago

#16138 closed defect (fixed)

Empty geometry objects in Json output

Reported by: anonymous Owned by: team
Priority: normal Milestone: 18.04
Component: Core geojson Version:
Keywords: template_report geojson Cc:

Description (last modified by Don-vip)

What steps will reproduce the problem?

  1. Save downloaded OSM data as geojson

What is the expected result?

The output should be standard conforming, that is if there is no geometry available for the Feature there should be no geometry object present.

What happens instead?

An empty geometry object is added to the geojson Feature for some (not all) OSM multipolygons.

        {
            "type":"Feature",
            "properties":{
                "landuse":"residential",
                "type":"multipolygon"
            },
            "geometry":{
            }
        }

Please provide any additional information below. Attach a screenshot if possible.

URL:http://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2016-11-06 20:18:38 +0100 (Sun, 06 Nov 2016)
Build-Date:2016-11-06 21:45:03
Revision:11223
Relative:URL: ^/trunk

Identification: JOSM/1.5 (11223 en) Windows 10 64-Bit
Memory Usage: 488 MB / 488 MB (151 MB allocated, but free)
Java version: 1.8.0_111-b14, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: \Display0 1920x1200, \Display1 1920x1200
Maximum Screen Size: 1920x1200
Dataset consistency test: No problems found

Plugins:
+ FastDraw (33182)
+ ImproveOsm (110)
+ Mapillary (v1.5.3)
+ OpeningHoursEditor (33185)
+ PicLayer (33148)
+ apache-commons (33668)
+ apache-http (32699)
+ cadastre-fr (33088)
+ editgpx (33004)
+ ejml (32680)
+ geotools (33380)
+ imagery_offset_db (33267)
+ jts (32699)
+ kendzi3d-resources (0.0.1)
+ log4j (32699)
+ measurement (33088)
+ opendata (33088)
+ reverter (33088)
+ terracer (33088)
+ turnrestrictions (33088)
+ undelete (33480)
+ utilsplugin2 (33328)

Tagging presets:
+ http://openstreetmap.org.pl/kendzi/preset/current/roofspresets.xml
+ http://josm.openstreetmap.de/josmfile?page=Presets/LaneAttributes&preset
+ %UserProfile%\git\wheelchair-preset\gen\wheelchair.zip
+ https://github.com/<user.name>poole/military-preset/raw/gh-pages/gen/military.zip
+ https://github.com/<user.name>poole/beautified-JOSM-preset/raw/master/gen/josm.zip
+ %UserProfile%\git\preset-utils\josm_preset.xml

Map paint styles:
- http://josm.openstreetmap.de/josmfile?page=Styles/Lane_features_ryg&style
- http://josm.openstreetmap.de/josmfile?page=Styles/Lane_features&style
+ http://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/NewHighwayColors&zip=1

Last errors/warnings:
- W: java.io.IOException: Attribution is not loaded yet
- W: java.io.IOException: Attribution is not loaded yet
- W: java.io.IOException: Attribution is not loaded yet
- W: java.net.SocketTimeoutException: Read timed out
- W: java.net.SocketTimeoutException: Read timed out
- W: java.net.SocketTimeoutException: Read timed out
- W: java.net.SocketTimeoutException: Read timed out
- W: java.net.SocketTimeoutException: Read timed out
- W: GeoJSON: Failed to export multipolygon 2,171,891
- W: org.openstreetmap.josm.data.osm.MultipolygonBuilder$JoinedPolygonCreationException: Each node must connect exactly 2 ways

Attachments (1)

test3.zip (1.8 MB) - added by Don-vip 12 months ago.
OSM file + geojson file showing issue (and empty boundingbox issue)

Download all attachments as: .zip

Change History (8)

comment:1 Changed 2 years ago by Don-vip

Owner: changed from team to anonymous
Status: newneedinfo

can you please attach your .osm file? I don't know how to reproduce.

comment:2 Changed 2 years ago by Don-vip

Owner: changed from anonymous to team
Status: needinfonew

thanks!

comment:3 Changed 2 years ago by Don-vip

According to rfc7946 we should set the value to null:

   o  A Feature object has a "type" member with the value "Feature".

   o  A Feature object has a member with the name "geometry".  The value
      of the geometry member SHALL be either a Geometry object as
      defined above or, in the case that the Feature is unlocated, a
      JSON null value.

   o  A Feature object has a member with the name "properties".  The
      value of the properties member is an object (any JSON object or a
      JSON null value).

comment:4 Changed 2 years ago by Don-vip

Keywords: geojson added
Milestone: 18.04

comment:5 Changed 2 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 13589/josm:

fix #16138 - do not output empty GeoJson geometries but null instead (as per ​RFC7946)

Changed 12 months ago by Don-vip

Attachment: test3.zip added

OSM file + geojson file showing issue (and empty boundingbox issue)

comment:6 Changed 12 months ago by Don-vip

Description: modified (diff)

comment:7 Changed 8 months ago by Don-vip

Component: CoreCore geojson

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
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.