﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
22372	Problem with GeoJSON Export for MultiPolygon or in boundaries.osm	anonymous	team	"==== What steps will reproduce the problem?
1. Open this file in JOSM https://josm.openstreetmap.de/export/HEAD/josm/trunk/resources/data/boundaries.osm
2. Save it as GeoJSON
3. E.g. search for America or US and view the created MultiPolygon (or any other MultiPolygon country)

==== What is the expected result?

The MultiPolygon boundary should consist of several polygons which is a multidimensional array like this:

{{{
""geometry"": {
 ""type"": ""MultiPolygon"",
 ""coordinates"": [
   [[[-65.27974,17.56928], [-68.20301,17.83927], [-67.99519,18.97186], [-65.02435, 18.73231], [-65.27974, 17.56928]]],
   [[[143.82485,13.92273], [144.18594,21.03576], [146.67550,21.00809], [146.25931, 13.85876], [143.82485, 13.92273]]],
   ...
 ]
}

}}}

==== What happens instead?

Instead the outer relations are merged into one Polygon:
{{{
""geometry"": {
 ""type"": ""MultiPolygon"",
 ""coordinates"": [[
   [[-65.27974,17.56928], [-68.20301,17.83927], [-67.99519,18.97186], [-65.02435, 18.73231], [-65.27974, 17.56928]],
   [[143.82485,13.92273], [144.18594,21.03576], [146.67550,21.00809], [146.25931, 13.85876], [143.82485, 13.92273]],
   ...
 ]]
}
}}}

This basically says the first Polygon consists of a shell and many holes.

So IMO there are two problems here:

1. the boundaries.osm uses 'way' for the member type but should probably use 'relation' to separate the polygons? 
2. merging the outer ways should lead to a Polygon without holes like this:

{{{
""geometry"": {
 ""type"": ""MultiPolygon"",
 ""coordinates"": [[[
    [-65.27974,17.56928], [-68.20301,17.83927], [-67.99519,18.97186], [-65.02435, 18.73231], [-65.27974, 17.56928],
    [143.82485,13.92273], [144.18594,21.03576], [146.67550,21.00809], [146.25931, 13.85876], [143.82485, 13.92273],
    ...
 ]]]
}
}}}

Obviously the data behind this does not make much sense to consider this output correct, but IMO the 'outer' type should not create holes (only the 'inner' type should?). But maybe I misunderstood something.

==== Please provide any additional information below. Attach a screenshot if possible.

{{{
Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2022-08-29 16:59:00 +0200 (Mon, 29 Aug 2022)
Revision:18543
Build-Date:2022-08-30 01:30:57
URL:https://josm.openstreetmap.de/svn/trunk
Dataset consistency test: No problems found
}}}
"	defect	new	normal		Core geojson			template_report	
