简体   繁体   中英

PostGIS Topology with Z coordinate

I am trying to build a PostGIS Topology with edges that have a Z coordinate. I use the following commands:

SELECT topology.CreateTopology('test_topo', 2154, 0, true);
SELECT topology.TopoGeo_AddLineString('test_topo', ST_GeomFromEWKT('SRID=2154;LINESTRINGZ(0 0 0, 1 1 0)'), 0);
SELECT topology.TopoGeo_AddLineString('test_topo', ST_GeomFromEWKT('SRID=2154;LINESTRINGZ(0 0.5 0.5, 1 0.5 0.5)'), 0);
SELECT topology.TopoGeo_AddLineString('test_topo', ST_GeomFromEWKT('SRID=2154;LINESTRINGZ(0 1 0, 1 0 0)'), 0);
SELECT topology.TopoGeo_AddLineString('test_topo', ST_GeomFromEWKT('SRID=2154;LINESTRINGZ(0 0.25 1, 1 0.25 1)'), 0);

After that, I expected to have a new node in (0.5, 0.5, 0) due to the intersection of the 1st and 3rd lines and the other lines not connected to anything. But I actually get nodes to all 2D intersections, like if PostGIS Topo just ignored the Z coordinate to compute the intersections. See on the following picture:

结果

Is it the normal behaviour for PostGIS Topology or is it a bug? If it is normal, is it possible to build a topology with edges that overlap in a 2D projection (ie. ignoring the Z coordinate) but do not intersect in 3D view?

After some more research, I figured out that PostGIS Topology only support the ISO Topology-Geometry standard but not the ISO Topology-Network (definitions here: https://www.gaia-gis.it/fossil/libspatialite/wiki?name=topo-intro ). Thus the Z coordinate is only intended to add some relief to the topology but not actual 3D. So the previous behaviour is actually normal and I have to find another way to get the result I expected.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM