postgis
来源:互联网 发布:java程序是什么 编辑:程序博客网 时间:2024/06/04 06:44
http://wiki.huihoo.com/wiki/PostGIS
Install
When you install PostgreSQL, do not install the PostGIS included in the PostgreSQL installer, it is often a few versions behind.Instead, use the separate PostGIS installer.
Linux & UNIX
tar xvfz postgis-1.3.1.tar.gzcd postgis-1.3.1./configuremakemake installcreatelang plpgsql yourtestdatabasepsql -d yourtestdatabase -f lwpostgis.sqlpsql -d yourtestdatabase -f spatial_ref_sys.sqlor Windows
http://postgis.refractions.net/download/windows/psql -U postgres postgispostgis=# SELECT postgis_version();DB initialization
- createdb test-gis
- createlang plpgsql test-gis
- psql -f /usr/share/postgresql-8.1-postgis/lwpostgis.sql -d test-gis
- psql -f /usr/share/postgresql-8.1-postgis/spatial_ref_sys.sql -d test-gis
or sql in E:/PostgreSQL/8.3/share/contrib
two OpenGIS meta-data tables: SPATIAL_REF_SYS and GEOMETRY_COLUMNS.
CREATE TABLE spatial_ref_sys( srid integer NOT NULL, auth_name character varying(256), auth_srid integer, srtext character varying(2048), proj4text character varying(2048), CONSTRAINT spatial_ref_sys_pkey PRIMARY KEY (srid))
CREATE TABLE geometry_columns ( f_table_catalog VARRCHAR(256) NOT NULL, f_table_schema VARCHAR(256) NOT NULL, f_table_nam VARCHAR(256) NOT NULL, f_geometry_column VARCHAR(256) NOT NULL, coord_dimension INTEGER NOT NULL, srid INTEGER NOT NULL, type VARCHAR(30) NOT NULL )
template_postgis
template_postgis template database include PostGIS functions
create spatially-enabled databases
createdb -T template_postgis my_spatial_dborCREATE DATABASE my_spatial_db TEMPLATE=template_postgis
SRID
The OpenGIS specification also requires that the internal storage format of spatial objects include a spatial referencing system identifier (SRID). The SRID is required when creating spatial objects for insertion into the database.
shp2pgsql
shp2pgsql - shapefile to postgis loader
The shp2pgsql data loader converts ESRI Shape files into SQL suitable for insertion into a PostGIS/PostgreSQL database.
examples:
shp2pgsql shaperoads roadstable roadsdb > roads.sqlpsql -d roadsdb -f roads.sqlshp2pgsql shaperoads roadstable roadsdb | psql -d roadsdb
- postgis
- PostGis
- postgis
- Postgis
- PostGIS
- postGIS
- POSTGIS教程
- postGis 函数
- POSTGIS教程
- PostGIS介绍
- postgis shptosql
- PostGIS问题
- postgis 随记
- POSTGIS简介
- PostGIS入门
- postgis安装
- PostGIS安装
- PostGIS相关
- Js 整理备忘(01)—— 变量作用域
- OPNET简介
- OPNET的应用
- Week 4
- Spring Aop实现声明式事务
- postgis
- Js 整理备忘(02)——运算符
- JWSDP 学习笔记
- Cassandra Dev 1: Cassandra 入门
- I2C设备驱动流程
- 似幻亦真 教你踏足网络仿真的云外之境
- 目标的管理
- 模拟垂直上抛运动和水平抛体运动
- GridLayout