[erlang-questions] Getting attributes

Toby Thain toby@REDACTED
Sun Oct 14 19:31:20 CEST 2012


On 14/10/12 2:55 AM, Dmitry Kolesnikov wrote:
> Yes,
>
> You can use z-cuve to handle it within key/value store.
> http://en.wikipedia.org/wiki/Z-order_curve
>
> alternative approach, is R-tree but 64k-by-64k might be too much to keep it in-memory. Therefore, MySQL + RTRee index should help you.
>

If using a relational database, spatial indexing is not required. Simple 
tuples are quite enough, just put a composite index on (x,y) since all 
fetches are (constant,constant). And you can get all neighbours in a 
single statement.

--Toby

>
> - Dmitry
>
> On Oct 14, 2012, at 2:23 AM, Steve Davis 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?
>>
>> /s
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>




More information about the erlang-questions mailing list