You are on page 1of 19

GII THIU POSTGIS

Ging vin: Ths. Nguyn Hong Long Email: nhlong1710@gmail.com

Gii thiu PostGIS


PostGIS l phn m rng ca PostgreSQL PostgreSQL l mt c s d liu quan h m

ngun m

Why PostGIS?
Mapserver
Geotools (Geoserver, uDig) FDO (Mapguide, Autodesk Map 3D)

JUMP (OpenJUMP, Kosmo)


OGR (QGIS, Mapserver, GRASS) FME (ArcGIS Data Interoperability Extension) Cadcorp SIS Manifold Ionic Redspider ESRI ArcSDE 9.3 Python / Perl / PHP

Why PostGIS?
Cch lu ch n gin PostGIS Polygon
POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))

Oracle Polygon
MDSYS.SDO_GEOMETRY( 2003, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1), MDSYS.SDO_ORDINATE_ARRAY(0,0, 0,1, 1,1,1,0, 0,0))

Why PostGIS?

Why PostGIS?

Ci t

Tm hiu v Postgis
Start-> Program -> postgreSQL 8.4 -> pgAmind III

Giao din ca pgAdmin

Postgis functions

Postgis tables

Geometry table
id Tn bng lin kt Trng (ct) cha gi tr ???? geometry ???? ????

Spatialref_table

Airports tables
????

SQL trong Postgis

Insert SQL trong postgis


INSERT INTO geotable ( the_geom, the_name ) VALUES ( ST_GeomFromText('POINT(-126.4

45.32)', 312), 'A Place');

Chuyn shape file vo postgis


Gi : s dng quantumGIS

Connect Postgis and mapserver


LAYER
# kieu conection CONNECTIONTYPE POSTGIS NAME "airports"

# Connect vao postgis


CONNECTION "host=127.0.0.1 port=5432 dbname=postgis user=admin password=123456 " # lay du lieu geometry tu bang airports DATA "the_geom from airports" STATUS ON TYPE POINT

Connect Postgis and mapserver

You might also like