How to transform a distance from degrees to metres?

前端 未结 3 1373
醉酒成梦
醉酒成梦 2021-02-04 06:31

I\'m using OpenLayers with an ordinary mercator map and I\'m trying to sample a bounding box by finding a grid of points in latlong. The bbox is expressed in latlon, e.g.

<
3条回答
  •  臣服心动
    2021-02-04 07:31

    The transformation between degrees and metres varies across the Earth's surface.

    Assuming a spherical Earth, degrees latitude = distance * 360 / (2*PI * 6400000)

    Note that longitude will vary according to the latitude:

    Degrees longitude = distance *360 * / (2*PI* cos(latitude) )

    The above is for the Earth's surface, and does not use the Mercator projection. If you wish to work with projected linear distance, then you will need to use the Mercator projection.

提交回复
热议问题