Skip to content

What Is PostGIS-PostgreSQL?

  • 5 min read
What Is PostGIS

It is a spatial database extension to PostgreSQL Database, which allows Geographic Information Systems objects to be stored in the DBMS and also allow a user to run location queries on SQL. PostGIS spatial extension adds two main data types to PostgreSQL database i.e. geography and geometry. Both this data types allow the storage of points in a table, as well as other more complex shapes like lines, multipoint lines, polygons. It automatically inherits “enterprise” features from PostgreSQL

Features of PostGIS

Input and Output functions are used to convert from external representations of geometry and there’s surprisingly a lot of those to the geometry object in the database and vice. So on the input side we can read from GML and KML and GEO JSON, a well-known text and well-known binary or OGC defined standard representations, text representations and binary streams and we can write output to GML and KML and SVG and then the OGC well-known text and one in binary. So lots of input output options descriptive functions lets you characterize a single geometry object.

  • Vector and Raster Data Processing and Analytic functions.
  • Raster map algebra for fine-grained raster processing.
  • Vector and Raster data spatial reprojection.
  • Support for importing and exporting of ESRI shapefile vector data and support for more formats using other 3rd-party Open Source tools.
  • Packaged Command line importing of raster data from many standard formats.
  • Rendering and importing of vector data (KML, GML, GeoJSON, GeoHash and WKT using SQL) and raster data such as (GeoTIFF, PNG, JPG, NetCDF, etc.)
  • 3D object support, spatial index, and functions.
  • Network Topology support.
  • Packaged Tiger Loader, Geocoder and Reverse Geocoder.

A brief history of PostGIS

Refractions Research has released the first version of PostGIS in early 2001 under GNU. The 0.1 version released in May 2001 had objects, indexes, and functions, but only a very few functions. As functions were added in PostGIS through 2001, it became clear to everyone that an organizing principle was needed, and the organization was found in the “Simple Features for SQL” (SFSQL) specification from the Open Geospatial Consortium. The specification provided a guideline for function naming, and for what functions were required to make the database complete.

Why PostGIS/PostgreSQL

PostgreSQL allows you to add new types easily, as it has a built-in “type extension” mechanism. It also has a generic index structure (GIST) allowing you to build indexes on more-or-less anything. As PostGIS written on C, it can use other libraries which are written in C and C++. To perform GIS related functions, it depends on GEOS, Proj.4, GDAL, LibXML2, JSON-C, SFCGAL.

Core features

  • Geographic processing.
  • Geometric processing.
  • Also includes tools for loading data.
  • Implemented Standards.
  • Mapbox Vector Tile Specification (MVT).
  • Open Geospatial Consortium (OGU).
  • Simple Features for SQL (SFSQL).
  • Well Known Binary (WKB).
  • Well Known Text (WKT).

Why choose PostgreSQL?

A common question from people familiar with open source databases is, Why PostGIS built On PostgreSQL and not on MySQL?”

The reason PostGIS built on PostgreSQL are:

  • Proven reliability and transactional integrity by default (ACID).
  • Generic index structure (GIST) to allow R-Tree index.
  • No limit on column sizes (‘TOAST’able tuples) to Support big GIS objects.
  • Easy to add custom functions.
  • Careful support for SQL standards (full SQL92).
  • pluggable type extension and function extension.
  • Community-oriented development model.

PostgreSQL provides an easy development path to add new spatial types. Only Informix Universal Server allows such an easy extension. This is no coincidence; Informix is a proprietary re-working of the original PostgreSQL code base from the 1980’s. Because adding types to PostgreSQL was so straightforward. It made sense to start there, When MySQL released basic spatial types in version 4.1, the PostGIS team took a look at their code and the exercise reinforced the original decision to use PostgreSQL, Because MySQL spatial objects had to be hacked on top of the string type as special case, the MySQL code was spread over the entire code base. Development of PostGIS 0.1 took a month. Doing a MySQL 0.1 would have taken a lot longer, and as such, might never have seen the light of the day.

All these simple descriptive functions have in common they work on one geometry at a time the really interesting functions are the comparative functions and they take in two geometries and they tell you about the relationships these are the really powerful ones this return true or false depending on whether a spatial relationship condition is met so intersects will returns true if two geometries have a spatial interaction or any interaction at all on the boundaries.

The following table shows a list of some Open Source software that uses PostGIS:

Extract Transform Load tool used with PostGIS:

  • Shp2Pgsql
  • pgsql2shp
  • raster2pgsql
  • ogr2ogr
  • Dxf2PostGIS

Open Source Mapping Server / Web-Based

  • MapServer
  • GeoServer (Java-based WFS / WMS -server )
  • SharpMap SDK – for ASP.NET 2.0
  • QGIS Server for publishing QGIS workspaces as web mapping services.
  • MapGuide Open Source (using FDO)

Open Source Desktop Tools

  • uDig
  • QGIS
  • OpenJUMP
  • OpenEV
  • GvSIG
  • TileMill

PostGIS related PostgreSQL Extension

  • pgRouting
  • ogrfdw
  • pgpointcloud

Stable Release

2.4.0

Operating System

Windows, Linux & MAC-OS Compatible

Website

http://postgis.net

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.