Topology output
There are two output functions in PostGIS Topology: topology.ST_AsGML
and topology.ST_AsTopoJSON
. GML is an OGC standard, while TopoJSON is a GeoJSON-like text-based exchange format. It was designed to reduce the size and redundancy of GeoJSON for datasets composed of neighboring polygons.
GML output
Topological GML can be retrieved from the database using the topology.AsGML
function. The simplest use case is to supply a single argument, the TopoGeometry
column:
SELECT topology.AsGML(topogeom) FROM countries WHERE name='Nulland'; <gml:TopoSurface><gml:directedFace><gml:Face gml:id="F4258"><gml:directedEdge orientation="-"><gml:Edge gml:id="E4766"><gml:directedNode orientation="-"><gml:Node gml:id="N4568"/></gml:directedNode><gml:directedNode><gml:Node gml:id="N4574"/></gml:directedNode><gml:curveProperty><gml:Curve srsName="urn:ogc:def:crs:EPSG::4326"><gml:segments><gml:LineStringSegment...