Skip to content
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

Open
robertoricotti opened this issue Jan 4, 2023 · 17 comments
Open

Only Swedish CRS is working #2

robertoricotti opened this issue Jan 4, 2023 · 17 comments

Comments

@robertoricotti
Copy link

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.

@TomasJohansson
Copy link
Owner

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 or are you using the latest commited source code in this github repository?

@robertoricotti
Copy link
Author

robertoricotti commented Jan 4, 2023 via email

@TomasJohansson
Copy link
Owner

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.
Therefore I generated a new Android project and tried it from Android.
I got a compilation error related to geotools ("Task :app:mergeDebugJavaResource FAILED") but it compiled when I disabled geotools.
Then the transformations worked as expected (for the others than the disabled geotools of course).
I am attaching the project in a zip file so you can try it.
Let me know if it worked.
crstransformation_issue_2_android_java.zip

@robertoricotti
Copy link
Author

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.
Is it enough to //comment geotools implementation and re import project? no other action are required?

@robertoricotti
Copy link
Author

Last update,is working also in my project now, without geotools. I let you know if i find a way to implement geotools too.
Great and thank you for you support.

@TomasJohansson
Copy link
Owner

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.

@robertoricotti
Copy link
Author

robertoricotti commented Jan 6, 2023

Well, trying to success in Geotools implementation in Android i found this problem :
" FATAL EXCEPTION: main
Process: com.example.stx_piler, PID: 14785
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/awt/RenderingHints;
at org.geotools.referencing.CRS.decode(CRS.java:428)"
As i undestood GeoTools need 'java.awt' dependencies, that are not available on android,only desktop version. This could be the problem and why the other 5 libraries are working fine, but GeoTools.
I'm afraid that only GeoTools could give us the solution, with a Android library release...
Anyway i'll continue to looks for a solution and will back to you in case of any news. Please let me know if something will changes about this issue.
proj4j output is enough for me right now, and it seems to works perfectly.

@TomasJohansson
Copy link
Owner

Thank you for bringing my attention to the awt problem.
I have now updated the github page with some info about the GeoTools implementation not working with Android.

@robertoricotti
Copy link
Author

Is there a way to know the unit (m,USfeet,deg and so on) of every transformation result?

@TomasJohansson
Copy link
Owner

No. Possibly can be added in some future version, but currently that feature is not included.

@robertoricotti
Copy link
Author

Ok, I'll check periodically for upgrades,and will be great to find this feature in a next release

@robertoricotti
Copy link
Author

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?
Thanks in advance.

@robertoricotti
Copy link
Author

Found, browsing code there is perfectly explained how to do it.

@robertoricotti
Copy link
Author

Is it possible to use a gtx file for geode apply to the Z?

@TomasJohansson
Copy link
Owner

Sorry, but the answer is no.

@JigneshPiZone
Copy link

JigneshPiZone commented Sep 27, 2024

@TomasJohansson i have use your demo android app but it show different result than https://epsg.io/, am i missing something?

        crs_transform(32642, 21.7680412, 72.14742);
        crs_transform(32643, 21.7680412, 72.14742);

@TomasJohansson
Copy link
Owner

TomasJohansson commented Sep 27, 2024

@TomasJohansson i have use your demo android app but it show different result than https://epsg.io/, am i missing something?

        crs_transform(32642, 21.7680412, 72.14742);
        crs_transform(32643, 21.7680412, 72.14742);

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)
x 825524.534
y 2410470.802

Transforming to EPSG:32643 (UTM zone 43N)
x 204988.885
y 2409877.751

You get the same results from these two websites:
https://mygeodata.cloud/cs2cs/
https://tool-online.com/en/coordinate-converter.php
and also from the website you mentioned i.e. https://epsg.io

Two screenshots below from epsg.io (and their URL's) :
https://epsg.io/transform#s_srs=4326&t_srs=32642&x=72.1474200&y=21.7680411
epsg_io_32642

https://epsg.io/transform#s_srs=4326&t_srs=32643&x=72.1474200&y=21.7680411
epsg_io_32643

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants