如何为 Postgres.app 安装 GDAL Python 绑定

发布于 2025-01-13 03:02:55 字数 1873 浏览 0 评论 0原文

我为我的新 MacBook Pro M1 安装了最新的 Postgre.app 版本 2.5.6 (139) 通用版本。设置 CLI 工具后,我可以访问像 gdalinfo 这样捆绑的所有 gdal 二进制文件。

不过,我还需要安装 python 绑定才能使用 cli 实用程序,例如 gdal2tiles.py。安装这些的正确方法是什么,以便它们与与最新 Postgress.app 捆绑在一起的 gdal 的其余部分一起工作?

与 Postgres.app 捆绑的当前版本是

➜ gdalinfo --version
GDAL 3.3.3, released 2021/10/25

Postgres.app 在以下位置安装 GDAL 二进制文件:

/Applications/Postgres.app/Contents/Versions/latest/bin 并且当前捆绑了以下内容:

clusterdb         ecpg              gdal_translate    gdalinfo          gdaltindex        invproj           pg_amcheck        pg_ctl            pg_resetwal       pg_verifybackup   proj              vacuumdb
createdb          gdal-config       gdal_viewshed     gdallocationinfo  gdaltransform     nearblack         pg_archivecleanup pg_dump           pg_restore        pg_waldump        psql              vacuumlo
createuser        gdal_contour      gdaladdo          gdalmanage        gdalwarp          ogr2ogr           pg_basebackup     pg_dumpall        pg_rewind         pgbench           raster2pgsql
cs2cs             gdal_create       gdalbuildvrt      gdalmdiminfo      geod              ogrinfo           pg_checksums      pg_isready        pg_test_fsync     pgsql2shp         reindexdb
dropdb            gdal_grid         gdaldem           gdalmdimtranslate initdb            ogrtindex         pg_config         pg_receivewal     pg_test_timing    postgres          shp2pgsql
dropuser          gdal_rasterize    gdalenhance       gdalsrsinfo       invgeod           oid2name          pg_controldata    pg_recvlogical    pg_upgrade        postmaster        testepsg

我意识到有很多使用brew和pip通过python绑定安装gdal的方法,但我希望在利用Postgres.app附带的核心gdal时以正确的方式执行此操作,

感谢任何帮助,谢谢!

I installed the latest Postgre.app version Version 2.5.6 (139) Universal version for my new MacBook Pro M1. After setting up the CLI tools, I am able to access all gdal binaries that come bundled like gdalinfo.

However I also need to install the python bindings to use cli utilities like gdal2tiles.py. What's the right way to go about installing these so they work with the rest of gdal bundled with latest Postgress.app?

Current version bundled with Postgres.app is

➜ gdalinfo --version
GDAL 3.3.3, released 2021/10/25

Postgres.app installs GDAL binaries at:

/Applications/Postgres.app/Contents/Versions/latest/bin and currently has the following bundled:

clusterdb         ecpg              gdal_translate    gdalinfo          gdaltindex        invproj           pg_amcheck        pg_ctl            pg_resetwal       pg_verifybackup   proj              vacuumdb
createdb          gdal-config       gdal_viewshed     gdallocationinfo  gdaltransform     nearblack         pg_archivecleanup pg_dump           pg_restore        pg_waldump        psql              vacuumlo
createuser        gdal_contour      gdaladdo          gdalmanage        gdalwarp          ogr2ogr           pg_basebackup     pg_dumpall        pg_rewind         pgbench           raster2pgsql
cs2cs             gdal_create       gdalbuildvrt      gdalmdiminfo      geod              ogrinfo           pg_checksums      pg_isready        pg_test_fsync     pgsql2shp         reindexdb
dropdb            gdal_grid         gdaldem           gdalmdimtranslate initdb            ogrtindex         pg_config         pg_receivewal     pg_test_timing    postgres          shp2pgsql
dropuser          gdal_rasterize    gdalenhance       gdalsrsinfo       invgeod           oid2name          pg_controldata    pg_recvlogical    pg_upgrade        postmaster        testepsg

I realize there are plenty of ways to install gdal with python bindings using brew and pip, but I am looking to do this the right way while utilizing the core gdal that comes with Postgres.app

Any help is appreciated, Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无所谓啦 2025-01-20 03:02:55

使用pygdal,它就是为此目的而制作的。

export GDALHOME="/Applications/Postgres.app/Contents/Versions/latest"
pip install pygdal=="`gdal-config --version`.*"

Use pygdal, it is made for this exact purpose.

export GDALHOME="/Applications/Postgres.app/Contents/Versions/latest"
pip install pygdal=="`gdal-config --version`.*"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文