The problem is very easy to fix. The com.vividsolutions.jts.geom.Geometry class has a method:
public Envelope getEnvelopeInternal() {
if (envelope == null) {
envelope = computeEnvelopeInternal();
}
return new Envelope(envelope);
}
The com.vividsolutions.jts.geom.EmptyGeometry implementation (in gt-xsd-gml3 jar file) implements *computeEnvelopeInternal *method like this:
@Override
protected Envelope computeEnvelopeInternal() {
return null;
}
This causes that the Envelope constructor gets null and thus throws NullPointerException.
I got this issue when I tried to write SimpleFeatureCollection to GeoJsonFormat and at least one of the features had EmptyGeometry.
|