Geometry

<< Click to Display Table of Contents >>

Navigation:  Connectors > PostgreSQL >

Geometry

 

PostgreSQL can include two separate geometry sets: native (simple) geometries and PostGIS (ST) geometries.

DTS maps both sets to DTSGeoJson.

 

Native Geometry Types

 

 

PostgreSQL Geometry Type

Interpretation

GeoJson Geometry Type

point

Single point

Point

lseg

Line segment

LineString

path

Sequence of connected line segments - can be open [] or closed ()

LineString or Polygon

box

Rectangle

Polygon + DTS Correction

box2d

Rectangle

Polygon + DTS Correction

polygon

Polygon

Polygon

circle

Circle

Polygon + DTS Correction

 

exclamation_mark_16px The infinite "line" type is not supported

 

exclamation_mark_16px The 3-dimensional "box3d" type is not supported

 

exclamation_mark_16px Native geometry types can only be used as function inputs when they are direct arguments. Please see Limitations for details.

 

 

PostGIS Geometry Types

 

There are two categories of objects that are interpreted as geometries in PostgreSQL:

 

Geometry

Geography

Compliant with the ST_GEOMETRY standard

Compliant with the ST_GEOMETRY standard

Accessible as WKB

Accessible as WKB

Strictly euclidean

Strictly geodetic

Coordinates represent (x, y) or (x, y, z)

Coordinates represent (lon, lat) or (lon, lat, elv)

If specified, coordinate system must be in length units

If specified, coordinate system must be in degrees

 

The DTS  PostgreSQL Connector transforms both categories to DTSGeoJson for transfer, but keeps track of the them as different internal types (DTS_GEOMETRY, DTS_GEOGRAPHY) in order to correctly interact with PostgreSQL and other data sources which similarly differentiate spatial data.

Here is how PostGIS geometry and geography types map to GeoJson geometry types.

 

ST Subtype

Interpretation

GeoJson Geometry Type

POINT

Single point

Point

MULTIPOINT

Multiple points

MultiPoint

LINESTRING

Sequence of straight lines without gaps

LineString

CIRCULARSTRING

Sequence of circle arcs without gaps

LineString + DTS corrections

MULTILINESTRING

Multiple LINESTRINGs (not necessarily connected)

MultiLineString

COMPOUNDCURVE

Sequence of connected LINESTRINGs and CIRCULARLINESTRINGs

MultiLineString + DTS corrections

POLYGON

Polygon (with or without holes)

Polygon

CURVEPOLYGON

Polygon whose boundaries can contain circle arcs

Polygon + DTS corrections

MULTIPOLYGON

Multiple POLYGONs

MultiPolygon (+ DTS corrections)

 

exclamation_mark_16px Only the 2-dimensional variants of these geometries are supported at present.

 

exclamation_mark_16px GEOMETRYCOLLECTIONs are not currently supported.

 

Information-icon_16px Further reading:

PostGIS Spatial Data Types Overview

DTS Geometry Overview