Show
Ignore:
Timestamp:
08/17/09 10:30:44 (12 months ago)
Author:
hobu
Message:

apply brentp's latest patch and include a 4d index test case

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Rtree/trunk/tests/index.txt

    r1389 r1390  
    3838    ...     if i.id == 4321: 
    3939    ...         i.object 
    40     ...         i.bounds 
     40    ...         i.bbox 
    4141    42 
    42     [34.3776829412, 49.3776829412, 26.737585373400002, 41.737585373400002] 
     42    [34.3776829412, 26.737585373400002, 49.3776829412, 41.737585373400002] 
    4343 
    4444 
     
    6464    3 
    6565     
     66 
     67Default order is [xmin, ymin, xmax, ymax] 
    6668    >>> idx.bounds 
     69    [-186.673789279, -96.717721818399994, 184.76138755599999, 96.604369977800005] 
     70 
     71To get in order [xmin, xmax, ymin, ymax (... for n-d indexes)] use the kwarg: 
     72    >>> idx.get_bounds(coordinate_interleaved=False) 
    6773    [-186.673789279, 184.76138755599999, -96.717721818399994, 96.604369977800005] 
    6874 
     
    175181    >>> p.dimension = 3 
    176182     
    177     >>> idx3d = index.Index(properties=p) 
     183 
     184with interleaved=False, the order of input and output is:  
     185(xmin, xmax, ymin, ymax, zmin, zmax) 
     186 
     187    >>> idx3d = index.Index(properties=p, interleaved=False) 
    178188    >>> idx3d 
    179189    <rtree.index.Index object at 0x...> 
    180190     
    181     >>> idx3d.insert(1, (0, 0, 60, 60, 23.0, 42.0)) 
    182      
    183     >>> idx3d.intersection( (-1, -1, 62, 62, 22, 43)) 
     191    >>> idx3d.insert(1, (0, 0, 60, 60, 22, 22.0)) 
     192     
     193    >>> idx3d.intersection((-1, 1, 58, 62, 22, 24)) 
     194    [1L] 
     195 
     196 
     197Make a 4D index 
     198    >>> p = index.Property() 
     199    >>> p.dimension = 4 
     200     
     201 
     202with interleaved=False, the order of input and output is:  
     203(xmin, xmax, ymin, ymax, zmin, zmax, kmin, kmax) 
     204 
     205    >>> idx4d = index.Index(properties=p, interleaved=False) 
     206    >>> idx4d 
     207    <rtree.index.Index object at 0x...> 
     208     
     209    >>> idx4d.insert(1, (0, 0, 60, 60, 22, 22.0, 128, 142)) 
     210     
     211    >>> idx4d.intersection((-1, 1, 58, 62, 22, 24, 120, 150)) 
    184212    [1L] 
    185213