incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mason Hale <ma...@onespot.com>
Subject How to model 2D data in Cassandra?
Date Sat, 17 Apr 2010 12:31:24 GMT
On Saturday, April 17, 2010, philip andrew <philip142au@gmail.com> wrote:
> Hi,
> Lets say I wanted to store 2 dimensional data in the database, each object has a X and
Y location in a very large space.
> I want to query Cassandra for all objects within a rectangle.
>

You should look into Geohash (http://en.m.wikipedia.org/wiki/Geohash)
or one of the similar alternatives. They map geographic coordinates to
lexigraphically sortable identifiers which can be used to find all
entities in a geographic region or to test whether two entities are in
the same region by comparing a single key per entity. No geometry
calulations required. ;-)

This page provides a good description of the technique:
http://code.google.com/apis/maps/articles/geospatial.html

Mason



-- 

Mason Hale
http://www.onespot.com
direct +1 800.618.0768 ext 701

Mime
View raw message