From: <Shy...@co...> - 2008-12-02 14:51:56
|
Hi, I am using GeoTools 2.5.0. I want to project data in another CRS to Google Mercator CRS. I was previously using WKT to create the Google Mercator CRS. Since now we have an official EPSG code for the same I want to switch over to that. Please find below the code that I have written. CRSAuthorityFactory factory = CRS.getAuthorityFactory(true); CoordinateReferenceSystem crs = factory.createCoordinateReferenceSystem("EPSG:3785"); The same code worked when I used EPSG:4326. I have added gt-epsg-extension-2.5.0.jar to the classpath. Even after doing so I get the following exception: Exception in thread "main" org.opengis.referencing.NoSuchAuthorityCodeException: No code "EPSG:3785" from authority "European Petroleum Survey Group" found for object of type "CoordinateReferenceSystem". at org.geotools.referencing.factory.AbstractAuthorityFactory.noSuchAuthorit yCode(AbstractAuthorityFactory.java:949) at org.geotools.referencing.factory.epsg.DirectEpsgFactory.createCoordinate ReferenceSystem(DirectEpsgFactory.java:2000) at org.geotools.referencing.factory.BufferedAuthorityFactory.createCoordina teReferenceSystem(BufferedAuthorityFactory.java:781) at org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinat eReferenceSystem(AuthorityFactoryAdapter.java:798) at org.geotools.referencing.factory.BufferedAuthorityFactory.createCoordina teReferenceSystem(BufferedAuthorityFactory.java:781) at org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinat eReferenceSystem(AuthorityFactoryAdapter.java:798) at org.geotools.referencing.factory.FallbackAuthorityFactory.createCoordina teReferenceSystem(FallbackAuthorityFactory.java:638) at org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinat eReferenceSystem(AuthorityFactoryAdapter.java:798) at org.geotools.referencing.factory.ThreadedAuthorityFactory.createCoordina teReferenceSystem(ThreadedAuthorityFactory.java:729) at org.geotools.referencing.DefaultAuthorityFactory.createCoordinateReferen ceSystem(DefaultAuthorityFactory.java:179) at com.cognizant.clips.data.utils.ShapeFileTransformer.getCoordinateReferen ceSystem(ShapeFileTransformer.java:233) at com.cognizant.clips.data.utils.ShapeFileTransformer.main(ShapeFileTransf ormer.java:90) I had a similar error when I used EPSG:900913. I referred to other posts and there was a mention that epsg-ext jar had to be added to the classpath for this. I am assuming that the jar referred to is gt-epsg-extension-2.5.0.jar. I have not configured any EPSG databases. On checking the esri.properties file in gt-epsg-extension-2.5.0.jar, I could not find an entry for 3785 and 900913. Please let me know if I am missing something. Thanks and Regards, Shyam Sundar.N This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful. |