如何找到 shp2pgsql?
我正在一台安装了 postgresql 的 Debian 机器上工作。我需要找到 shp2pgsql (顾名思义,一个将 shapefile 转换为 SQL 的实用程序)。
我似乎建议它位于 postgresql 的 bin 目录中,但我不知道在哪里可以找到它。我无法通过简单的查找找到 shp2pgsql(可能太简单了,因为我的 Unix 技能不太好):
$ find ~ -name 'shp2pgsql' -print
$
有什么建议吗?
谢谢 - 对于基本问题表示歉意!
I'm working on a Debian machine with postgresql installed. I need to find shp2pgsql (a utility that converts shapefiles into SQL, as the name suggests).
I've seem suggestions that it's located in the bin directory of postgresql, however I don't know where to find this. I can't locate shp2pgsql through a simple find (probably much too simple, since my Unix skills are not that good):
$ find ~ -name 'shp2pgsql' -print
$
Any suggestions?
Thanks - apologies for the basic question!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我很确定您需要安装 PostGIS - 它是该软件包的一部分。您可以从该站点安装它,或者 Debian 的包管理器甚至可能有它。它最终的结果取决于包构建器。
实际上,如果安装 PostGIS 后它不在您的 PATH 中,最简单的方法可能是通过
locate shp2pgsql
完成,尽管您可能需要先updatedb
。此外,您可以通过运行 pg_config 来查找 Postgres 相关目录。
I'm pretty sure you need PostGIS installed - its part of that package. You can install it from that site, or its likely that Debian's package manager even has it. Where it ends up depends on package builder.
Actually finding it, if its not in your PATH after you install PostGIS, is probably easiest done through
locate shp2pgsql
although you may need toupdatedb
first.Additionally, you can find your Postgres relevant directories by running
pg_config
.find 的第一个参数是要搜索的路径。 ~ 是您的主目录。您的命令从您的主目录搜索 shp2pgsql,而不是在 bin 目录中。使用 find,用户命令
find /usr/lib/postgresql/ -name shp2pgsql
。如果您的系统安装了locate,您还可以
locate shp2pgsql
。The first argument to find is the path from which to search. ~ is your home directory. Your command searches shp2pgsql from your home directory, not in the bin directory. With find, user command
find /usr/lib/postgresql/ -name shp2pgsql
.If your system has locate installed, you could also
locate shp2pgsql
.