Re: [postgis-users] Checking Road Network Topology

2015-01-27 Thread toni hernández

No I don't see anything wrong with that.
cheers.

On 24/01/2015 00:57, Miller, Stephan wrote:


Thanks.

I have set up a new topo geometry in the “roads” table.  I am 
transforming the 4326 coordinates on-the-fly to 32648.


Do you see anything wrong with reusing the roads table for the processing?

Thanks,

Steve

*From:*postgis-users-boun...@lists.osgeo.org 
[mailto:postgis-users-boun...@lists.osgeo.org] *On Behalf Of *toni 
hernández

*Sent:* Friday, January 23, 2015 2:52 AM
*To:* postgis-users@lists.osgeo.org
*Subject:* Re: [postgis-users] Checking Road Network Topology

Steve,

I transformed the geometries into a new table.
From there I created a new topology using the new reference system 
(25831)


On 22/01/2015 16:35, Miller, Stephan wrote:

Thanks.

Here is the code as it now stands.  I was using 4326 and topology
will not work for geography coordinates.  Can you share your code
so that I can compare?  I am trying to do an on-the-fly transform
to 32648 for each record in the line 26.  Is that how you
approached this problem?

Thanks,

Steve



*From:*postgis-users-boun...@lists.osgeo.org
mailto:postgis-users-boun...@lists.osgeo.org
[mailto:postgis-users-boun...@lists.osgeo.org] *On Behalf Of *toni
hernández
*Sent:* Thursday, January 22, 2015 10:14 AM
*To:* postgis-users@lists.osgeo.org
mailto:postgis-users@lists.osgeo.org
*Subject:* Re: [postgis-users] Checking Road Network Topology

Steve,

I had the same issue when working with geometries using srid=4326
. I was also following the same link

(http://blog.mathieu-leplatre.info/use-postgis-topologies-to-clean-up-road-networks.html)
Then I tried with some projected geometries (units = meters) and
the problem was gone. I am not sure why. Maybe it was just a
coincidence.

cheers.


On 20/01/2015 20:45, Miller, Stephan wrote:

All –

I am attempting to validate the topology of a dense road
network ( 1.2 Million roads) modeled after

http://blog.mathieu-leplatre.info/use-postgis-topologies-to-clean-up-road-networks.html
from July 2013
http://blog.mathieu-leplatre.info/use-postgis-topologies-to-clean-up-road-networks.html%20from%20July%202013. 
The code is given below:


-- HC_RoadTopologicalCheck

-- Drop the existing topology

SELECT topology.DropTopology('roads_topo');

SELECT topology.CreateTopology('roads_topo',4326, 0.01, true);

SELECT topology.AddTopoGeometryColumn('roads_topo', 'fgcm',
'transportationgroundcrv', 'topo_shape', 'LINESTRING');

--UPDATE transportationgroundcrv SET topo_shape =
topology.toTopoGeom(transportationgroundcrv.shape,
'roads_topo', 1, 1.0);

-- Encapsulate the UPDATE inside code that checks for errors

DO $$ DECLARE r record;

BEGIN

FOR r IN SELECT * FROM transportationgroundcrv loop

BEGIN

UPDATE transportationgroundcrv SET topo_shape =
topology.toTopoGeom(transportationgroundcrv.shape,
'roads_topo', 1, 1.0)

WHERE r.objectid = r.objectid;

EXCEPTION

WHEN OTHERS THEN

RAISE WARNING 'Loading of record % failed: %',
r.objectid, SQLERRM;

END;

END LOOP;

END$$;

Select * from ValidateTopology('roads_topo');

I am getting everything passing to the exception statement and
all the records are being flagged with

WARNING:  Loading of record 791456 failed: SQL/MM Spatial
exception - curve not simple

Intermittently, I am getting the following error also.

WARNING:  Loading of record 792591 failed: Spatial exception -
geometry intersects edge 69612

Everything appears to be flagged as an error; the
ValidateTopology call returns nothing.

Any insights or suggestions would be appreciated.

Steve





___

postgis-users mailing list

postgis-users@lists.osgeo.org  mailto:postgis-users@lists.osgeo.org

http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users




___

postgis-users mailing list

postgis-users@lists.osgeo.org  mailto: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


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

Re: [postgis-users] Checking Road Network Topology

2015-01-27 Thread Miller, Stephan
Thanks.

From: postgis-users-boun...@lists.osgeo.org 
[mailto:postgis-users-boun...@lists.osgeo.org] On Behalf Of toni hernández
Sent: Tuesday, January 27, 2015 5:39 AM
To: postgis-users@lists.osgeo.org
Subject: Re: [postgis-users] Checking Road Network Topology

No I don't see anything wrong with that.
cheers.
On 24/01/2015 00:57, Miller, Stephan wrote:
Thanks.

I have set up a new topo geometry in the roads table.  I am transforming the 
4326 coordinates on-the-fly to 32648.

Do you see anything wrong with reusing the roads table for the processing?

Thanks,

Steve

From: 
postgis-users-boun...@lists.osgeo.orgmailto:postgis-users-boun...@lists.osgeo.org
 [mailto:postgis-users-boun...@lists.osgeo.org] On Behalf Of toni hernández
Sent: Friday, January 23, 2015 2:52 AM
To: postgis-users@lists.osgeo.orgmailto:postgis-users@lists.osgeo.org
Subject: Re: [postgis-users] Checking Road Network Topology

Steve,

I transformed the geometries into a new table.
From there I created a new topology using the new reference system (25831)
On 22/01/2015 16:35, Miller, Stephan wrote:
Thanks.

Here is the code as it now stands.  I was using 4326 and topology will not work 
for geography coordinates.  Can you share your code so that I can compare?  I 
am trying to do an on-the-fly transform to 32648 for each record in the line 
26.  Is that how you approached this problem?

Thanks,

Steve



From: 
postgis-users-boun...@lists.osgeo.orgmailto:postgis-users-boun...@lists.osgeo.org
 [mailto:postgis-users-boun...@lists.osgeo.org] On Behalf Of toni hernández
Sent: Thursday, January 22, 2015 10:14 AM
To: postgis-users@lists.osgeo.orgmailto:postgis-users@lists.osgeo.org
Subject: Re: [postgis-users] Checking Road Network Topology

Steve,

I had the same issue when working with geometries using srid=4326 . I was also 
following the same link 
(http://blog.mathieu-leplatre.info/use-postgis-topologies-to-clean-up-road-networks.html)
Then I tried with some projected geometries (units = meters) and the problem 
was gone. I am not sure why. Maybe it was just a coincidence.

cheers.



On 20/01/2015 20:45, Miller, Stephan wrote:
All -

I am attempting to validate the topology of a dense road network ( 1.2 Million 
roads) modeled after 
http://blog.mathieu-leplatre.info/use-postgis-topologies-to-clean-up-road-networks.html
 from July 
2013http://blog.mathieu-leplatre.info/use-postgis-topologies-to-clean-up-road-networks.html%20from%20July%202013.
  The code is given below:


-- HC_RoadTopologicalCheck
-- Drop the existing topology

SELECT topology.DropTopology('roads_topo');

SELECT topology.CreateTopology('roads_topo',4326, 0.01, true);

SELECT topology.AddTopoGeometryColumn('roads_topo', 'fgcm', 
'transportationgroundcrv', 'topo_shape', 'LINESTRING');
--UPDATE transportationgroundcrv SET topo_shape = 
topology.toTopoGeom(transportationgroundcrv.shape, 'roads_topo', 1, 1.0);

-- Encapsulate the UPDATE inside code that checks for errors
DO $$ DECLARE r record;
BEGIN
FOR r IN SELECT * FROM transportationgroundcrv loop
BEGIN
UPDATE transportationgroundcrv SET topo_shape = 
topology.toTopoGeom(transportationgroundcrv.shape, 'roads_topo', 1, 1.0)
WHERE r.objectid = r.objectid;
EXCEPTION
WHEN OTHERS THEN
RAISE WARNING 'Loading of record % failed: %', r.objectid, 
SQLERRM;
END;
END LOOP;

END$$;

Select * from ValidateTopology('roads_topo');

I am getting everything passing to the exception statement and all the records 
are being flagged with

WARNING:  Loading of record 791456 failed: SQL/MM Spatial exception - curve not 
simple

Intermittently, I am getting the following error also.

WARNING:  Loading of record 792591 failed: Spatial exception - geometry 
intersects edge 69612


Everything appears to be flagged as an error; the ValidateTopology call returns 
nothing.

Any insights or suggestions would be appreciated.

Steve








___

postgis-users mailing list

postgis-users@lists.osgeo.orgmailto:postgis-users@lists.osgeo.org

http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users






___

postgis-users mailing list

postgis-users@lists.osgeo.orgmailto:postgis-users@lists.osgeo.org

http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users





___

postgis-users mailing list

postgis-users@lists.osgeo.orgmailto: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] Checking Road Network Topology

2015-01-23 Thread toni hernández

yeah! that's it.
thanks.

On 23/01/2015 11:34, Sandro Santilli wrote:

On Fri, Jan 23, 2015 at 10:46:43AM +0100, toni hernández wrote:

Sandro,

At this point I am not sure. :-(

I tried again using srid=4326 and a tolerance of 0.0001 which for my
latitud (Girona, Spain) is about 1 meter.
This time everything worked just fine.

Great!
So, to recap, tolerance=0 errored out while tolerance=0.0001 worked fine ?

Note that when a tolerance=0 is given, the code would actually compute
the tolerance for each line geometry added looking at the smallest
representable shift from the biggest ordinate value in input.

There are known robustness issues in the topology builder which you can
find on the tracker. You might have encountered one of these. The idea
to load in chunks serves the purpose to be able to fix such issues locally
when they happen, understanding your data better and tweaking tolerances
on a feature basis (if needed).

--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



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


Re: [postgis-users] Checking Road Network Topology

2015-01-23 Thread toni hernández

Sandro,

At this point I am not sure. :-(

I tried again using srid=4326 and a tolerance of 0.0001 which for my 
latitud (Girona, Spain) is about 1 meter.

This time everything worked just fine.

This are the SQL statements adapted from 
http://blog.mathieu-leplatre.info/use-postgis-topologies-to-clean-up-road-networks.html


SELECT topology.DropTopoGeometryColumn('public', 'streets_4326', 
'topogeom'); --Topology created with 0 tolerance by default

SELECT topology.droptopology('streets_4326_topo');


-- Exercici de topologia amb coordenadas geogràfiques.

SELECT topology.CreateTopology('streets_4326_topo', 4326);
SELECT topology.AddTopoGeometryColumn('streets_4326_topo', 'public', 
'streets_4326', 'topogeom', 'MULTILINESTRING');


SELECT streets_4326_geomTotopo();

Where streets_4326_geomTotopo() is not a very good function but good 
enough for testing :


CREATE OR REPLACE FUNCTION streets_4326_geomTotopo()
  RETURNS void AS
$BODY$
DECLARE r record;
BEGIN
  FOR r IN SELECT * FROM streets_4326 LOOP
BEGIN
  UPDATE streets_4326 SET topogeom = topology.toTopoGeom(geom, 
'streets_4326_topo', 1, 0.0001) -- 0.0001º around 1 meter)

  WHERE id = r.id;
EXCEPTION
  WHEN OTHERS THEN
RAISE WARNING 'Loading of record % failed: %', r.id, SQLERRM;
END;
  END LOOP;
END;
$BODY$ LANGUAGE plpgsql volatile;


On 22/01/2015 21:53, Sandro Santilli wrote:

On Thu, Jan 22, 2015 at 04:13:44PM +0100, toni hernández wrote:

Steve,

I had the same issue when working with geometries using srid=4326 .
I was also following the same link 
(http://blog.mathieu-leplatre.info/use-postgis-topologies-to-clean-up-road-networks.html)
Then I tried with some projected geometries (units = meters) and the
problem was gone. I am not sure why. Maybe it was just a
coincidence.

Can it be you're specifying a too large of a precision for your
topologies in srid=4326 ?

--strk;
___
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] Checking Road Network Topology

2015-01-23 Thread Sandro Santilli
On Fri, Jan 23, 2015 at 10:46:43AM +0100, toni hernández wrote:
 Sandro,
 
 At this point I am not sure. :-(
 
 I tried again using srid=4326 and a tolerance of 0.0001 which for my
 latitud (Girona, Spain) is about 1 meter.
 This time everything worked just fine.

Great!
So, to recap, tolerance=0 errored out while tolerance=0.0001 worked fine ?

Note that when a tolerance=0 is given, the code would actually compute
the tolerance for each line geometry added looking at the smallest
representable shift from the biggest ordinate value in input.

There are known robustness issues in the topology builder which you can
find on the tracker. You might have encountered one of these. The idea
to load in chunks serves the purpose to be able to fix such issues locally
when they happen, understanding your data better and tweaking tolerances
on a feature basis (if needed).

--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] Checking Road Network Topology

2015-01-23 Thread Rémi Cura
For my data I also had to use a tolerance, the 0 tolerance gives errors.
Cheers,
Rémi-C

2015-01-23 13:04 GMT+01:00 toni hernández t...@sigte.udg.edu:

 yeah! that's it.
 thanks.


 On 23/01/2015 11:34, Sandro Santilli wrote:

 On Fri, Jan 23, 2015 at 10:46:43AM +0100, toni hernández wrote:

 Sandro,

 At this point I am not sure. :-(

 I tried again using srid=4326 and a tolerance of 0.0001 which for my
 latitud (Girona, Spain) is about 1 meter.
 This time everything worked just fine.

 Great!
 So, to recap, tolerance=0 errored out while tolerance=0.0001 worked fine ?

 Note that when a tolerance=0 is given, the code would actually compute
 the tolerance for each line geometry added looking at the smallest
 representable shift from the biggest ordinate value in input.

 There are known robustness issues in the topology builder which you can
 find on the tracker. You might have encountered one of these. The idea
 to load in chunks serves the purpose to be able to fix such issues locally
 when they happen, understanding your data better and tweaking tolerances
 on a feature basis (if needed).

 --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


 ___
 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] Checking Road Network Topology

2015-01-22 Thread Rémi Cura
Wow this seems like really impressive work, at a very cool scale!
It is more or less the kind of tool I dreamt to have.

Processing a 1.2 million topology is really not easy,
I wonder if CGAL implementation is multiprocessed.

Cheers,
Rémi-C

2015-01-22 8:00 GMT+01:00 Paolo Cavallini cavall...@faunalia.it:

 Il 22/01/2015 01:28, Mark Wynter ha scritto:

  I’m open to any ideas, leads or offers of help.

 I might be able to help, especially on the QGIS side; perhaps setting up
 Processing modules could make the workflow easier.
 All the best.

 --
 Paolo Cavallini - www.faunalia.eu
 QGIS  PostGIS courses: http://www.faunalia.eu/training.html
 ___
 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] Checking Road Network Topology

2015-01-22 Thread toni hernández

Steve,

I had the same issue when working with geometries using srid=4326 . I 
was also following the same link 
(http://blog.mathieu-leplatre.info/use-postgis-topologies-to-clean-up-road-networks.html)
Then I tried with some projected geometries (units = meters) and the 
problem was gone. I am not sure why. Maybe it was just a coincidence.


cheers.


On 20/01/2015 20:45, Miller, Stephan wrote:


All –

I am attempting to validate the topology of a dense road network ( 1.2 
Million roads) modeled after 
http://blog.mathieu-leplatre.info/use-postgis-topologies-to-clean-up-road-networks.html 
from July 2013 
http://blog.mathieu-leplatre.info/use-postgis-topologies-to-clean-up-road-networks.html%20from%20July%202013.  
The code is given below:


-- HC_RoadTopologicalCheck

-- Drop the existing topology

SELECT topology.DropTopology('roads_topo');

SELECT topology.CreateTopology('roads_topo',4326, 0.01, true);

SELECT topology.AddTopoGeometryColumn('roads_topo', 'fgcm', 
'transportationgroundcrv', 'topo_shape', 'LINESTRING');


--UPDATE transportationgroundcrv SET topo_shape = 
topology.toTopoGeom(transportationgroundcrv.shape, 'roads_topo', 1, 1.0);


-- Encapsulate the UPDATE inside code that checks for errors

DO $$ DECLARE r record;

BEGIN

FOR r IN SELECT * FROM transportationgroundcrv loop

BEGIN

UPDATE transportationgroundcrv SET topo_shape = 
topology.toTopoGeom(transportationgroundcrv.shape, 'roads_topo', 1, 1.0)


WHERE r.objectid = r.objectid;

EXCEPTION

WHEN OTHERS THEN

RAISE WARNING 'Loading of record % failed: %', 
r.objectid, SQLERRM;


END;

END LOOP;

END$$;

Select * from ValidateTopology('roads_topo');

I am getting everything passing to the exception statement and all the 
records are being flagged with


WARNING:  Loading of record 791456 failed: SQL/MM Spatial exception - 
curve not simple


Intermittently, I am getting the following error also.

WARNING:  Loading of record 792591 failed: Spatial exception - 
geometry intersects edge 69612


Everything appears to be flagged as an error; the ValidateTopology 
call returns nothing.


Any insights or suggestions would be appreciated.

Steve



___
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] Checking Road Network Topology

2015-01-22 Thread Miller, Stephan
Thanks.

I think I am ensuring the geometries are both projected to 32648 (zone 48N  
UTM).  The tolerance being sent to topology.toTopoGeom is 1.0, presumably this 
is in meters.  I will try the next run with 0.001 which is appropriate if 
the tolerance is being applied to 4326 coordinates for some reason.  A 
tolerance of 1.0 degree would certainly explain why every line would be reduced 
to a point or convolute the input.

I have not gotten around to using LIMIT and OFFSET as you suggested.  I keep 
thinking I have overlooked something important.

Here is the code I am running now.



-- Drop the existing topology
SELECT topology.DropTopology('roads_topo');

-- Create a new one
SELECT topology.CreateTopology('roads_topo',32648, 0.01, true);

-- Add the new topo_shape column
select topology.AddTopoGeometryColumn('roads_topo', 'fgcm', 
'transportationgroundcrv', 'topo_shape', 'LINESTRING');

SELECT TopologySummary('roads_topo');

-- Encapsulate the UPDATE inside code that checks for errors
DO $$DECLARE r record;
BEGIN
FOR r IN SELECT objectid, f_code, shape, topo_shape FROM 
transportationgroundcrv loop
BEGIN
  UPDATE transportationgroundcrv SET topo_shape = 
topology.toTopoGeom(ST_Transform((ST_SetSRID(shape,4326)),32648), 'roads_topo', 
1, 1.0);
EXCEPTION
WHEN OTHERS THEN
RAISE WARNING 'Loading of record % failed: % %', r.objectid, 
SQLSTATE, SQLERRM;
END;
END LOOP;

END$$;

Select * from ValidateTopology('roads_topo');



Let me know if you see something obvious.

Steve
 

-Original Message-
From: postgis-users-boun...@lists.osgeo.org 
[mailto:postgis-users-boun...@lists.osgeo.org] On Behalf Of Sandro Santilli
Sent: Thursday, January 22, 2015 3:53 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Checking Road Network Topology

On Thu, Jan 22, 2015 at 04:13:44PM +0100, toni hernández wrote:
 Steve,
 
 I had the same issue when working with geometries using srid=4326 .
 I was also following the same link 
 (http://blog.mathieu-leplatre.info/use-postgis-topologies-to-clean-up-
 road-networks.html) Then I tried with some projected geometries (units 
 = meters) and the problem was gone. I am not sure why. Maybe it was 
 just a coincidence.

Can it be you're specifying a too large of a precision for your topologies in 
srid=4326 ?

--strk;
___
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] Checking Road Network Topology

2015-01-22 Thread toni hernández

Steve,

I transformed the geometries into a new table.
From there I created a new topology using the new reference system (25831)

On 22/01/2015 16:35, Miller, Stephan wrote:


Thanks.

Here is the code as it now stands.  I was using 4326 and topology will 
not work for geography coordinates.  Can you share your code so that I 
can compare?  I am trying to do an on-the-fly transform to 32648 for 
each record in the line 26.  Is that how you approached this problem?


Thanks,

Steve


*From:*postgis-users-boun...@lists.osgeo.org 
[mailto:postgis-users-boun...@lists.osgeo.org] *On Behalf Of *toni 
hernández

*Sent:* Thursday, January 22, 2015 10:14 AM
*To:* postgis-users@lists.osgeo.org
*Subject:* Re: [postgis-users] Checking Road Network Topology

Steve,

I had the same issue when working with geometries using srid=4326 . I 
was also following the same link 
(http://blog.mathieu-leplatre.info/use-postgis-topologies-to-clean-up-road-networks.html)
Then I tried with some projected geometries (units = meters) and the 
problem was gone. I am not sure why. Maybe it was just a coincidence.


cheers.

On 20/01/2015 20:45, Miller, Stephan wrote:

All –

I am attempting to validate the topology of a dense road network (
1.2 Million roads) modeled after

http://blog.mathieu-leplatre.info/use-postgis-topologies-to-clean-up-road-networks.html
from July 2013
http://blog.mathieu-leplatre.info/use-postgis-topologies-to-clean-up-road-networks.html%20from%20July%202013. 
The code is given below:


-- HC_RoadTopologicalCheck

-- Drop the existing topology

SELECT topology.DropTopology('roads_topo');

SELECT topology.CreateTopology('roads_topo',4326, 0.01, true);

SELECT topology.AddTopoGeometryColumn('roads_topo', 'fgcm',
'transportationgroundcrv', 'topo_shape', 'LINESTRING');

--UPDATE transportationgroundcrv SET topo_shape =
topology.toTopoGeom(transportationgroundcrv.shape, 'roads_topo',
1, 1.0);

-- Encapsulate the UPDATE inside code that checks for errors

DO $$ DECLARE r record;

BEGIN

FOR r IN SELECT * FROM transportationgroundcrv loop

BEGIN

UPDATE transportationgroundcrv SET topo_shape =
topology.toTopoGeom(transportationgroundcrv.shape, 'roads_topo',
1, 1.0)

WHERE r.objectid = r.objectid;

EXCEPTION

WHEN OTHERS THEN

RAISE WARNING 'Loading of record % failed: %',
r.objectid, SQLERRM;

END;

END LOOP;

END$$;

Select * from ValidateTopology('roads_topo');

I am getting everything passing to the exception statement and all
the records are being flagged with

WARNING:  Loading of record 791456 failed: SQL/MM Spatial
exception - curve not simple

Intermittently, I am getting the following error also.

WARNING:  Loading of record 792591 failed: Spatial exception -
geometry intersects edge 69612

Everything appears to be flagged as an error; the ValidateTopology
call returns nothing.

Any insights or suggestions would be appreciated.

Steve




___

postgis-users mailing list

postgis-users@lists.osgeo.org  mailto: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


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

Re: [postgis-users] Checking Road Network Topology

2015-01-21 Thread Sandro Santilli
On Wed, Jan 21, 2015 at 09:11:16AM +0100, Rémi Cura wrote:
 Hey,
 we previously discussed this matter of cleaning topology.
 Postgis topology is about iso topology storage and use, not cleaning.

That said, you can still use PostGIS for cleaning the data you're willing
to store in a topological model. It might need you to make your own
cleaning procedures, but we're happy to accept contributions :)

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


Re: [postgis-users] Checking Road Network Topology

2015-01-21 Thread Rémi Cura
Hey,
we previously discussed this matter of cleaning topology.
Postgis topology is about iso topology storage and use, not cleaning.
There are dedicated and powerfull tools for this (like Grass
http://grass.osgeo.org/grass70/manuals/v.clean.html).
Cheers,
Rémi-C

2015-01-20 21:26 GMT+01:00 Sandro Santilli s...@keybit.net:

 On Tue, Jan 20, 2015 at 07:45:47PM +, Miller, Stephan wrote:

  I am attempting to validate the topology of
  a dense road network ( 1.2 Million roads)
 ...
  Everything appears to be flagged as an error; the ValidateTopology call
 returns nothing.

 You mean _no_ record got imported ?
 Can you share the dataset ?
 What's the output of SELECT postgis_full_version() ?

 --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

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

Re: [postgis-users] Checking Road Network Topology

2015-01-21 Thread Rémi Cura
Yeah sure , it was discussed on the user list :

http://lists.osgeo.org/pipermail/postgis-users/2014-November/039758.html

I personnaly tried the grass v.clean and it is fast and efficient (altough
the grass UI is terrible in my opinion)

Cheers,
Rémi-C

2015-01-21 14:05 GMT+01:00 Miller, Stephan smill...@harris.com:

  Thanks.   I will look into GRASS.



 Can you send a pointer to the blog where this topic was discussed?



 Thanks,



 Steve



 *From:* Rémi Cura [mailto:remi.c...@gmail.com]
 *Sent:* Wednesday, January 21, 2015 3:11 AM
 *To:* PostGIS Users Discussion; Miller, Stephan
 *Subject:* Re: [postgis-users] Checking Road Network Topology



 Hey,

 we previously discussed this matter of cleaning topology.

 Postgis topology is about iso topology storage and use, not cleaning.

 There are dedicated and powerfull tools for this (like Grass
 http://grass.osgeo.org/grass70/manuals/v.clean.html).

 Cheers,
 Rémi-C



 2015-01-20 21:26 GMT+01:00 Sandro Santilli s...@keybit.net:

 On Tue, Jan 20, 2015 at 07:45:47PM +, Miller, Stephan wrote:

  I am attempting to validate the topology of
  a dense road network ( 1.2 Million roads)
 ...
  Everything appears to be flagged as an error; the ValidateTopology call
 returns nothing.

 You mean _no_ record got imported ?
 Can you share the dataset ?
 What's the output of SELECT postgis_full_version() ?

 --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



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

Re: [postgis-users] Checking Road Network Topology

2015-01-20 Thread Sandro Santilli
On Tue, Jan 20, 2015 at 07:45:47PM +, Miller, Stephan wrote:

 I am attempting to validate the topology of
 a dense road network ( 1.2 Million roads) 
...
 Everything appears to be flagged as an error; the ValidateTopology call 
 returns nothing.

You mean _no_ record got imported ?
Can you share the dataset ?
What's the output of SELECT postgis_full_version() ?

--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