- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 PADUS OBI shape file ,这可能并不重要。
我正在使用默认选项通过 shp2pgsql 运行形状文件,如下所示:
shp2pgsql PADUS_1_1_CBI_Edition.shp > PADUS.sql
然后我尝试通过以下方式将 SQL 导入 Postgres:
psql -d padusdb -f PADUS.sql
出现以下错误:
psql:PADUS.sql:36: ERROR: function addgeometrycolumn(unknown, unknown, unknown, unknown, unknown, integer) does not exist
LINE 1: SELECT AddGeometryColumn('','padus_1_1_cbi_edition','the_geo...
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
我安装了 PostGIS。
导致错误的 SQL 命令(被放入否则为空的数据库)是:
SET CLIENT_ENCODING TO UTF8;
SET STANDARD_CONFORMING_STRINGS TO ON;
BEGIN;
CREATE TABLE "padus_1_1_cbi_edition" (gid serial PRIMARY KEY,
"us_id" int4,
"category" varchar(10),
"gis_acres" numeric,
...
BUNCH OF COLUMNS, none of which is called "the_geom"
...
"comments" varchar(200),
"shape_leng" numeric,
"shape_area" numeric);
SELECT AddGeometryColumn('','padus_1_1_cbi_edition','the_geom','-1','MULTIPOLYGON',2);
COMMIT;
关于这可能意味着什么以及如何解决问题有什么想法吗?
最佳答案
因此,事实证明,仅仅在机器上安装 PostGIS 是不够的。
最初,我在 Ubuntu 10.10 上选择了 sudo apt-get install postgresql postgis
。这给我留下了 PostGRE 8.4 的工作版本,但没有 PostGIS 的迹象。
因此,我尝试了 sudo apt-get install postgresql-8.4-postgis
。
但一个人的工作并没有就此结束!您需要设置 PostGIS 数据库。
This网站提供了有关执行此操作以及之后使用数据库的说明。
关于PostgreSQL (shp2pgsql) AddGeometryColumn 给出 "No function matches the given name",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7323857/
我要导入OSM file使用工具 Osm2pgsql 进入我的 PostgreSQL 数据库(Windows,Postgres 版本 9.2) . 当我运行以下命令时 osm2pgsql.exe --
我正在尝试使用以下功能; SELECT Assign_vertex_id('ways', 0.00001, 'the_geom', 'gid') 但由于某种原因,它给了我以下错误; NOTICE:
创建几何列的常用方法是 AddGeometryColumn,但是我必须使用预先存在的列,所以我不能使用该函数(据我所知)。 感谢 PostGIS docs ,我已经可以在“geometry_colum
我正在使用 PADUS OBI shape file ,这可能并不重要。 我正在使用默认选项通过 shp2pgsql 运行形状文件,如下所示: shp2pgsql PADUS_1_1_CBI_Edit
我正尝试通过 QGIS 中的数据库管理器将 shapefile 导入我的 POSTGIS 数据库,但出现错误,我不知道如何解决: ERROR: function addgeometrycolumn(
我是一名优秀的程序员,十分优秀!