Introduction

By enabling the Postgres plugin, you gain access to Clowder's Geostreams API. This module supports definition of Sensors, Streams and Datapoints in Clowder that allow for geospatial visualization and querying. 

 

Installation & Initialization

  1. Install Postgres

  2. Create necessary database & roles in Postgres command-line
  3. To prepare database tables, execute geostreams.sql (available on GitHub)

  4. By default, the SQL script will assign database/tables to owner 'clowder'. If you specify a different Postgres user in Clowder (see Customization below) you should make sure databases/tables are owned by that user. 
    1. Or you can add the following in Clowder to custom/custom.conf:

      postgres.user=clowder
      postgres.password=clowder

       

  5. Enable Postgres plugin in Clowder by adding the following to clowder/custom/play.plugins:

Once installed you should see a "Sensors" entry in the top menu of Clowder, alongside "Help".

 

Customization

The following values can be changed in clowder/custom/custom.conf.

Postgres user configuration:

Location where data for geostream API calls will be cached:

These properties are used when the geostreaming service returns data as type CSV instead of JSON:


Geography vs. Geometry

PostGIS offers two spatial types, "geometry" and "geography".

 

So why choose one over the other?

Further reading:

http://workshops.boundlessgeo.com/postgis-intro/geography.html

http://gis.stackexchange.com/questions/6681/what-are-the-pros-and-cons-of-postgis-geography-and-geometry-types

https://gis.stackexchange.com/questions/26082/what-is-the-difference-between-geometric-and-geographic-columns