[pgrouting-users] Setting the tolerance argument in assign_vertex_id

Stephen Woodbridge woodbri at swoodbridge.com
Thu Aug 26 19:27:27 EDT 2010


On 8/26/2010 2:51 PM, Dan Putler wrote:
> Hi,
>
> I'm curious how to determine the value of the second argument in the
> function assign_vertex_id(). Most of the examples I can find look
> like:
>
> assign_vertex_id('<edge table>', 0.001, 'the_geom', 'gid')
>
> Most of the examples are based on edge tables that have SRIDs that
> correspond to either WGS84 geographic or some sort of US State Plane
> feet. I'm using data that is using a UTM coordinate SRID, so the map
> units are in meters. My question is whether the map units should
> influence the choice of the second argument to the function (which I
> assume is a tolerance between edges), or should I just keep with the
> value 0.001? Implicitly, I'm asking if the parameter is in the map
> units of the SRID.

Dan,

Right units is important.

When I use data in WGS84 that has at lease 6 decimal places then I use 
0.000001 as the tolerance. What this means if that if the distance 
between two points are less than or equal 0.000001 units then they 
should be considered the same point. 0.000001 degrees == ~5 inches if I 
did the math right.

I think there are two issues you need to be aware of:

1) units
2) your data and what precision it was built at

HTH,
   -Steve



More information about the Pgrouting-users mailing list