From: Anthony Molinaro <antho...@alumni.caltech.edu>
Date: Mon, 15 Oct 2012 12:15:37 -0700
Local: Mon, Oct 15 2012 3:15 pm
Subject: Re: [erlang-questions] Getting attributes
On Sat, Oct 13, 2012 at 06:38:32PM -0500, Steve Davis wrote:
This problem reminds me of one I had to do to map latitude and longitude
> I understated the issue: > The position of the entity can also change: > So, in fact, the id is the only constant and the pos and attribute are independently mutable.
> On Oct 13, 2012, at 6:23 PM, Steve Davis <steven.charles.da...@gmail.com> wrote:
> > Hi all,
> > Suppose I have a 2 dimensional plane {x, y} of 64k by 64k coordinates.
> > Each coordinate has a mutable attribute {{x, y}, attribute}
> > If I need to query: What are the attributes of positions "next to" my position, i.e: x +- 1, y +- 1?
> > What is the correct solution to this without storing everything in "Oracle" and using relational queries?
> > Can this be sensibly maintained in a KV store?
to location, then look up the closest location based on the latitude and longitude of an input. I used an ordered_set ets table inserting records like
{Latitude, Longitude, Record}
Then when looking things up given an input latitude and longitude, I would
Then query ets first using ets:prev/2 with the input latitude and walking
You then do the same with ets:next/2 to the upper bound and
I would pass the upper and lower bound of the longitude along so I could
I've got about 60000 entries in the ets table and queries take about
Unfortunately the code is not shareable, but its relatively straightforward
Good Luck,
-Anthony
-- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||