Is there a way to divide a map into square grids and retrieve latitude/longitude information from there? [closed]

≡放荡痞女 提交于 2019-12-04 22:39:44

问题


I have a map of a specific area and I need to determine whether a given location -with lat-lon coordinates- falls into any grid that covers this map.

I decided to divide the map of the area I was given into 1 km x 1 km square grids using Google Earth -enabling the square grids using CTRL+L and zooming to the appropriate scale so that the grid lines are 1000 meters away from each other- and extract the entire data as KML, in order to get the latitude and longitude values for the corners of every single grid in my map and do a lookup from there -to see if the given lon/lat falls into any square grid and if it does, which grid etc.- but I don't know if this can be done -if Google earth allows me to extract its own square grid coordinates in KML format-.

Can someone provide any information about whether this is possible, and if possible how it can be done?


回答1:


Consider for example the area that is between latitude 89N and latitude 90N (the north pole). The earth's circumference at latitude 90N is 0, hence, this the total area is circle-shaped.

It is not possible to divide any part of a sphere or an ellipsoid surface into non-overlapping, adjusting rectangles.




回答2:


Not quite sure if this is what you are asking or not, but you can get the latitude and longitude of the Current View of the globe.

var view = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);
view.getLatitude();
view.getLongitude();

Here is some more information about the current view and the camera: https://developers.google.com/earth/documentation/camera_control



来源:https://stackoverflow.com/questions/12044467/is-there-a-way-to-divide-a-map-into-square-grids-and-retrieve-latitude-longitude

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!