多边形是PostGIS建立在其上的基本Postgres类型。您可以使用PostGIS功能启用几何列
selectAddGeometryColumn(...)。否则,您将使用直线多边形:
=> create table gt (id int, space polygon);=> insert into gt values (1, '((2,2),(3,4),(3,6),(1,1))');INSERT 0 1=> select point(space) from gt where id = 1; point ------------- (2.25,3.25)(1 row)
这是多边形的中心点
=> select circle(space) from gt where id = 1; circle -------------------------------- <(2.25,3.25),1.93994028704315>(1 row)
这是多边形的最小边界圆,表示为Postgres
circle类型。此处记录了所有几何运算符:http://www.postgresql.org/docs/8.3/interactive/functions-
geometry.html
基础多边形没有任何投影数据,SRID等,因此,如果它可与PostGIS一起使用它可能只是默认设置而已,很幸运。但是,当然,在很多情况下,您只需要在亚大骨空间范围内进行几何处理。



