Skip to main content
 首页 » 编程设计

python之使用 tilestache/modestmaps 将 wgs84 中的 lon/lat 重新投影到目标投影

2024年08月30日35daizhj

tilestache 的文档有点稀疏。有没有办法将 wgs84 中的点(经/纬度)转换为目标投影?

地点:

target_srid = 3095 
target_proj4_str = '+proj=utm +zone=54 +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +units=m +no_defs' 

我注意到在 ModestMaps 中有一个转换对象:

ModestMaps.Geo.Transform() 

但我不清楚如何使用它。

请您参考如下方法:

最好的选择是“Goodies”下的 Proj4Projection 类:

http://tilestache.org/doc/TileStache.Goodies.Proj4Projection.html

我目前只在 TileStache 的核心中包括 WGS84 和 Spherical Mercator,但上面提供的模块应该对你有帮助。请注意,除了投影之外,您还需要弄清楚转换,Per Liedman 的优秀指南对此进行了解释:http://blog.kartena.se/local-projections-in-a-world-of-spherical-mercator/