I think gdal/ogr(/proj4) doesn't recognize epsg:3068 right?
Here is what I tried:
public static void transformSRS(){
// creating EPSG:4326
SpatialReference sourceSRS = new SpatialReference();
sourceSRS.ImportFromEPSG(4326);
// creating EPSG:3068
SpatialReference targetSRS = new SpatialReference();
sourceSRS.ImportFromEPSG(3068);
// printing both SRS's
System.out.println(sourceSRS); // does get printed
System.out.println(targetSRS); // doesn't get printed!?
// creating a point in EPSG:3068 coordinates 850,-150
Geometry point = Geometry.CreateFromWkt("POINT(850 -150)");
// assigning EPSG:3068 to the point so the system knows that it is in EPSG:3068
point.AssignSpatialReference(sourceSRS);
// trying to transform it to EPSG:4326 but Exception occurs.
point.TransformTo(targetSRS);
}
and this is the output (first System.out.println() is working but the second one prints null and than the exception at point.TransformTo(targetSRS)
):
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4326"]]
ERROR 6: No translation for an empty SRS to PROJ.4 format is known.
Exception in thread "main" java.lang.RuntimeException: OGR Error: General Error
at org.gdal.ogr.ogrJNI.Geometry_TransformTo(Native Method)
at org.gdal.ogr.Geometry.TransformTo(Geometry.java:409)
at org.geotools.mavenGdal.Test.transformSRS(Test.java:880)
at org.geotools.mavenGdal.Test.main(Test.java:109)
Best Answer
You can test it with gdalsrsinfo http://www.gdal.org/gdalsrsinfo.html
Another test is to convert coordinates with gdaltransform http://www.gdal.org/gdaltransform.html
Conclusion: At least my GDAL does recognize EPSG:3068.