java - Geotools coordinate transform -
how translate coordinates epsg: 54003 in epsg:4326? utilize next code
`coordinatereferencesystem worldcrs = defaultgeographiccrs.wgs84; string wkt = "projcs[\"world_miller_cylindrical\",geogcs[\"gcs_wgs_1984\",datum[\"wgs_1984\",spheroid[\"wgs_1984\",6378137,298.257223563]],primem[\"greenwich\",0],unit[\"degree\",0.017453292519943295]],projection[\"miller_cylindrical\"],parameter[\"false_easting\",0],parameter[\"false_northing\",0],parameter[\"central_meridian\",0],unit[\"meter\",1],authority[\"epsg\",\"54003\"]]"; coordinatereferencesystem crs; mathtransform transform; seek { crs = crsfactory.createfromwkt(wkt); transform = crs.findmathtransform(crs, worldcrs, true); system.out.println(transform.towkt()); system.out.println(transform.getclass().getcanonicalname()); } grab (exception e) { e.printstacktrace(); } seek { transform = crs.findmathtransform(crs.decode("epsg:54003"), worldcrs, true); system.out.println(transform.towkt()); system.out.println(transform.getclass().getcanonicalname()); } grab (exception e) { e.printstacktrace(); } seek { transform = crs.findmathtransform(crs.decode("esri:54003"), worldcrs, true); system.out.println(transform.towkt()); system.out.println(transform.getclass().getcanonicalname()); } grab (exception e) { e.printstacktrace(); }`
in pom, set dependency
<dependency> <groupid>org.geotools</groupid> <artifactid>gt-epsg-extension</artifactid> <version>11.1</version> <scope>compile</scope> </dependency>
in response receiving
org.opengis.referencing.nosuchidentifierexception: no transform classification "miller_cylindrical". @ org.geotools.referencing.operation.defaultmathtransformfactory.getprovider(defaultmathtransformfactory.java:290) @ org.geotools.referencing.operation.defaultmathtransformfactory.getdefaultparameters(defaultmathtransformfactory.java:316) @ org.geotools.referencing.wkt.parser.parseprojection(parser.java:603) @ org.geotools.referencing.wkt.parser.parseprojcs(parser.java:917) @ org.geotools.referencing.wkt.parser.parsecoordinatereferencesystem(parser.java:225) @ org.geotools.referencing.wkt.parser.parsecoordinatereferencesystem(parser.java:204) @ org.geotools.referencing.factory.referencingobjectfactory.createfromwkt(referencingobjectfactory.java:1090) @ ru.oogis.bank.sxf.testcrs.main(testcrs.java:25) org.opengis.referencing.factoryexception: error in "projection": no transform classification "miller_cylindrical". @ org.geotools.referencing.factory.propertyauthorityfactory.createcoordinatereferencesystem(propertyauthorityfactory.java:399) @ org.geotools.referencing.factory.bufferedauthorityfactory.createcoordinatereferencesystem(bufferedauthorityfactory.java:783) @ org.geotools.referencing.factory.fallbackauthorityfactory.createcoordinatereferencesystem(fallbackauthorityfactory.java:644) @ org.geotools.referencing.factory.fallbackauthorityfactory.createcoordinatereferencesystem(fallbackauthorityfactory.java:644) @ org.geotools.referencing.factory.fallbackauthorityfactory.createcoordinatereferencesystem(fallbackauthorityfactory.java:644) @ org.geotools.referencing.factory.authorityfactoryadapter.createcoordinatereferencesystem(authorityfactoryadapter.java:801) @ org.geotools.referencing.factory.threadedauthorityfactory.createcoordinatereferencesystem(threadedauthorityfactory.java:731) @ org.geotools.referencing.defaultauthorityfactory.createcoordinatereferencesystem(defaultauthorityfactory.java:179) @ org.geotools.referencing.crs.decode(crs.java:519) @ org.geotools.referencing.crs.decode(crs.java:447) @ ru.oogis.bank.sxf.testcrs.main(testcrs.java:36) caused by: java.text.parseexception: error in "projection": no transform classification "miller_cylindrical". @ org.geotools.referencing.wkt.parser.parseprojection(parser.java:605) @ org.geotools.referencing.wkt.parser.parseprojcs(parser.java:917) @ org.geotools.referencing.wkt.parser.parsecoordinatereferencesystem(parser.java:225) @ org.geotools.referencing.wkt.parser.parsecoordinatereferencesystem(parser.java:204) @ org.geotools.referencing.factory.propertyauthorityfactory.createcoordinatereferencesystem(propertyauthorityfactory.java:396) ... 10 more caused by: org.opengis.referencing.nosuchidentifierexception: no transform classification "miller_cylindrical". @ org.geotools.referencing.operation.defaultmathtransformfactory.getprovider(defaultmathtransformfactory.java:290) @ org.geotools.referencing.operation.defaultmathtransformfactory.getdefaultparameters(defaultmathtransformfactory.java:316) @ org.geotools.referencing.wkt.parser.parseprojection(parser.java:603) ... 14 more org.opengis.referencing.nosuchauthoritycodeexception: authorization "esri" unknown or doesn't match supplied hints. maybe defined in unreachable jar file? @ org.geotools.referencing.factory.manyauthoritiesfactory.nosuchauthority(manyauthoritiesfactory.java:489) @ org.geotools.referencing.factory.manyauthoritiesfactory.getauthorityfactory(manyauthoritiesfactory.java:467) @ org.geotools.referencing.factory.manyauthoritiesfactory.getcrsauthorityfactory(manyauthoritiesfactory.java:548) @ org.geotools.referencing.factory.authorityfactoryadapter.createcoordinatereferencesystem(authorityfactoryadapter.java:801) @ org.geotools.referencing.factory.threadedauthorityfactory.createcoordinatereferencesystem(threadedauthorityfactory.java:731) @ org.geotools.referencing.defaultauthorityfactory.createcoordinatereferencesystem(defaultauthorityfactory.java:179) @ org.geotools.referencing.crs.decode(crs.java:519) @ org.geotools.referencing.crs.decode(crs.java:447) @ ru.oogis.bank.sxf.testcrs.main(testcrs.java:46)
is there esri:54003
crs code?
your geotools not know esri:54003
crs. need utilize epsg:54003
or other crs instead.
java maven geotools
No comments:
Post a Comment