-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only Swedish CRS is working #2
Comments
Can you please show the code you tried to use? |
gradle:
//crs
implementation 'com.programmerare.crs-transformation:crs-transformation-constants:10.027' // only one class with constants
// The above "crs-transformation-constants" is a Java library
def crsTransformationAdapterVersion = "2.0.0"
implementation "com.programmerare.crs-transformation:crs-transformation-adapter-core:$crsTransformationAdapterVersion"
implementation "com.programmerare.crs-transformation:crs-transformation-adapter-impl-proj4jlocationtech:$crsTransformationAdapterVersion"
implementation "com.programmerare.crs-transformation:crs-transformation-adapter-impl-proj4j:$crsTransformationAdapterVersion"
implementation "com.programmerare.crs-transformation:crs-transformation-adapter-impl-orbisgis:$crsTransformationAdapterVersion"
implementation "com.programmerare.crs-transformation:crs-transformation-adapter-impl-nga:$crsTransformationAdapterVersion"
implementation "com.programmerare.crs-transformation:crs-transformation-adapter-impl-goober:$crsTransformationAdapterVersion" // only swedish CRS
implementation "com.programmerare.crs-transformation:crs-transformation-adapter-impl-geotools:$crsTransformationAdapterVersion" // you should also include the above geotools (repo.osgeo.org) repository
code in activity that is working:
final int epsgWgs84 = 4326;
final int epsgSweRef = 3006;
CrsCoordinate centralStockholmWgs84 = CrsCoordinateFactory.latLon(43.78147, 11.21845, epsgWgs84);
CrsTransformationAdapter crsTransformationAdapter = CrsTransformationAdapterCompositeFactory.createCrsTransformationMedian();
CrsTransformationResult centralStockholmResultSweRef = crsTransformationAdapter.transform(centralStockholmWgs84, epsgSweRef);
if(centralStockholmResultSweRef.isSuccess()) {
Log.d("OutTest", String.valueOf(centralStockholmResultSweRef.getOutputCoordinate()));
//out=Coordinate(xEastingLongitude=195697.355, yNorthingLatitude=4854555.05)
}else{
Log.d("OutTest", "Error Transform");
}
code in activity is not working:
final int epsgWgs84 = 4326;
final int epsgSweRef = 3064;
CrsCoordinate centralStockholmWgs84 = CrsCoordinateFactory.latLon(43.78147, 11.21845, epsgWgs84);
CrsTransformationAdapter crsTransformationAdapter = CrsTransformationAdapterCompositeFactory.createCrsTransformationMedian();
CrsTransformationResult centralStockholmResultSweRef = crsTransformationAdapter.transform(centralStockholmWgs84, epsgSweRef);
if(centralStockholmResultSweRef.isSuccess()) {
Log.d("OutTest", String.valueOf(centralStockholmResultSweRef.getOutputCoordinate()));
//out=Coordinate(xEastingLongitude=195697.355, yNorthingLatitude=4854555.05)
}else{
Log.d("OutTest", "Error Transform");
//out=OutTest: Error Transform
}
second example print "Error Transform" in Log Page
…________________________________
Da: Tomas Johansson ***@***.***>
Inviato: mercoledì 4 gennaio 2023 14:18
A: TomasJohansson/crsTransformations ***@***.***>
Cc: robertoricotti ***@***.***>; Author ***@***.***>
Oggetto: Re: [TomasJohansson/crsTransformations] Only Swedish CRS is working (Issue #2)
Can you please show the code you tried to use?
How does it fail for you, I mean do you get an incorrect result or is some exception thrown?
Are you using the latest published version 2.0.0<https://github.com/TomasJohansson/crsTransformations/releases/tag/v2.0.0> or are you using the latest commited source code in this github repository?
—
Reply to this email directly, view it on GitHub<#2 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AVE4PKIR24DMLISEXEJOTW3WQV2BNANCNFSM6AAAAAATQGUV2Y>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
It worked fine when I was running it from a console application, but I noticed the word you used "activity" and code "Log.d" so I see that you are using Android. |
yes, your code seems to be ok without GeoTools. Now i have to understand why is not working for me even if Geotools is not implemented. |
Last update,is working also in my project now, without geotools. I let you know if i find a way to implement geotools too. |
You're welcome. Nice to hear that it works for you now, and yes please let me know if you figure out how to use the geotools implementation from Android, thank you. |
Well, trying to success in Geotools implementation in Android i found this problem : |
Thank you for bringing my attention to the awt problem. |
Is there a way to know the unit (m,USfeet,deg and so on) of every transformation result? |
No. Possibly can be added in some future version, but currently that feature is not included. |
Ok, I'll check periodically for upgrades,and will be great to find this feature in a next release |
Hi Tomas,me again. I see last EPSG constant update is 10.027, in 2021. Epsg.io is arrived now at 10.082. is there a way to let me update EPSGNumber class or generate a new one by myself? |
Found, browsing code there is perfectly explained how to do it. |
Is it possible to use a gtx file for geode apply to the Z? |
Sorry, but the answer is no. |
@TomasJohansson i have use your demo android app but it show different result than https://epsg.io/, am i missing something?
|
I got the following results, with all five (i.e. Proj4j, NGA, Orbis ...) adapter implementations, when trying with my above android app: Transforming to EPSG:32642 (UTM zone 42N) Transforming to EPSG:32643 (UTM zone 43N) You get the same results from these two websites: Two screenshots below from epsg.io (and their URL's) : https://epsg.io/transform#s_srs=4326&t_srs=32643&x=72.1474200&y=21.7680411 |
Great repo, but i don't understand how let it wotks with all EPSG, only 3006, the one in example, is working for me, any other is failing the Transformation. Where i'm making wrong?
I just copied example code and trying to change values of Lat Lon and EPSG.
The text was updated successfully, but these errors were encountered: