android - How to get the pixel size of the full map? -


i have partial map of world (like america or africa). , need know pixel size of world map based on size of partial/cropped map pixel size.

i have size in pixel of partial map (like 480x256), , have minlongitude,maxlongitude,minlatitude,maxlatitude (aka left,right,top,bottom edge)

i know longitude easy because linear :

full_circle_deg = 360

longitudedelta = (maxlongitude-minlongitude)/full_circle_deg

mapfullsize = mapcroppedwidth/longitudedelta

but latitude, it's kind of different:

full_latitude_deg = max_lat_on_earth - min_lat_on_earth (like 85.7543...-(-85.7543...))

latitudedelta = (maxlatitude-minlatitude)/full_latitude_deg

mapfullheight = ????

please can me ?

i find lot of algorithm gpscoordinatetopixel conversion nothing on square calculation.

thank you.

here's idea. first work out area of rectangle specified minlongitude,maxlongitude,minlatitude,maxlatitude. ratio of current map area area of whole world map used scale current number of pixels map occupies number of pixels required whole map.

to work out area map occupies, think need bit of spherical trigonometry, , can find need here on wikipedia. page on wikipedia gives formula area of spherical triangle, if regard rectangle 2 triangles, can use formula , calculate area of current map.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -