【发布时间】:2016-04-06 23:20:21
【问题描述】:
首先,如果这真的很简单,我很抱歉,但我似乎无法弄清楚。我正在使用 RGeo 在 UTM 和纬度/经度之间进行转换,就像这样;
srs_database = RGeo::CoordSys::SRSDatabase::ActiveRecordTable.new # create the coordinate factory for the relevant UTM zone utm_factory = RGeo::Cartesian.factory(:srid => srid, :srs_database => srs_database) utm_location = utm_factory.point(easting, northing) # create the standard WGS84 lat/long coordinate factory wgs84_proj4 = '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' wgs84_factory = RGeo::Geographic.spherical_factory(proj4: wgs84_proj4, :srid => 4326) # perform the UTM -> lat/long cast RGeo::Feature.cast(utm_location, :factory => wgs84_factory, :project => true)
如您所见,我使用的是RGeo::CoordSys::SRSDatabase::ActiveRecordTable。
我刚刚升级到RGeo 0.5.2,我注意到这个类已被弃用。
很公平,但我现在不确定替代方法是什么……我已经四处寻找,似乎找不到合适的文档。
另外,我原来的方法对我来说总是有点复杂 - 有没有更简单的方法来完成 UTM -> 使用 RGeo 进行纬度/经度转换?
提前致谢!
本
【问题讨论】:
标签: rgeo