postgresql 我怎样才能找到 shp2pgsql?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3328656/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-20 00:13:29  来源:igfitidea点击:

How can I find shp2pgsql?

postgresqlgeocoding

提问by AP257

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).

我正在一台安装了 postgresql 的 Debian 机器上工作。我需要找到shp2pgsql(一种将 shapefile 转换为 SQL 的实用程序,顾名思义)。

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):

我似乎建议它位于 postgresql 的 bin 目录中,但是我不知道在哪里可以找到它。我无法通过简单的查找找到 shp2pgsql(可能太简单了,因为我的 Unix 技能不太好):

$ find ~ -name 'shp2pgsql' -print
$ 

Any suggestions?

有什么建议?

Thanks - apologies for the basic question!

谢谢 - 对基本问题表示歉意!

回答by rfusca

I'm pretty sure you need PostGISinstalled - 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.

我很确定您需要安装PostGIS- 它是该软件包的一部分。您可以从该站点安装它,或者 Debian 的软件包管理器甚至可能拥有它。它的最终位置取决于包构建器。

Actually finding it, if its not in your PATH after you install PostGIS, is probably easiest done through locate shp2pgsqlalthough you may need to updatedbfirst.

实际上,如果在安装 PostGIS 后它不在您的 PATH 中,则可能最容易找到它,locate shp2pgsql尽管您可能需要updatedb先找到它。

Additionally, you can find your Postgres relevant directories by running pg_config.

此外,您可以通过运行找到 Postgres 相关目录pg_config

回答by jmz

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.

find 的第一个参数是搜索的路径。~ 是您的主目录。您的命令从您的主目录中搜索 shp2pgsql,而不是在 bin 目录中。使用查找,用户命令find /usr/lib/postgresql/ -name shp2pgsql

If your system has locate installed, you could also locate shp2pgsql.

如果您的系统安装了 locate,您也可以locate shp2pgsql.