This equations takes in latitude and longitude and returns the y and x coordinates :
y = R * cos(latitude) * sin(longitude);
x = R * cos(latitude) * cos(longitude);
example longitude and latitude :
“lat”: 19.0733000,
“lon”: 82.9479000,
z coordinate does not exist as its 2d.
Now I get some sort of map part displayed but not so correct in most cases, I googled converting from longitude latitude, and as openStreetMap uses Mercator projection, but using I have a separate question, that how to deal with plotting floating point number values of x and y on screen ?
How the formula can be applied ?
And why using the equation I am using is in appropriate ?
No, you cannot use the above formula to plot in a 2d plane. Trying (0N, 0E) gives coordinates (
R, 0) and (0N, 90E) gives coordinates (0, R).
This gis link discusses the Mercator projection: https://gis.stackexchange.com/questions/20686/mercator-projection-problem-with-latitude-formula