com.iot.telefonica.cygnus.sinks.NGSIPostGISSink, or simply
NGSIPostGISSink is a sink designed to persist NGSI-like context data events within a PostGIS server which is relational database extension of PostgreSQL server which allows store GIS objects (Geographic Information Systems). Usually, such a context data is notified by a Orion Context Broker instance, but could be any other system speaking the NGSI language.
Independently of the data generator, NGSI context data is always transformed into internal
NGSIEvent objects at Cygnus sources. In the end, the information within these events must be mapped into specific PostgreSQL data structures.
For futher detail please refear to
Basically PostGIS sink translates NGSI attribute value about geometry (geo:point, geo:json) to PostGIS format and insert it.
geo:point -> ST_SetSRID(ST_MakePoint()) geo:json -> ST_GeomFromGeoJSON()
Colum should be provisioned as type
CREATE TABLE myTable ( geom geometry );
Please refear to
NGSIPostgreSQLSink since all administration options about PostgreSQLSink applies to PostGISSink.
Please refear to
NGSIPostgreSQLSink since all programing details about PostgreSQLSink applies to PostGISSink.
Regarding the specific data stored within the above table, if
attr_native_types parameter is set to
true then attribute is inserted using its native type (according with the following table), if
false then will be stringify.
|Type json||Type PostGreSQL/POSTGIS|
|number||double, precision, real, others (numeric, decimal)|
|boolean||boolean (TRUE, FALSE, NULL)|
|DateTime||timestamp, timestamp with time zone, timestamp without time zone|
|json||text o json - it`s treated as String|
This only applies to Column mode.