Description
Hi,
I noticed that the GeojsonPolygonconvertor does not convert the inner rings. If you want to convert a polygon with holes. It only looks at the outer ring.
This is very apparent in the code in line 759 of GeoConverters.java.
static GeoJsonPolygon toGeoJsonPolygon(List dbList) { return new GeoJsonPolygon(toListOfPoint((List) dbList.get(0))); }
As you can see, it only looks at the first item in the list of rings (e.g. the outer ring).
I've already fixed it with a custom convertor (see attachment, although this is for multipolygons), but it might be nice to have this in the core.
I think that in order to fix it, the toGeoJsonPolygon(List dbList) function in GeoConverters.java needs to change to:
static GeoJsonPolygon toGeoJsonPolygon(List dbList) { Iterator<GeoJsonLineString> it = ((List) dbList).iterator(); GeoJsonPolygon g = new GeoJsonPolygon(toListOfPoint((List) it.next())); while (it.hasNext()) g = g.withInnerRing(toListOfPoint((List) it.next())); return g; }