Upload
lamgiaodau
View
54
Download
3
Embed Size (px)
Citation preview
Giảng viên: Ths. Nguyễn Hoàng LongEmail: [email protected]
Giới thiệu PostGIS
PostGIS là phần mở rộng của PostgreSQL PostgreSQL là một cơ sở dữ liệu quan hệ mã
nguồn 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?
Cách lưu chữ đơn giản PostGIS Polygon
POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))
Oracle PolygonMDSYS.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?
Cài đặt
Tìm hiểu về Postgis
Start-> Program -> postgreSQL 8.4 -> pgAmind III
Giao diện của pgAdmin
Postgis functions
Postgis tables
Geometry table
idTên bảng liên kết
Trường (cột) chứa 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');
Chuyển shape file vào postgis
Gợi ý: sử dụng 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