我在无法插入点的PostGIS螺母中创建了一个表。
我的查询出了什么问题?
CREATE TABLE app (
p_id INTEGER PRIMARY KEY
);
SELECT AddGeometryColumn('app','the_geom','4326','POINT',2);
INSERT INTO app(p_id, the_geom) VALUES(2, POINT(-71.060316, 48.432044));
在最后一次查询之后,它显示了一些错误。
ERROR: column "the_geom" is of type geometry but expression is of type point
LINE 1: ...SERT INTO app(p_id, the_geom) VALUES(2, POINT(-71....
^
HINT: You will need to rewrite or cast the expression.
********** Error **********
ERROR: column "the_geom" is of type geometry but expression is of type point
SQL state: 42804
Hint: You will need to rewrite or cast the expression.
Character: 53
我已经检查了我的PostGIS版本。
SELECT PostGIS_full_version();
我得到以下输出。
"POSTGIS="1.5.3" GEOS="3.3.1-CAPI-1.7.1" PROJ="Rel. 4.7.1, 23 September 2009" LIBXML="2.7.3" USE_STATS"