-- gis类型主要分为两种:geometry和geometry,下面这些类型都是基于这两种类型的。
-
POINT(0 0)
-
LINESTRING(0 0,1 1,1 2)
-
POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1, 2 1, 2 2, 1 2,1 1))
-
MULTIPOINT((0 0),(1 2))
-
MULTILINESTRING((0 0,1 1,1 2),(2 3,3 2,5 4))
-
MULTIPOLYGON(((0 0,4 0,4 4,0 4,0 0),(1 1,2 1,2 2,1 2,1 1)), ((-1 -1,-1 -2,-2 -2,-2 -1,-1 -1)))
-
GEOMETRYCOLLECTION(POINT(2 3),LINESTRING(2 3,3 4))
-- 使用gis插件
CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
CREATE EXTENSION fuzzystrmatch;
CREATE EXTENSION postgis_tiger_geocoder;
-- 创建几何类型的表
create table geometry01 (the_geom geometry, the_name char varying(100));
INSERT INTO geometry01 ( the_geom, the_name ) VALUES ( ST_GeomFromText('POINT(-126.4 45.32)', 312), 'A Place');
select * from geometry01
-- 创建几何类型的表2
create table geometry02 (the_geom geometry, the_name char varying(100));
INSERT INTO geometry02 ( the_geom, the_name )
VALUES ( ST_GeomFromText('LINESTRING(0 0,1 1,1 2)', 312), 'A Place');
INSERT INTO geometry02 ( the_geom, the_name )
VALUES ( ST_GeomFromText('MULTIPOLYGON(((0 0,4 0,4 4,0 4,0 0),(1 1,2 1,2 2,1 2,1 1)), ((-1 -1,-1 -2,-2 -2,-2 -1,-1 -1)))', 312), 'A Place');
INSERT INTO geometry02 ( the_geom, the_name )
VALUES ( ST_GeomFromEWKT('SRID=312;POINTM(-126.4 45.32 15)'), 'A Place' )
SELECT * FROM geometry02;
-- 创建地理位置的表1
CREATE TABLE geography01(gid serial PRIMARY KEY, the_geog geography(POINT,4326) );
insert into geography01 values(1,ST_GeographyFromText('SRID=4326;POINT(-110 30)'));
select * from geography01;
参考:
http://bbs.aliyun.com/read/246028.html?spm=5176.7189909.0.0.PlGjeu
http://postgis.net/docs/manual-2.1/using_postgis_dbmanagement.html
http://live.osgeo.org/zh/standards/standards.html
相关推荐
Postgregis+PostGIS,开源的空数据库。
postgre使用介绍,以及软件安装方法。postgre使用介绍,以及软件安装方法。postgre使用介绍,以及软件安装方法
postgre最新版本手册,数据库使用手册
Postgre SQL 9.4安装包,用于Postgre SQL的安装
postgre学习文档2
Postgre JDBC驱动Postgre JDBC驱动Postgre JDBC驱动
postgre安装文档
nacos_postgre.sql
VC访问数据库有两种方法:一种是使用CDatabase和CRecord对象;另一种是利用ADO技术。 这个程序实现了Postgre数据库的读写,以及存储过程的调用。
QGIS软件连接Postgre数据库截图操作
vs调用postgre示例,使用的是vs2010,一个简单的控制台程序demo,本地运行通过
易语言源码 Postgre SQL 连接池。基于 http://www.sanye.cx/?id=12020 的源码 二次开发...封装了一些高级方法..包括,连接池+查询缓存+不知道真假的储存过程+慢查询记录。使用源码使用了E2EE支持库(模块部分思路借鉴...
设置Postgre数据库远程连接服务的两种方式,截图教程。
2.1. 介绍 2.2. 概念 2.3. 创建新表 2.4. 向表中添加行 2.5. 查询一个表 2.6. 在表之间连接 2.7. 聚集函数 2.8. 更新 2.9. 删除 3. 高级特性 3.1. 介绍 3.2. 视图 3.3. 外键 3.4. 事务 3.5. 继承 3.6. 结论
postgre8.4安装包 数据库 osm数据 之后可以打开osm格式文件
postgre自动生成代码 ,mybatis xml dao service 这个好用,dto
postgre最新驱动
net访问mysql、postgre和sqlserver
MsSql+Mysql+oracle+Postgre驱动jar包