Home > projection conversions > Getting: org.opengis.referencing.NoSuchIdentifierException: No transform for classification "Transverse Mercator Zoned Grid System" with geotools

Getting: org.opengis.referencing.NoSuchIdentifierException: No transform for classification "Transverse Mercator Zoned Grid System" with geotools

April 22Hits:2
Advertisement

Using geotools I've been trying to create a referenced envelope after converting/reprojecting from WGS 84 to UTM with specific zones and it seems that either I need to do something with authority factories or figure out some kind of a workaround for this.

Here are the errors:

Exception in thread "main" org.opengis.referencing.NoSuchIdentifierException: No transform for classification "Transverse Mercator Zoned Grid System". at org.geotools.referencing.operation.DefaultMathTransformFactory.getProvider(DefaultMathTransformFactory.java:290) at org.geotools.referencing.operation.DefaultMathTransformFactory.getDefaultParameters(DefaultMathTransformFactory.java:316) at org.geotools.referencing.factory.epsg.DirectEpsgFactory.createCoordinateOperation(DirectEpsgFactory.java:2610) at org.geotools.referencing.factory.BufferedAuthorityFactory.createCoordinateOperation(BufferedAuthorityFactory.java:1041) at org.geotools.referencing.factory.epsg.DirectEpsgFactory.createCoordinateReferenceSystem(DirectEpsgFactory.java:1955) at org.geotools.referencing.factory.BufferedAuthorityFactory.createCoordinateReferenceSystem(BufferedAuthorityFactory.java:783) at org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinateReferenceSystem(AuthorityFactoryAdapter.java:801) at org.geotools.referencing.factory.FallbackAuthorityFactory.createCoordinateReferenceSystem(FallbackAuthorityFactory.java:640) at org.geotools.referencing.factory.FallbackAuthorityFactory.createCoordinateReferenceSystem(FallbackAuthorityFactory.java:644) at org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinateReferenceSystem(AuthorityFactoryAdapter.java:801) at org.geotools.referencing.factory.ThreadedAuthorityFactory.createCoordinateReferenceSystem(ThreadedAuthorityFactory.java:731) at org.geotools.referencing.DefaultAuthorityFactory.createCoordinateReferenceSystem(DefaultAuthorityFactory.java:179) at org.geotools.referencing.CRS.decode(CRS.java:489) at org.geotools.referencing.CRS.decode(CRS.java:417) 

Here is the block of code that caused the error, it is related to trying to use CRS.decode():

    MathTransform mathTransform = CRS.findMathTransform(aoi.getCoordinateReferenceSystem(), CRS.decode("EPSG:" + epsg));     DirectPosition2D srcDirectPosition2D = new DirectPosition2D(aoi.getCoordinateReferenceSystem(), aoi.getMinX(), aoi.getMinY());     DirectPosition2D destDirectPosition2D = new DirectPosition2D();     mathTransform.transform(srcDirectPosition2D, destDirectPosition2D);     DirectPosition2D srcMaxDirectPosition2D = new DirectPosition2D(aoi.getCoordinateReferenceSystem(), aoi.getMaxX(), aoi.getMaxY());     DirectPosition2D destMaxDirectPosition2D = new DirectPosition2D();     mathTransform.transform(srcMaxDirectPosition2D, destMaxDirectPosition2D); 

This is what I got when I printed out the coordinate reference system:

PROJCS["WGS 84 / UTM zone 18N",  GEOGCS["WGS 84",  DATUM["World Geodetic System 1984",    SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]],    AUTHORITY["EPSG","6326"]],  PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],  UNIT["degree", 0.017453292519943295],  AXIS["Geodetic latitude", NORTH],  AXIS["Geodetic longitude", EAST],  AUTHORITY["EPSG","4326"]],  PROJECTION["Transverse_Mercator", AUTHORITY["EPSG","9807"]],  PARAMETER["central_meridian", -75.0],  PARAMETER["latitude_of_origin", 0.0],  PARAMETER["scale_factor", 0.9996],  PARAMETER["false_easting", 500000.0],  PARAMETER["false_northing", 0.0],  UNIT["m", 1.0],  AXIS["Easting", EAST],  AXIS["Northing", NORTH],  AUTHORITY["EPSG","32618"]] 

Apparently I may need to set a comparison tolerance when I use CRS related functions, but I'm not sure how to go about doing that.

http://docs.geotools.org/latest/javadocs/org/geotools/referencing/CRS.html

Related Articles

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.539 s.