Quantcast

STRtree index persistence

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

STRtree index persistence

Dinomir
Hi All,
I am using JTS through Geotools. I am trying to create a spatial index
on my shapefile polygon data, unhomogenously distributed over space
(read only) for a point in polygon type of queries, and I have two
options - either use a qix (that's a quadree, right?) or use

final SpatialIndex index = new STRtree();   using the JTS functionalities.
I like the second option, but am wondering how I could save the results
of the indexing for future use. In other words, I need to introduce
persistence.
Alternatively, I guess I could just generate a qix index and use that,
but I wanted to try the STRtree, as I think it is better suited for my
data.
Cheers
Martin

_______________________________________________
jts-devel mailing list
[hidden email]
http://lists.refractions.net/mailman/listinfo/jts-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: STRtree index persistence

Martin Davis
Do you just need to serialize the tree (and all its contents), or do you
need to maintain and access the tree on disk?  I think these two things
require very different designs.

Serializing should be easy - just make everything Serializable.  (And
let me know if it works and what the patch is).

Although then I have to ask - why not just rebuild the tree as you read
in the underlying data?  Does it really take that long?

Hmm... and the STRtree has two phases of construction, the build phase
and the indexed phase.  You'll have to think about whether you persist
both phases, or whether you force an index build before serializing.

Martin Tomko wrote:

> Hi All,
> I am using JTS through Geotools. I am trying to create a spatial index
> on my shapefile polygon data, unhomogenously distributed over space
> (read only) for a point in polygon type of queries, and I have two
> options - either use a qix (that's a quadree, right?) or use
>
> final SpatialIndex index = new STRtree();   using the JTS
> functionalities.
> I like the second option, but am wondering how I could save the
> results of the indexing for future use. In other words, I need to
> introduce persistence.
> Alternatively, I guess I could just generate a qix index and use that,
> but I wanted to try the STRtree, as I think it is better suited for my
> data.
> Cheers
> Martin
>
> _______________________________________________
> jts-devel mailing list
> [hidden email]
> http://lists.refractions.net/mailman/listinfo/jts-devel
>

--
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022

_______________________________________________
jts-devel mailing list
[hidden email]
http://lists.refractions.net/mailman/listinfo/jts-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: STRtree index persistence

Dinomir
Hi Martin,
thanks for your response. Indeed, what I need is to write the tree to
disk, storing the index for my spatial objects (I am using the geotools
features in my index). Somehow an equivalent of the .qix for
shapefiles... Is that possible?
Thanks,
Martin

Martin Davis wrote:

> Do you just need to serialize the tree (and all its contents), or do
> you need to maintain and access the tree on disk?  I think these two
> things require very different designs.
>
> Serializing should be easy - just make everything Serializable.  (And
> let me know if it works and what the patch is).
>
> Although then I have to ask - why not just rebuild the tree as you
> read in the underlying data?  Does it really take that long?
>
> Hmm... and the STRtree has two phases of construction, the build phase
> and the indexed phase.  You'll have to think about whether you persist
> both phases, or whether you force an index build before serializing.
>
> Martin Tomko wrote:
>> Hi All,
>> I am using JTS through Geotools. I am trying to create a spatial
>> index on my shapefile polygon data, unhomogenously distributed over
>> space (read only) for a point in polygon type of queries, and I have
>> two options - either use a qix (that's a quadree, right?) or use
>>
>> final SpatialIndex index = new STRtree();   using the JTS
>> functionalities.
>> I like the second option, but am wondering how I could save the
>> results of the indexing for future use. In other words, I need to
>> introduce persistence.
>> Alternatively, I guess I could just generate a qix index and use
>> that, but I wanted to try the STRtree, as I think it is better suited
>> for my data.
>> Cheers
>> Martin
>>
>> _______________________________________________
>> jts-devel mailing list
>> [hidden email]
>> http://lists.refractions.net/mailman/listinfo/jts-devel
>>
>


--
Martin Tomko
Postdoctoral Research Assistant
   
Geographic Information Systems Division
Department of Geography
University of Zurich - Irchel
Winterthurerstr. 190
CH-8057 Zurich, Switzerland

email: [hidden email]
site: http://www.geo.uzh.ch/~mtomko
mob: +41-788 629 558
tel: +41-44-6355256
fax: +41-44-6356848

_______________________________________________
jts-devel mailing list
[hidden email]
http://lists.refractions.net/mailman/listinfo/jts-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: STRtree index persistence

HowardLander
This post has NOT been accepted by the mailing list yet.
In reply to this post by Martin Davis
Hi Martin

Speaking only for us here at RENCI, indeed rebuilding the tree is a significant cost for us.  Just serializing to disk and being able to read it back into memory would be very helpful.  I think our current tree takes about 4 minutes to build: that's partially because we are using Matlab, but the search is incredibly fast...

Howard

Martin Davis wrote
Do you just need to serialize the tree (and all its contents), or do you
need to maintain and access the tree on disk?  I think these two things
require very different designs.

Serializing should be easy - just make everything Serializable.  (And
let me know if it works and what the patch is).

Although then I have to ask - why not just rebuild the tree as you read
in the underlying data?  Does it really take that long?

Hmm... and the STRtree has two phases of construction, the build phase
and the indexed phase.  You'll have to think about whether you persist
both phases, or whether you force an index build before serializing.

Martin Tomko wrote:
> Hi All,
> I am using JTS through Geotools. I am trying to create a spatial index
> on my shapefile polygon data, unhomogenously distributed over space
> (read only) for a point in polygon type of queries, and I have two
> options - either use a qix (that's a quadree, right?) or use
>
> final SpatialIndex index = new STRtree();   using the JTS
> functionalities.
> I like the second option, but am wondering how I could save the
> results of the indexing for future use. In other words, I need to
> introduce persistence.
> Alternatively, I guess I could just generate a qix index and use that,
> but I wanted to try the STRtree, as I think it is better suited for my
> data.
> Cheers
> Martin
>
> _______________________________________________
> jts-devel mailing list
> jts-devel@lists.jump-project.org
> http://lists.refractions.net/mailman/listinfo/jts-devel
>

--
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022

_______________________________________________
jts-devel mailing list
jts-devel@lists.jump-project.org
http://lists.refractions.net/mailman/listinfo/jts-devel
Loading...