You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Adrien Mogenet <ad...@gmail.com> on 2013/10/04 10:01:43 UTC

Re: Spatial data posting in HBase

If you mean "insert and query" spatial data, look at algorithms that are
"distributed databases compliant" : geohash, z-index, voronoi diagram...

Well, that makes me want to write a blog article about these topics :)


On Tue, Sep 24, 2013 at 3:43 PM, Ted Yu <yu...@gmail.com> wrote:

> There're plenty of examples in unit tests.
> e.g. :
>
>       Put put = new Put(Bytes.toBytes("row" + String.format("%1$04d", i)));
>       put.add(family, null, value);
>       table.put(put);
>
> value can be obtained through Bytes.toBytes().
> table is an HTable.
>
> Cheers
>
>
> On Tue, Sep 24, 2013 at 4:15 AM, cto <an...@tcs.com> wrote:
>
> > Hi ,
> >
> > I am very new in HBase. Could you please let me know , how to insert
> > spatial
> > data (Latitude / Longitude) in HBase using Java .
> >
> >
> >
> > --
> > View this message in context:
> >
> http://apache-hbase.679495.n3.nabble.com/Spatial-data-posting-in-HBase-tp4051123.html
> > Sent from the HBase User mailing list archive at Nabble.com.
> >
>



-- 
Adrien Mogenet
http://www.borntosegfault.com

Re: Spatial data posting in HBase

Posted by Enis Söztutar <en...@gmail.com>.
You can look at the "HBase in Action" book, which contains a whole chapter
on an example GIS system on HBase.

Enis


On Fri, Oct 4, 2013 at 1:01 AM, Adrien Mogenet <ad...@gmail.com>wrote:

> If you mean "insert and query" spatial data, look at algorithms that are
> "distributed databases compliant" : geohash, z-index, voronoi diagram...
>
> Well, that makes me want to write a blog article about these topics :)
>
>
> On Tue, Sep 24, 2013 at 3:43 PM, Ted Yu <yu...@gmail.com> wrote:
>
> > There're plenty of examples in unit tests.
> > e.g. :
> >
> >       Put put = new Put(Bytes.toBytes("row" + String.format("%1$04d",
> i)));
> >       put.add(family, null, value);
> >       table.put(put);
> >
> > value can be obtained through Bytes.toBytes().
> > table is an HTable.
> >
> > Cheers
> >
> >
> > On Tue, Sep 24, 2013 at 4:15 AM, cto <an...@tcs.com> wrote:
> >
> > > Hi ,
> > >
> > > I am very new in HBase. Could you please let me know , how to insert
> > > spatial
> > > data (Latitude / Longitude) in HBase using Java .
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://apache-hbase.679495.n3.nabble.com/Spatial-data-posting-in-HBase-tp4051123.html
> > > Sent from the HBase User mailing list archive at Nabble.com.
> > >
> >
>
>
>
> --
> Adrien Mogenet
> http://www.borntosegfault.com
>

Re: Spatial data posting in HBase

Posted by Michael Segel <mi...@hotmail.com>.
Actually just to follow up.. 

Geohash kinda has some issues at the global scale. Edge conditions on quadrant boundaries. 

You're better off tiling the map, and then within each tile you can filter the list. 
I think you'd also want to be a bit more OO than what's in the HBase book. 

You will want to create a spatial point object that has x,y and z coordinates instead of storing the x, y, and z coordinates as separate columns. 

Depending on the size of the tile the number of coordinates that you have to filter can become sparse, such that its actually faster to just have a single thread run through it. 

Of course YMMV, however from experience... this works the best. 

HTH

-Mike

On Oct 7, 2013, at 7:20 PM, Michael Segel <mi...@hotmail.com> wrote:

> I don't think you really want to use geo hashes. 
> 
> Check out InfoQ and Search on Boris Lublinsky.
> 
> On Oct 4, 2013, at 3:01 AM, Adrien Mogenet <ad...@gmail.com> wrote:
> 
>> If you mean "insert and query" spatial data, look at algorithms that are
>> "distributed databases compliant" : geohash, z-index, voronoi diagram...
>> 
>> Well, that makes me want to write a blog article about these topics :)
>> 
>> 
>> On Tue, Sep 24, 2013 at 3:43 PM, Ted Yu <yu...@gmail.com> wrote:
>> 
>>> There're plenty of examples in unit tests.
>>> e.g. :
>>> 
>>>     Put put = new Put(Bytes.toBytes("row" + String.format("%1$04d", i)));
>>>     put.add(family, null, value);
>>>     table.put(put);
>>> 
>>> value can be obtained through Bytes.toBytes().
>>> table is an HTable.
>>> 
>>> Cheers
>>> 
>>> 
>>> On Tue, Sep 24, 2013 at 4:15 AM, cto <an...@tcs.com> wrote:
>>> 
>>>> Hi ,
>>>> 
>>>> I am very new in HBase. Could you please let me know , how to insert
>>>> spatial
>>>> data (Latitude / Longitude) in HBase using Java .
>>>> 
>>>> 
>>>> 
>>>> --
>>>> View this message in context:
>>>> 
>>> http://apache-hbase.679495.n3.nabble.com/Spatial-data-posting-in-HBase-tp4051123.html
>>>> Sent from the HBase User mailing list archive at Nabble.com.
>>>> 
>>> 
>> 
>> 
>> 
>> -- 
>> Adrien Mogenet
>> http://www.borntosegfault.com
> 
> The opinions expressed here are mine, while they may reflect a cognitive thought, that is purely accidental. 
> Use at your own risk. 
> Michael Segel
> michael_segel (AT) hotmail.com
> 
> 
> 
> 
> 
> 

The opinions expressed here are mine, while they may reflect a cognitive thought, that is purely accidental. 
Use at your own risk. 
Michael Segel
michael_segel (AT) hotmail.com






Re: Spatial data posting in HBase

Posted by Michael Segel <mi...@hotmail.com>.
I don't think you really want to use geo hashes. 

Check out InfoQ and Search on Boris Lublinsky.

On Oct 4, 2013, at 3:01 AM, Adrien Mogenet <ad...@gmail.com> wrote:

> If you mean "insert and query" spatial data, look at algorithms that are
> "distributed databases compliant" : geohash, z-index, voronoi diagram...
> 
> Well, that makes me want to write a blog article about these topics :)
> 
> 
> On Tue, Sep 24, 2013 at 3:43 PM, Ted Yu <yu...@gmail.com> wrote:
> 
>> There're plenty of examples in unit tests.
>> e.g. :
>> 
>>      Put put = new Put(Bytes.toBytes("row" + String.format("%1$04d", i)));
>>      put.add(family, null, value);
>>      table.put(put);
>> 
>> value can be obtained through Bytes.toBytes().
>> table is an HTable.
>> 
>> Cheers
>> 
>> 
>> On Tue, Sep 24, 2013 at 4:15 AM, cto <an...@tcs.com> wrote:
>> 
>>> Hi ,
>>> 
>>> I am very new in HBase. Could you please let me know , how to insert
>>> spatial
>>> data (Latitude / Longitude) in HBase using Java .
>>> 
>>> 
>>> 
>>> --
>>> View this message in context:
>>> 
>> http://apache-hbase.679495.n3.nabble.com/Spatial-data-posting-in-HBase-tp4051123.html
>>> Sent from the HBase User mailing list archive at Nabble.com.
>>> 
>> 
> 
> 
> 
> -- 
> Adrien Mogenet
> http://www.borntosegfault.com

The opinions expressed here are mine, while they may reflect a cognitive thought, that is purely accidental. 
Use at your own risk. 
Michael Segel
michael_segel (AT) hotmail.com