how to Convert Lat ,long to an XY coordinate system (e.g. UTM) and then map this to pixel space of my Image

余生长醉 提交于 2019-12-03 00:17:45

GPS Coordinates to Pixels

  • Assuming this map does not cross prime meridian
  • Assuming pixel 0,0 is upper left, and pixel 600,800 is lower right.
  • Assuming map is Northern Hemisphere Only (no part of map is southern hemisphere)

    1. Determine the left-most longitude in your 800x600 image (X)
    2. Determine the east-most longitude in your 800x600 image (Y)
    3. Determine Longitude-Diff (Z = Y - X)
    4. Determine north-most latitude in your 800x600 image (A)
    5. Determine south-most latitude in your 800x600 image (B)
    6. Determine Longitude-Diff (C = A - B)

Given a Latitude and Longitude, to determine which pixel they clicked on:

  1. J = Input Longitude
  2. K = Input Latitude

  3. Calculate X-pixel

    XPixel = CInt(((Y - J) / CDbl(Z)) * 800)

  4. Calculate Y-pixel

    YPixel = CInt(((A - K) / CDbl(C)) * 600)

UTM

Here is a cartographic library that should help with GPS to UTM conversions

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