[pgrouting-users] pgr_nodeNetwork ?

Stephen Woodbridge woodbri at swoodbridge.com
Tue Nov 18 12:43:14 PST 2014


On 11/18/2014 3:31 PM, Hugo Mercier wrote:
> Hi,
>
> Le 17/11/2014 23:35, Stephen Woodbridge a écrit :
>> On 11/17/2014 3:17 PM, Hugo Mercier wrote:
>>> Hi all,
>>>
>>> I am trying to use pgr_nodeNetwork to split crossing lines (both
>>> X-shaped and T-shaped).
>>> It seems to add way more new nodes than needed. Lines are sometimes
>>> split right in the middle where there is no reason for that (no
>>> intersection).
>>> Playing with the tolerance argument does not seem to solve the issue.
>>
>> Tolerance needs to be set in the units of your data, ie: if you data is
>> in WGS84 decimal degrees then you need a tolerance like 0.000001 But if
>> you data is in meters then a tolerance of 1.0 is probably fine. Of
>> course this all depends on your data.
>>
>> If you have lines like
>>
>> A---------C-B---------D
>>
>> where the original segments are AB and CD then you will get new segments
>> AC, CB, BD
>>
>> There are lots of cases that look fine when you view the data, but are
>> not so good when we analyze the data. Also if you tolerance is wacky
>> then there is not telling what might happen.
>>
>> -Steve
>
> Yes. But, with a closer look, my data are still fine.
>
> Consider the following simple case of two segments crossing on (5,5) :
>
> create table network (id int, the_geom geometry(linestring) );
> insert into network values (1, 'linestring(0 0, 10 10)'::geometry);
> insert into network values (2, 'linestring(2 0, 8 10)'::geometry);
> select pgr_nodeNetwork('network', 0.001);
>
> The "network_noded" table then contains 4 geometries :
> LINESTRING(0 0,1 1) <-- the first segment split on what seems to be the
> projection of the starting point of the second segment (?)
> LINESTRING(1 1,9 9) <-- split on the projection of the ending point of
> the second segment
> LINESTRING(9 9,10 10)
> LINESTRING(2 0,8 10) <-- the original second segment
>
> Is it what is expected ?

No I do not think that was the intention. Please open a ticket and 
document this, so it can get fixed.

> I expected to find the two geometries split on the (5,5) point ...

This is the intended behavior.

Thanks,
   -Steve

> PS: I am using pgrouting 2.0.0
> _______________________________________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>



More information about the Pgrouting-users mailing list