bjornharrtell / jts2geojson

JTS from/to GeoJSON converter for Java
MIT License
138 stars 56 forks source link

JsonMappingException when deserializing a GeometryCollection #14

Closed jeffreyeriksondg closed 8 years ago

jeffreyeriksondg commented 8 years ago

When I attempt to deserialize a GeometryCollection, I run into this exception:

Cause: com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of org.wololo.geojson.Geometry, problem: abstract types either need to be mapped to concrete types, have custom deserializer, or be instantiated with additional type information
 at [Source: N/A; line: -1, column: -1] (through reference chain: org.wololo.geojson.GeometryCollection["geometries"]->Object[][0])

The following GeoJSON will cause the exception:

{ "type": "GeometryCollection",
    "geometries": [
        {
            "type": "Point",
            "coordinates": [ 1.1, 2.2 ]
        }
    ]
}

I've taken the liberty of creating a pull request with the fix. Please let me know if you'd like any more information. Thanks!

jeffreyeriksondg commented 8 years ago

The pull request referenced above is #13

bjornharrtell commented 8 years ago

Thanks for the fix, #13 is now merged.