如何从 shapefile 的 .prj 文件获取 Proj4 详细信息?
我正在为 GIS 应用程序使用 Mapdotnet 服务来加载 shapefile,并且此 Mapdotnet 服务需要 proj4 详细信息。我从 Spatialreference.org 获取它们,但对于 此投影 proj4 详细信息是空白。如何从 .prj 文件或 shapefile 获取 proj4 详细信息?
以下是 shapefile 的 .prj:
PROJCS["NAD_1983_HARN_WISCRS_EauClaire_County_Feet",GEOGCS["GCS_North_American_1983_HARN",DATUM["D_North_American_1983_HARN",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",394000.0],PARAMETER["False_Northing",300812.797],PARAMETER["Central_Meridian",-91.28888888888889],PARAMETER["Standard_Parallel_1",45.87228112638889],PARAMETER["Scale_Factor",1.000035079],PARAMETER["Latitude_Of_Origin",45.87228112638889],UNIT["Foot_US",0.3048006096012192]]
I am using mapdotnet services for our gis application to load the shapefiles, and this mapdotnet service wants the proj4 details. I'm getting them from spatialreference.org, but for this projection the proj4 details are blank. How can I get the proj4 details from the .prj file or from the shapefile?
Below is the shapefile's .prj:
PROJCS["NAD_1983_HARN_WISCRS_EauClaire_County_Feet",GEOGCS["GCS_North_American_1983_HARN",DATUM["D_North_American_1983_HARN",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",394000.0],PARAMETER["False_Northing",300812.797],PARAMETER["Central_Meridian",-91.28888888888889],PARAMETER["Standard_Parallel_1",45.87228112638889],PARAMETER["Scale_Factor",1.000035079],PARAMETER["Latitude_Of_Origin",45.87228112638889],UNIT["Foot_US",0.3048006096012192]]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您还可以使用此 Python 脚本(可以在 Internet 上的其他地方看到):
You can also use this Python script (seen elsewhere on the Internet):
使用 r 和 rgdal 库的替代方案:
Alternative using r and the rgdal library:
另一个使用 perl 脚本的解决方案(需要 Geo::GDAL):
Another solution using a perl script (requires Geo::GDAL):
应该可以从各个组件中计算出来。 Proj.4 允许指定所有内容。您将需要 ESRI 文档来获取其 PRJ 文件。这将包括它们的定义(例如,NAD83_HARN 和普通 NAD83 之间有什么区别?它们可能相同,但我不知道)
另一种方法可能是查看 GDAL/OGR 库和实用程序。它们能够读取大多数 PRJ 文件。
It should be possible to work it out from the individual components. Proj.4 allows everything to be specified. You will need the ESRI documentation for their PRJ files. This will include their definitions (eg. what is the difference between NAD83_HARN and normal NAD83? they migth be the same but I don't know)
another approach might be to look at the GDAL/OGR library and utilities. These are capable of reading most PRJ files.
我使用了 PyCRS 和 来自圣地亚哥 GIS 门户的 APN shapefile 地址。
PyCharm 中的 Python 控制台:
输出:
I used PyCRS and the Address APN shapefile from San Diego's GIS portal.
Python console in PyCharm:
Output:
安装 GDAL
为 python 3
Install GDAL
For python 3