我正在尝试使用gdal从一些局部坐标系中投射一些基本形状。 ArcGIS支持这些坐标系,但最终我只是使用gdal(和proj4)将这些几何转换为基本纬度/经度(EPSG:4326)。这是gdalsrsinfo返回的内容:
PROJCS["mylocalgrid",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Local"],PARAMETER["False_Easting",20289.634],PARAMETER["False_Northing",14781.765],PARAMETER["Scale_Factor",1.000179],PARAMETER["Azimuth",0.0],PARAMETER["Longitude_Of_Center",-109.675257803],PARAMETER["Latitude_Of_Center",32.9599048 58],UNIT["Foot_US",0.3048006096012192]]
如果我尝试使用ogr翻译点shapefile,我会收到以下错误:
ERROR 6: No translation for Local to PROJ.4 format is known.
Failed to create coordinate transformation between the
following coordinate systems. This may be because they
are not transformable, or because projection services
(PROJ.4 DLL/.so) could not be loaded.
Source:
proj4是否支持本地坐标系?有什么建议我应该用于PROJECTION参数吗?
感谢。
答案 0 :(得分:3)
查看ArcGIS的Local Cartesian Projection文档,它说"此地图投影与Orthographic"相同。因此,对于PROJECTION
参数,将"Local"
替换为"Orthographic"
,它应该可以正常工作。这是Python中的一个片段,向您展示正在发生的事情:
from osgeo import osr
p = osr.SpatialReference()
p.ImportFromWkt('PROJCS["mylocalgrid",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Orthographic"],PARAMETER["False_Easting",20289.634],PARAMETER["False_Northing",14781.765],PARAMETER["Scale_Factor",1.000179],PARAMETER["Azimuth",0.0],PARAMETER["Longitude_Of_Center",-109.675257803],PARAMETER["Latitude_Of_Center",32.9599048 58],UNIT["Foot_US",0.3048006096012192]]')
print(p.ExportToProj4())
显示PROJ.4字符串:
+proj=ortho +lat_0=32.959904858 +lon_0=-109.675257803 +x_0=6184.292811785623 +y_0=4505.490982981965 +ellps=WGS84 +units=us-ft +no_defs
当然,测试它是否有效是个好主意。