PostGIS adds support for geographic objects to the PostgreSQL database. In effect, PostGIS "spatially enables" the PostgreSQL server, allowing it to be used as spatial database for geographic information systems.
PostGIS follows the OpenGIS Simple Features Specification for SQL (SFSQL).
PostGIS supports the range of geometry objects:
Geometry Object | WKT Example |
---|---|
Point | POINT(0 0) |
LineString | LINESTRING(0 0,1 1,1 2) |
Polygon | POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1, 2 1, 2 2, 1 2,1 1)) |
MultiPoint | MULTIPOINT(0 0,1 2) |
MultiLineString | MULTILINESTRING((0 0,1 1,1 2),(2 3,3 2,5 4)) |
MiltiPolygon | 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 | GEOMETRYCOLLECTION(POINT(2 3),LINESTRING((2 3,3 4))) |
These geometry objects are in accordance with the SFSQL specification mentioned above; the examples are given using the "Well Known Text" format - the same format used for selections in uDig (see Common Query Language )
When you install the PostGIS extension into your database two tables will be created:
For uDig to recognize your database you will need to have at least one entry in your geometry_columns table.