I'm trying to convert com.vividsolutions.jts.geom.Geometry to geography, using the GeoTools package - org.geotools.geometry.jts.JTS. This is my code:
public Geometry getGeography() {
Geometry geo = null;
try {
JTS.toGeographic(this.geo, CRS.decode("EPSG:" + Integer.toString(this.geo.getSRID()), true));
} catch (TransformException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NoSuchAuthorityCodeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (FactoryException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return geo;
}
I'm getting:
org.opengis.referencing.NoSuchAuthorityCodeException: No code "EPSG:0" from authority "EPSG" found for object of type "EngineeringCRS".
Can anybody assist on why the this.geo.getSRID() return 0?