Hello,
I have been trying to make some sense of the function pgr_nodenetwork, but I haven’t succeeded.
Based on the documentation, this function “Nodes an network edge table.(…). What we mean by “noded” is that at every intersection in the road network all the edges will be broken into separate road segments”
I have been doing tests for the last couple of days. You can reproduce a simple one, by executing the following SQL statements.
– Create test_graph table and insert two geometries
SET CLIENT_ENCODING TO UTF8;
SET STANDARD_CONFORMING_STRINGS TO ON;
BEGIN;
CREATE TABLE “test_graph” (gid serial,
“id” numeric(10,0),
“nom” varchar(80));
ALTER TABLE “test_graph” ADD PRIMARY KEY (gid);
SELECT AddGeometryColumn(‘’,‘test_graph’,‘geom’,‘25831’,‘LINESTRING’,2);
INSERT INTO “test_graph” (“id”,“nom”,geom) VALUES (‘3’,NULL,‘0102000020E764000008000000F281433F6B731A41C84583B869855141592275DD14731A41C89C7A7D73855141B3E5D70CD3721A4164B5681680855141BFC2A67BBE721A419A3856BE8585514137F861B0A1721A41D72C1EC58F855141D87C445995721A413DC21EB6968551416D2458939D721A41DFF4EFE89D85514137F861B0A1721A411578DD90A3855141’);
INSERT INTO “test_graph” (“id”,“nom”,geom) VALUES (‘5’,NULL,‘0102000020E76400000900000065D6DA5A51701A410D5914A88B855141DA9E3C70E5701A4106E8394987855141ADE2BBDC85711A415E9B857C85855141C32F009B0D721A416B2643758485514150B2FF8D78721A41A8C313B784855141BFC2A67BBE721A419A3856BE85855141930626E85E731A4135FA4C92888551414E90077728741A418D04908A90855141A5E6108797741A41F399907B97855141’);
COMMIT;
ANALYZE “test_graph”;
– Try to node the network.
select pgr_nodenetwork (‘test_Graph’, 0.01, ‘gid’, ‘geom’);
You can see the geometries on images, before (http://sigserver4.udg.edu/apps/original_geometries.png) and after (http://sigserver4.udg.edu/apps/noded_geometries.png), the noding proces.
The result, is a set of 6 rows but the segments generated are not the expected ones.
Does anyone know what’s happening here?
Thanks for your help.
···
–
Toni Hernández Vallès
Servei de Sistemes d’Informació Geogràfica i Teledetecció
Universitat de Girona
SIGTE
Pl. Ferrater Mora 1
17071 Girona
Tel +34 972 418 039 (7026 intern)
toni.hernandez@udg.edu
http://www.sigte.udg.edu
Twitter http://twitter.com/SIGTE_UDG