我使用工具osm2pgsql使用PHPpgadmin作为管理工具将osm文件导入postgres数据库.我只是以xml格式从osm下载了一个小镇,我在使用mac终端导入时遇到了麻烦.我有点像这样的菜鸟所以任何帮助将不胜感激.我看过几篇文章但没有提供我需要的清晰度以满足我的需求.
谢谢
我得到这个错误可能是一些小不确定..
@H_301_5@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,integer) does not exist LINE 1: SELECT AddGeometryColumn('planet_osm_point',... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.
您需要将postgis扩展安装到postgres数据库中.假设您在计算机上安装了postgis,则需要执行以下操作:
@H_301_5@psql <database> < /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql
postgis.sql的确切路径取决于您使用的分发以及它如何打包postgis.您可能还需要/需要使用如下命令安装空间参考系统表:
@H_301_5@psql <database> < /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql