On Saturday, April 17, 2010, philip andrew <philip14...@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