From: Sunburned S. <sun...@gm...> - 2007-04-20 17:36:49
|
Hey guys. I always try to sketch out a basic design for my code before a start writing classes. It usually helps to think about the problem I'm trying to solve and what basic requirements my code will need to meet. I wanted to share what I thought would be some good requirements for a lib2geom spatial index. I want to have these in mind when I start to look at the existing quadtree class. Requirement #1: The spatial index should not be limited to a fixed size. At a minimum, it should be able to expand in size. If possible, it should be able to contract in size. (I'm not speaking of computer memory consumed when I say "size" in this context. I mean the limits of the space or area being indexed.) Requirement #2: The spatial index should offer the ability for efficient updates. In other words, you shouldn't have to determine where every geometry belongs in the index when a geometry is (a) added to the index (b) removed from the index, or (c) a geometry in the index is modified. Requirement #3: The spatial index should present a simple API for its basic functionality. In other words it shoud have a method that accepts a rectangle or envelope and returns a list of the geometries that are contained or intersected by that argument. What do you guys think? Am I missing anything? Scott Huey P.S. - Do you guys have a class template I can use for lib2geom? If not, could I make one? |