[postgis-users] Question on topology

Neumann, Andreas a.neumann at carto.net
Mon Jul 11 07:52:40 PDT 2016


Hi Strk, 

I finally had the time to try out the topology extension in my project. 

As you proposed, I used the following command. 

--------------------- 

SELECT CreateTopology('av_1700_bb_topo', 21781);
SELECT ST_CreateTopoGeo('av_1700_bb_topo', (
SELECT ST_Collect(ST_CurveToLine(geom)) FROM av_1700.bb_bodenbedeckung
WHERE gemeinde = 'Neuheim'
) ); 

---------------------- 

For my test, I use a small subset of the full data set (approx. 2'500
CurvePolygons). 

The ST_CreateTopoGeo() function runs for a very long time. >45 minutes
on this relatively small dataset. Did I use the wrong combination of
functions at the top, or is it a problem that after ST_CurveToLine() my
data contains a lot of vertices? 

My total dataset has 75'000 polygons, so I fear that, unless I did a
erroneous combination of the functions, that the ST_CreateTopoGeo() may
be too slow for my purpose? How big where the datasets that you used so
far with Postgis topology? I hope it is a mistake on my side. 

Thanks for any feedback and greetings, 

Andreas 

On 2016-07-01 10:29, Sandro Santilli wrote:

> On Thu, Jun 30, 2016 at 11:25:22AM +0200, Neumann, Andreas wrote:
> 
>> Is there a method in Postgis to create a Topology, eliminating double
>> borders from the original CurvePolygons and attaching left and right
>> attributes from the original polygons? I came across the Postgis
>> topology module. Is this the recommended way of achieving my above goal?
> 
> I'd say YES  -- the standard ISO Topology Model involves having
> "left face" and "right face" information for each edge.
> 
>> Unfortunately, there are only few ressources or examples around Postgis
>> topology and from the first glimpse it looks a bit complicated to use.
> 
> The simplest path to try it would something like this:
> 
> -- Create the topology
> SELECT CreateTopology('topo', find_srid('public','mytable','geom'));
> 
> -- Populate the topology layer
> SELECT ST_CreateTopoGeo('topo', (
> SELECT ST_Collect(geom) FROM mytable
> ) );
> 
> Then fire up qgis, select the 'topo' schema with the DB Manager
> and from the menu select Schema->TopologyViewer.
> 
>> It also looks like it can't handle CurvePolygons as input - right? I
>> would have to coerce first to POLYGON geometries - right? It is ok for
>> me if the circular arcs are segmentized, as this data is not for
>> editing/analysis, but only for symbology purposes.
> 
> Confirmed, yo'll have to convert to POLYGON first.
> 
>> If you have any hints or examples, please let me know!
> 
> I guess you did read these already ?
> https://strk.kbt.io/blog/tag/topology/
> 
> --strk;

  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20160711/a2a4f9a6/attachment.html>


More information about the postgis-users mailing list