--
You received this message because you are subscribed to the Google Groups "Transit Developers" group.
To post to this group, send email to transit-d...@googlegroups.com.
To unsubscribe from this group, send email to transit-develop...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/transit-developers?hl=en.
There's a picture here which shows where the discontinuities might appear, as well as a strategy for finding points in a box:
http://en.wikipedia.org/wiki/Z-order_(curve)
I've had the best experiences with PostGIS for this sort of thing. Their underlying index is, I think, the R-Tree, which does not suck:
http://en.wikipedia.org/wiki/R-Tree
-mike.
On Mar 10, 2010, at 9:26 AM, Kieran Huggins wrote:
> An interesting idea I saw a friend implement just yesterday is using geohashes to both store & find nearby points.
>
> http://en.wikipedia.org/wiki/Geohash
>
> Geohashes are numerically close when they're near one another, so finding all points within a certain range is as easy as either setting a min & max in a database, or matching a common string prefix.
>
> There are edge cases near the equator where this approach fails, and it also typically requires some post-select shaving to get rid of fringe results, but in general I really like it. If our app didn't necessitate a kdtree c implementation, we'd probably be using geohashes.
>
> Finding proximity in MySQL is possible, though the queries are a pain the ass to write & it can get quite slow for larger datasets. If you're interested in this approach anyway take a look at http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html Postgres has a more convenient API for queries... but it's postgres :-/ http://postgis.refractions.net/
>
> Cheers,
> Kieran
>
> On Wed, Mar 10, 2010 at 2:03 AM, Joa <joachim....@gmail.com> wrote:
> --
> You received this message because you are subscribed to the Google Groups "Transit Developers" group.
> To post to this group, send email to transit-d...@googlegroups.com.
> To unsubscribe from this group, send email to transit-develop...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/transit-developers?hl=en.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "Transit Developers" group.
> To post to this group, send email to transit-d...@googlegroups.com.
> To unsubscribe from this group, send email to transit-develop...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/transit-developers?hl=en.
----------------------------------------------------------------
michal migurski- mi...@stamen.com
415.558.1610
Paul
--
You received this message because you are subscribed to the Google Groups "Transit Developers" group.
To post to this group, send email to transit-d...@googlegroups.com.
To unsubscribe from this group, send email to transit-develop...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/transit-developers?hl=en.
If you're interested in learning more about how trip planning is coded, you
should check out the OpenTripPlanner project: http://opentripplanner.org/
All of the code is released under the LGPL, so you can read it and see exactly
how it works :) (Our mailing list also has a decent amount of discussion of
trip planning algorithms/problems.)
/end semi-shameless plug
-Nick
>
> On Wed, Mar 10, 2010 at 3:20 PM, Paul Trenkler <pal...@gmail.com> wrote:
>
> > SQLite can support R-trees too (if compiled with the appropriate
> > option):
> > http://www.sqlite.org/rtree.html
> > Personally I'm using it as an in-memory database table from a C++
> > routing engine
> >
> > Paul
> >
> > On Mar 10, 8:33 pm, Michal Migurski <m...@stamen.com> wrote:
> > > I've had the best experiences with PostGIS for this sort of thing. Their
> > underlying index is, I think, the R-Tree, which does not suck:
> > > http://en.wikipedia.org/wiki/R-Tree
> > >
> > > -mike.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Transit Developers" group.
> > To post to this group, send email to transit-d...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > transit-develop...@googlegroups.com<transit-developers%2Bunsu...@googlegroups.com>