【Postgres】Postgres12帮助手册

http://www.postgres.cn/docs/12/

 

https://postgis.net/docs/manual-3.2/

 

CREATE EXTENSION postgis;
CREATE EXTENSION pgrouting;
CREATE EXTENSION postgis_topology;
CREATE EXTENSION fuzzystrmatch;
CREATE EXTENSION postgis_tiger_geocoder;
CREATE EXTENSION address_standardizer;


-------------------------------------------------------------------------
SET CLIENT_ENCODING TO UTF8;

SET STANDARD_CONFORMING_STRINGS TO ON;

BEGIN;

CREATE TABLE "test1" (gid serial,

"field2" varchar(254));

ALTER TABLE "test1" ADD PRIMARY KEY (gid);

SELECT AddGeometryColumn('','test1','geom','0','LINESTRING',2);

insert into test1(field2, geom)

values('Triangle', ST_GeomFromText('LINESTRING(12 23, 26 30)', 4326));

commit;


drop table test2;
CREATE TABLE   "test2" (gid serial,

"field2" varchar(254));

ALTER TABLE "test2" ADD PRIMARY KEY (gid);

SELECT AddGeometryColumn('','test2','geom','0','POLYGON',2);

insert into test2(field2, geom)

values('Triangle', ST_GeomFromText('POLYGON((10 20, 20 40, 50 15, 10 20))', 4326));
-------------------------------------------------------------------------

 

posted @ 2022-03-01 17:33  咸鱼翻身  阅读(52)  评论(0编辑  收藏  举报