What is the formula for resolution for longitude (for latitiude works perfectly) (google maps)? -


the expression of geography phenomenon , geography features multi-scale.
scale represents comprehension extent , location precision of ground features. resolution , scale used measure scale. resolution in gis, called ground resolution or spatial resolution, represents actual distance pixel represents. take googlemap example: the zoom level 1
there 4 pictures size 256*256. spatial resolution of equator is: earth equatorial circumference (the actual distance) divided 256 * 2 (the pixel size). resolution of other latitudes is: the length of latitude circle / 512.

so can seen, resolution determined 2 factors: latitude , zoom level.

the zoom level determines pixel number. latitude determines ground distance. resolution of googlemap in view can calculated following formula (unit: meter/pixel):

f(x,y) = (cos(x*pi/180)*2*pi*r)/(256*2^y)  f(x,y): map resolution; x: latitude; y: zoom level; r: constant 6378137 represents earth radius. unit: meter. 

what formula resolution longitude (for latitude works perfectly)? (google maps)

there google maps function allows find bounding box of map.

var map; function initialize() {   var mapoptions = {     center: { lat: -34.397, lng: 150.644},     zoom: 8   };   map = new google.maps.map(document.getelementbyid('map-canvas'),       mapoptions);   //get bounds:   console.log(map.getbounds); } google.maps.event.adddomlistener(window, 'load', initialize); 

this log this:

-35.841477973835374, 153.5718564453125 -32.92715336680372, 147.7161435546875 

a google map uses mercator projection. means longitude stretches 1 side of map relative other. however, accurate approximation can taken difference between longitudes divided width of screen.


Comments