Skip to content

The GeoJsonModule deserialize creates an invalid GeoJsonMultiPolygon #4586

Open
@boundaries-io

Description

@boundaries-io

The GeoJson deseralizer creates an invalid GeoJsonMultiPolygon that contain holes.

For example, while using a valid GeoJson MultiPolygon: Dallas, Texas GeoJson
image

invoking the method

	ObjectMapper mapper = new ObjectMapper();
	mapper.registerModule(GeoJsonModule.serializers());
	mapper.registerModule(GeoJsonModule.deserializers());

 	String dallas = FileUtils.readFileToString(new File("src/test/resources/raw_dallas.geojson"));
	GeoJsonMultiPolygon geoJsonMultiPolygon =  mapper.readValue(dallas, GeoJsonMultiPolygon.class);		 
 	String json =  getObjectMapper().writeValueAsString(geoJsonMultiPolygon);	
	Assert.assertEquals(dallas,json);//fails 	

The JSON is incorrect, the 'holes' that make up the original Multipolygon are being created incorrectly.
Invalid Dallas, Texas GeoJson
image

-Jeryl Cook

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions