Converting long/lat to pixel x/y, given a zoom-level

后端 未结 2 1135
不知归路
不知归路 2021-01-02 09:19

I\'m trying to develop a page in ASP.NET that will act as a tile-server for a Google Map

It will pull a collection of latitude/longitude points from the database, th

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-02 09:42

    "If it is a Mercator projection, you shouldn't need to worry about the curvature of the earth since all of the lat/lon lines are at equal spacing"

    Perhaps you're thinking of the Geographic (aka Plate Carree) projection? The Mercator projection does have equally spaced lines of longitude, but does not have equally spaced lines of latitude (lat = atan(sinh(y)), so 90° is at infinity).

    BTW, the math for the Mercator projection on a sphere is here, but if Google Maps is using the WGS84 ellipsoid and you need to get it exact it gets more complicated. In that case, I'd look at this, but beware: it's not for the faint of heart.

提交回复
热议问题