Re: [postgis-users] Topology: cannot delete slivers (or gaps)

2014-11-06 Thread Rémi Cura
Just to answer about Grass.
I'm not a Grass user, and I do use PostGIS topology every day (heart of my
work)
i know only 3 commands :
v.in.ogr dsn=PG:host=localhost port=5433 dbname=... user=... password=...
layer=schema.table out=layer_name
v.clean ...
v.out.postgis -l -2 input=layer_name dsn=PG:host=localhost dbname=...
port=5433 user=... password=... olayer=my_postgis_topo_layer -t

From a practical standpoint,
I like to choose the best tool for each job !

the focus of PostGIS topology is to *store *a topology model very close the
standart and allow *easy conversion* to geometry.
It is not a tool designed to clean an input topology, nor merge, batch
change, etc. Similarly, it is very slow to compute the topology from
geometry.

On the opposite Grass is the only GIS entirely topological since the
beginning. This means that they have powerfull and honed topological
capabilities, because topology is not an option in this soft.
However it is not a tool designed to get easy access to data like postgis
topology.

I prefer to chose the best tool for each job !
advanced topo computing/cleaning/batch operations : Grass
topo storing/relational usage/conversion to geom : PostGis topology.

Clean correct topological operations with a given precision is something
incredibly difficult, so don't ask too much to PostGIS topology.

Cheers,
Rémi-C


2014-11-06 0:37 GMT+01:00 Guillaume Drolet droletguilla...@gmail.com:

 Sandro,

 Using your help, I filled most holes but three I couldn't fill using the
 UPDATE ... SET topogeom ... approach. Will explore other approaches
 later.

 Re the presence of holes, I may have deleted faces when running my function
 for removing extra nodes. This needs checking.

 Advancing in my work, I also got to drop edge 6341 and I end up with this:

 https://dl.dropboxusercontent.com/u/5196336/edge6340.bmp

 So the next step is to split edge 6340 about its middle, with the goal of
 then connecting the newly created node with node 4753, thus creating an
 edge
 where there should be one (i.e. on the light grey line).

 However, I get the error: *point not on edge* when running ST_ModEdgeSplit.
 First, I tried to find the new node location using the coordinate capture
 tool in QGIS but because I got that error I thought maybe I really need to
 find a point that's on the edge so I used this approach:

 /WITH edge AS (SELECT geom line
   FROM de_20k_topo.edge_data
   WHERE edge_id = 6340
 ), point AS (SELECT e.line, ST_ClosestPoint(e.line,
 ST_GeomFromText('POINT(-208737.346 811681.163)',
 32198)) point
  FROM edge e
 )
 SELECT ST_ModEdgeSplit('de_20k_topo', 6340, point)
 FROM point;

 /

 I still get the same error: point not on node.

 How is one supposed to find a point that IS on an edge?



 --
 View this message in context:
 http://postgis.17.x6.nabble.com/Topology-cannot-delete-slivers-or-gaps-tp5007250p5007281.html
 Sent from the PostGIS - User mailing list archive at Nabble.com.
 ___
 postgis-users mailing list
 postgis-users@lists.osgeo.org
 http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

Re: [postgis-users] Topology: cannot delete slivers (or gaps)

2014-11-06 Thread Sandro Santilli
On Wed, Nov 05, 2014 at 03:37:32PM -0800, Guillaume Drolet wrote:

 So the next step is to split edge 6340 about its middle, with the goal of
 then connecting the newly created node with node 4753, thus creating an edge
 where there should be one (i.e. on the light grey line). 
 
 However, I get the error: *point not on edge* when running ST_ModEdgeSplit.

[...]

 How is one supposed to find a point that IS on an edge?

This is indeed tricky. The easiest way could be adding an explicit node
with TopoGeo_addPoint and a tolerance value large enough. Something like:

  SELECT
TopoGeo_addPoint('de_20k_topo',
ST_ClosestPoint(
  e.line, 
  ST_GeomFromText('POINT(-208737.346 811681.163)', 32198)
),
1.0 -- tolerance
)
  FROM edge e
  WHERE edge_id = 6340;

The query will return the id of the nelwy added node, which would
split edge 6340 if it's closer than 1.0 units from it.

You can verify if the split happened by checking if either
start_node or end_node of edge 6340 are equal to the returned id.

--strk;

  ()   Free GIS  Flash consultant/developer
  /\   http://strk.keybit.net/services.html
___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users


Re: [postgis-users] Topology: cannot delete slivers (or gaps)

2014-11-06 Thread Guillaume Drolet
Sandro: TopoGeo_addPoint sounds like the appropriate choice. I hadn't seen
this alternative topology function. Will try that, thanks.

Remi: Thanks for your advice on when to use what tools. I should give GRASS
a shot at topology cleaning.  Since topology-related work isn't something I
do everyday and PostGIS is a tool I use frequently, I naturally went in that
direction.



--
View this message in context: 
http://postgis.17.x6.nabble.com/Topology-cannot-delete-slivers-or-gaps-tp5007250p5007284.html
Sent from the PostGIS - User mailing list archive at Nabble.com.
___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users