On Nov 24, 2009, at 5:26 AM, Gagan Bansal wrote:
> Hi,
>
> I was trying to use the 'pagesize' property as pagesize=1 while creating a
> index
> >>>idx = index.Index('road' , pagesize=1)
> and then I insert all my bbox to the index (idx)
> >>>del idx
>
> now next time I want to read the index from file (road.idx,road.dat)
> >>>idx = index.Index('road' , pagesize=1)
> or >>>idx = index.Index('road' )
> but I get error while reading i.e.
> rtree.core.RTreeError: Error in "Index_Create": Spatial Index Error:
> InvalidPageException: Unknown page id 1
>
> What could be the reason for this error?
I think this error has been fixed in trunk (requires trunk libspatialindex at
this time too, unfortunately).
> My aim is to load the full index in single page for efficiency.
Remember that the pagesize is a value in bytes. A pagesize=1 will never
contain the entire index. Also, ensure that your pagesize is large enough to
hold any pickled data that you might be storing in the index as well. We have
changed the pagesize to default to 4096, which is fairly reasonable. Any
larger will waste disk space, and any smaller will mean creating lots of pages.
Howard
_______________________________________________
Community mailing list
[email protected]
http://lists.gispython.org/mailman/listinfo/community