[pgrouting-users] Setting the tolerance argument in assign_vertex_id

Daniel Kastl daniel.kastl at georepublic.de
Thu Aug 26 20:48:25 EDT 2010


Hi Dan,

If you think your data is very accurate, then setting this value very low is
the best. It can be millimeters or even less. It doesn't matter how small
you make it if you don't want two points to snap. I think the problem often
comes up when your data projection is in degrees and you set the value too
high. Then it can happen that all your data snaps into one point.

Daniel



2010/8/27 Dan Putler <putler at yahoo.com>

> Thanks Steve, but I do need a bit of a follow on I think, and probably
> provide a bit more explanation.
>
> I'm using a DMTI CanMap routing layer for BC that started out in NAD83
> geographic, which I converted to NAD83 UTM Zone 10N via ogr2ogr, I also
> shrank it down using a "with" statement in ogr2ogr to cover only part of the
> province. After I sent my email, I did a bit more Google searching and based
> on a question in the pgRouting forum, a user using NAVTEQ layers was using a
> tolerance that worked out to between 1 and 1.5 meters. Based on this, I set
> the tolerance to 2 meters, it sounds like I should set the tolerance in
> assign_vertex_id to be much smaller (say 0.15 meters, which is just over 5
> inches).
>
> In general, is it better to err on the side of too small or too large a
> tolerance, or is that a "it depends" question?
>
> Dan
>
> --- On Thu, 8/26/10, Stephen Woodbridge <woodbri at swoodbridge.com> wrote:
>
> > From: Stephen Woodbridge <woodbri at swoodbridge.com>
> > Subject: Re: [pgrouting-users] Setting the tolerance argument in
> assign_vertex_id
> > To: "Dan Putler" <putler at yahoo.com>
> > Cc: "pgRouting list" <pgrouting-users at lists.osgeo.org>
> > Received: Thursday, August 26, 2010, 4:27 PM
> > 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
> >
> >
>
>
> _______________________________________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20100827/5acfb7d8/attachment.html


More information about the Pgrouting-users mailing list