Skip to content

Fix handling of Geometries in the Json converter #9

@Aklakan

Description

@Aklakan

The code in RdfJsonUtils will probably fail with exception for non-WKT geometry literals. Needs to be fixed and tested.

} else if(obj instanceof GeometryWrapper) {
WKTReader wktReader = new WKTReader();
try {
final Geometry geom = wktReader.read(node.getLiteralLexicalForm());
GeoJsonWriter geoJsonWriter = new GeoJsonWriter();
String jsonString = geoJsonWriter.write(geom);
Gson gson = new Gson();
result = gson.fromJson(jsonString, JsonObject.class);
} catch (ParseException e) {
throw new RuntimeException("Invalid WKT : " + node);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions