vaal
vaal

Reputation: 153

How to convert geo coordinates to meters with a specific starting point?

I need to convert geo coordinates to meters. I already learned about proj4 and etc. But I need to be able to specify the "zero" coordinate from which the countdown of meters will begin. And the error should be less than 500 meters. Is it possible?

Upvotes: 0

Views: 1369

Answers (1)

Surabhi Mundra
Surabhi Mundra

Reputation: 377

Two approaches:

1) UTM: This system has predefined origin and all the meters grids are calculated from there. However the calculation are almost accurate https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system

2) meters_XY=LatLonToMeters(x,y) meters_xOrigin_yOrigin=LatLonToMeters(xOrigin,yOrigin) Take difference of meters_XY and meters_xOrigin_yOrigin. This way you will have meters from your origin.

Code for LatLonToMeters is available at: https://github.com/Prafulljohri/gmap-tile-generator/blob/master/gmaps-tile-creator/src/gov/ca/maps/tile/geom/GlobalMercator.java

Upvotes: 1

Related Questions