Android Question Coordinate change ...

Spectre

Active Member
Licensed User
Longtime User
Hi!
.. can someone help me change coordinates eg switch from UTM WGS84 to UTM ED50?
I am using the module Geodesic to go from lat, lon to UTM (WGS84) without any problems, but if he tried to convert from WGS to ED50 coordinates returned are not right.

Yet the distance from the equator and Flattering are correct ...

here is a fragment of code where I insert Flattering and distance...

B4X:
Convert LatLon to UTM using WGS84 datum
Public Sub WGS84LatLonToUTM(LL As LatLon) As UTM

    Select Case Global.Glob_GPS_DATUM 
    Case "WGS84" 
        Return LatLonToUTM(6378137, 0.003352810665, LL)
    Case "ED50"
        Return LatLonToUTM(6378388, 0.003367003367, LL)
    End select

    ..... ecc ecc ecc
end sub
 

warwound

Expert
Licensed User
Longtime User
Can the the JTS Topology Suite be used to convert from one projection to another projection?
Read http://www.b4x.com/android/forum/threads/spatialite.36296/page-2#post-239149 and http://www.b4x.com/android/forum/threads/spatialite.36296/page-2#post-241098.
Finally a google search: https://www.google.co.uk/search?q=jts+convert+projection&ie=UTF-8&oe=UTF-8.

I partly wrapped JTS to enable use of it's WKBReader and WKTReader classes, if you can work out which other classes are required for projection conversion i'll add them to the library.

Martin.
 
Upvote 0

Spectre

Active Member
Licensed User
Longtime User
Can you post the values you are trying to convert with the correct results?

UTM WGS84 original Position: 32T 670943 N4760731 convert to lat/lon (Geodesic) Result: 42. 58 48,1503 - 11. 5 47,5357

Convert 42. 58 48,1503 - 11. 5 47,5357 to UTM ED50 (geodesic 6378388, 0.003367003367) result UTM: 32T 670941 N4760735

Correct result: UTM 32T 671027 N4760927
 
Upvote 0
Top