将 osm 文件导入 postgres/postgis 数据库
我使用 osm2pgsql 工具将 osm 文件导入到 postgres 数据库中,并使用 phppgadmin 作为管理工具。我只从 osm 以 xml 格式下载了一个小镇,但在使用 mac 上的终端导入它时遇到了问题。我对此有点菜鸟,所以任何帮助将不胜感激。我看过几篇文章,但没有一篇文章提供了满足我的需求所需的清晰度。
谢谢,
我收到这个错误可能是一些小错误。
Using projection SRS 900913 (Spherical Mercator)
Setting up table: planet_osm_point
NOTICE: table "planet_osm_point" does not exist, skipping
NOTICE: table "planet_osm_point_tmp" does not exist, skipping
SELECT AddGeometryColumn('planet_osm_point', 'way', 900913, 'POINT', 2 );
failed: ERROR: function addgeometrycolumn(unknown, unknown, integer, unknown, integer) does not exist
LINE 1: SELECT AddGeometryColumn('planet_osm_point', 'way', 900913, ...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
Im using the tool osm2pgsql to import an osm file into a postgres database using phppgadmin as the administrative tool. i have only downloaded a small town from osm in xml format and im having trouble importing it using the terminal on mac. Im a bit of a noob at this so any help would be greatly appreciated. Ive looked at several articles but none provide the clarity i need in order to fulfill my needs.
Thanks
im getting this error could be something small not sure..
Using projection SRS 900913 (Spherical Mercator)
Setting up table: planet_osm_point
NOTICE: table "planet_osm_point" does not exist, skipping
NOTICE: table "planet_osm_point_tmp" does not exist, skipping
SELECT AddGeometryColumn('planet_osm_point', 'way', 900913, 'POINT', 2 );
failed: ERROR: function addgeometrycolumn(unknown, unknown, integer, unknown, integer) does not exist
LINE 1: SELECT AddGeometryColumn('planet_osm_point', 'way', 900913, ...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要将 postgis 扩展安装到 postgres 数据库中。假设您的计算机上安装了 postgis,您需要执行以下操作:
postgis.sql
的确切路径将取决于您使用的发行版以及它如何打包 postgis。您可能还想要/需要使用如下命令安装空间参考系统表:You need to install the postgis extensions into your postgres database. Assuming that you have postgis installed on your machine you need to do something like:
The exact path to
postgis.sql
will depend on the distribution you are using and how it has packaged postgis. You may also want/need to install the spatial reference systems table with a command like this:这是一个示例命令:
osm2pgsql -c -d your_country -U postgres -W -H localhost -P 5432 -s -k -x -p osm -S default.style ..\your_country.osm.bz2
以下是一些有用的网络链接:
http://wiki.openstreetmap.org/wiki/Osm2pgsql
http://www.gis.hsr.ch/wiki/Osm2pgsql
-S。
This is an example command:
osm2pgsql -c -d your_country -U postgres -W -H localhost -P 5432 -s -k -x -p osm -S default.style ..\your_country.osm.bz2
Here are some useful weblinks:
http://wiki.openstreetmap.org/wiki/Osm2pgsql
http://www.gis.hsr.ch/wiki/Osm2pgsql
-S.