On 24 Nov 2009, at 18:50, Howard Butler wrote:
>> The item is not removed from the index when the window specified in
>> the delete method is larger that it, but only when the window exactly
>> matches its bounding box.
>>
>> Is this the expected behavior, am I misunderstanding something?
>
> Expected, yes.  "Uniqueness" in the sense of the rtree index is  
> really the bounding box that is inserted into it plus the id, not  
> merely the id.  I put uniqueness in scare quotes because I think you  
> can actually have multiple id + bbox entries with the same value and  
> delete will delete both of them (not verified though).

Thanks for your explanation, Howard. I was misinterpreting 'query  
window' in this comment in index.py:
"... providing the index's dimension * 2 coordinate pairs representing  
the mink and maxk coordinates in each dimension defining the bounds of  
the query window."

> I think you want something like a "range delete", which isn't  
> implemented in either libspatialindex or its C API.  This would  
> allow a user to do it in one shot quite quickly.  Right now, you can  
> cobble this up by doing a .intersection(objects=True) and inspecting  
> the resultant .id and .bbox elements of the results and *then*  
> issuing the delete with that.

In fact, I wanted to delete a single item at a time, and was using  
results from intersection(objects=True) to find it. The problem was  
that I was calling delete with the item's bounds instead of its bbox,  
which is interleaved. It works perfectly with the coordinates in  
item.bbox.

Thanks again for your help,
Andrew
_______________________________________________
Community mailing list
[email protected]
http://lists.gispython.org/mailman/listinfo/community

Reply via email to