4

i'm trying to geocode values and map them to a satellite image of a city (new york city to be precise). i've successfully done this before using a geospatial image of the world, and then mapped/scaled longitude and latitude values from the max lat/lng range (-90,90 & -180,180) to the max width and hight of the image (0,width & 0,height) which worked perfectly. i'm a bit confused how to do this to just a map of a city.

currently, i have a hi-res satellite image of new york city, and have positioned it so that it perfectly aligns with the map of new york city on Google Maps (i'm using their API to geocode my locations). i've attempted to get the top/bottom latitude values and left/right longitude values of the satellite image i'm using, and tried to scale any longitude/latitude values that needed to be mapped onto the image within this range. however, this didn't seem to work. is there another method i could use so that it would be possible to dynamically map lat/lng coordinates onto a satellite image of new york city?

this is essentially the image that i would like to map onto: alt text

thanks.

4

2 回答 2

6

如果您知道图像大小及其地理范围(纬度/经度值),则可以使用以下内容:

x = imageWidth * ( pointLon - ImageExtentLeft ) / (ImageExtentRight - ImageExtentLeft);
y = imageHeight * ( 1 - ( pointLat - ImageExtentBottom) / (ImageExtentTop - mImageExtentBottom));

顺便说一句,如果您使用 Google Maps API 对您的位置进行地理编码,为什么不使用它的功能将标记直接添加到您的地图?(也许我没有完全理解你的情况)

var latlng = new GLatLng(pointLat, pointLon);
map.addOverlay(new GMarker(latlng));

希望能帮助到你

于 2010-02-18T08:38:05.600 回答
5

您正在进行一个称为图像配准或地图校正的过程。有一整套遥感专门用于执行此操作的方程式。

也许你可以从这个网站开始 - 它基本上应该做你需要的 http://labs.metacarta.com/rectifier/ (死链接)

如果没有,那么也许看看 QGIS 或 GRASS 之类的工具。如果您有金钱和时间,您还可以使用 ESRI ArcGIS Desktop 或 ERDAS Imagine 或 IDRISI。

于 2010-02-19T06:19:58.587 回答