I want to transform my EPSG:25833 coordinates to google WGS84 at my android app. After long time searching i found the Coordinate Transformation Suite (abridged CTS) library.
Has anybody a working example
if i try the example from orbisgis i get the error Caused by: java.lang.ClassNotFoundException: Didn't find class "org.slf4j.LoggerFactory" on path:
CRSFactory cRSFactory = new CRSFactory();
// Add the appropriate registry to the CRSFactory's registry manager. Here the EPSG registry is used.
RegistryManager registryManager = cRSFactory.getRegistryManager();
registryManager.addRegistry(new EPSGRegistry());
// CTS will read the EPSG registry seeking the 4326 code, when it finds it,
// it will create a CoordinateReferenceSystem using the parameters found in the registry.
CoordinateReferenceSystem crs = cRSFactory.getCRS("EPSG:25833");
// CoordinateReferenceSystem crs2 = cRSFactory.getCRS("EPSG:4326");
double[] coord = new double[2];
coord[0] = 54.321;
coord[1] = 9.876;
CoordinateReferenceSystem crs1 = cRSFactory.getCRS("EPSG:4326");
CoordinateReferenceSystem crs2 = cRSFactory.getCRS("EPSG:25832");
GeodeticCRS sourceGCRS = (GeodeticCRS) crs;
GeodeticCRS targetGCRS = (GeodeticCRS) crs2;
List<CoordinateOperation> coortzdOps = CoordinateOperationFactory.createCoordinateOperations(sourceGCRS,targetGCRS);
if (coortzdOps.size() != 0) {
for (CoordinateOperation op : coortzdOps) {
double[] dd = op.transform(coord);
for (int i = 0; i < dd.length; i++) {
}
}
}
Error log:
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/slf4j/LoggerFactory; at org.cts.registry.RegistryManager.(RegistryManager.java:40) at org.cts.CRSFactory.(CRSFactory.java:68) at com..transform.trans(transform.java:169) at com..MapGoogle.onMapReady(MapGoogle.java:75) at com.google.android.gms.maps.SupportMapFragment$zza$1.zza(Unknown Source) at com.google.android.gms.maps.internal.zzp$zza.onTransact(Unknown Source) at android.os.Binder.transact(Binder.java:392) at xz.a(:com.google.android.gms.DynamiteModulesB:82) at maps.ad.u$5.run(Unknown Source) at android.os.Handler.handleCallback(Handler.java:815) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:5683) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:749) Caused by: java.lang.ClassNotFoundException: Didn't find class "org.slf4j.LoggerFactory" on path: D