欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/ACL2, C++/F#/Lisp
PostGIS
第22行: | 第22行: | ||
*psql -f spatial_ref_sys.sql -d yourdatabase | *psql -f spatial_ref_sys.sql -d yourdatabase | ||
sql in \PostgreSQL\8.3\share\contrib | sql in \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_postgis template database include PostGIS functions | template_postgis template database include PostGIS functions |
2008年2月25日 (一) 06:43的版本
PostGIS adds support for geographic objects to the PostgreSQL object-relational database. In effect, PostGIS "spatially enables" the PostgreSQL server, allowing it to be used as a backend spatial database for geographic information systems (GIS), much like ESRI's SDE or Oracle's Spatial extension. PostGIS follows the OpenGIS "Simple Features Specification for SQL" and has been certified as compliant with the "Types and Functions" profile.
目录 |
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.gz cd postgis-1.3.1 ./configure make make install createlang plpgsql yourtestdatabase psql -d yourtestdatabase -f lwpostgis.sql psql -d yourtestdatabase -f spatial_ref_sys.sql
or Windows
http://postgis.refractions.net/download/windows/ psql -U postgres postgis postgis=# SELECT postgis_version();
DB initialization
- createlang plpgsql yourdatabase
- psql -f lwpostgis.sql -d yourdatabase
- psql -f spatial_ref_sys.sql -d yourdatabase
sql in \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_db or CREATE DATABASE my_spatial_db TEMPLATE=template_postgis