Converting Longitude & Latitude to X Y on a map with Calibration points

后端 未结 7 1122
既然无缘
既然无缘 2020-11-29 01:25

If i have a jpeg map with size sizeX, sizeY

and some calibration points on the map (X, Y, Lon, Lat)

What would be the algorithm for calculating the correspon

7条回答
  •  自闭症患者
    2020-11-29 01:40

    If using the Equidistant Cylindrical Projection type map, here is what you need to do:

    1. Find the Latitude and longitude of your location tutorial here:
      http://lifehacker.com/267361/how-to-find-latitude-and-longitude
    2. Input that information into the following formulas:
      x = (total width of image in px) * (180 + latitude) / 360
      y = (total height of image in px) * (90 - longitude) / 180

      note: when using negative longitude of latitude make sure to add or subtract the negative number i.e. +(-92) or -(-35) which would actually be -92 and +35

    3. You now have your X and Y to plot on your image

      More information can be found about this formula and the map type here:
      http://www.progonos.com/furuti/MapProj/Dither/CartHow/HowER_W12/howER_W12.html#DeductionEquirectangular

提交回复
热议问题