是否有 python 代码来解析 geoPDF 文件以获取投影和图像数据? geoPDF2KML 工具?
我想组织大量的 geoPDF 文件,以便可以轻松地在 Google 地图和 Google 地球上叠加查看它们。
我认为,我的第一步是将 geoPDF 转换为 jpg 类型图像,然后需要匹配的纬度、经度信息。
是否有 python 代码来解析 geoPDF 文件以获取投影和图像数据?
geoPDF2KML 工具?
I want to organize lots of geoPDF files so they can easily viewed overlayed onto Google Maps and Google Earth.
My 1st step, I think, is to convert the geoPDF to a jpg type image which then needs matching lat,long information.
Is there python code to parse a geoPDF file to get the projection and image data?
A geoPDF2KML tool?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我在具有 python 的 ubuntu 系统上使用的步骤(python 已经是 Unbuntu 的一部分)
1.下载并安装poppler
2.下载并安装proj4
3.下载并安装gdal
Steps I used on ubuntu system that has python (python already part of Unbuntu)
1. download and install poppler
2. download and install proj4
3. download and install gdal
一种选择是使用 GDAL...
gdal 的最新版本(即当前的 svn trunk,而不是任何发布的版本)应该支持 geoPDF。
您需要使用选项
--with-poppler=yes
进行编译,并安装 poppler pdf 库。 (编译 gdal 可能有点痛苦,只是为了提前警告你......)Gdal 的 python 绑定很痛苦,但它们通常可以工作。
从那里,您应该能够轻松地使用 GDAL 将您的 geopdf 转换为地理参考 jpeg。
不过,如果您还不熟悉 GDAL,这可能会带来麻烦而不值得。 geoPDF 中的地理配准信息可能可以通过其他方式提取...
希望这能有所帮助...
One option is to use GDAL...
The latest version (i.e. the current svn trunk, not any released version) of gdal should support geoPDF's.
You'll need to compile it with the option
--with-poppler=yes
and have the poppler pdf library installed. (Compiling gdal can be a bit of a pain, just to warn you ahead of time...)Gdal's python bindings are painful, but they generally work.
From there, you should be able to easily use GDAL to convert your geopdf's to georeferenced jpegs.
If you're not already familiar with GDAL, though, this may be more trouble than it's worth. The georeferenceing information in a geoPDF can probably be extracted in other ways...
Hope that helps a bit, anyway...
下面的代码可能有助于指导那些想要将许多 geoPDF 转换为 KML-Superoverlay 的人,然后可以使用 Google Maps API 或 Google Earth API 将其合并为网络地图叠加层...
This code below may help guide some one wanting to convert many geoPDFs to KML-Superoverlay which can then be incorporated as web map overlays using Google Maps API or Google Earth API...
Python 库 pdfrw (https://pypi.org/project/pdfrw/) 将返回坐标参考信息。下面的示例将从 ArcGIS Pro (3.x) 中制作的地理参考 PDF 中提取坐标系 - 其他来源可能有所不同。结合这三个方面应该允许您在其他地方(例如 KML)对 PDF 的内容进行地理配准。
The Python library pdfrw (https://pypi.org/project/pdfrw/) will return the coordinate reference information. The below example will pull the coordinate system from a georeferenced PDF made in ArcGIS Pro (3.x) -- other sources may differ. Combing these three aspects should allow you to georeference the contents of the PDF elsewhere (e.g. KML).