com.bbn.openmap.dataAccess.shape
Class ShapeGeoIndex

java.lang.Object
  extended by java.util.AbstractCollection
      extended by com.bbn.openmap.geo.ExtentIndex.AbstractExtentIndex
          extended by com.bbn.openmap.geo.ExtentIndex.ArrayListExtentIndexImpl
              extended by com.bbn.openmap.dataAccess.shape.ShapeGeoIndex
All Implemented Interfaces:
ExtentIndex, java.lang.Iterable, java.util.Collection

public class ShapeGeoIndex
extends ExtentIndex.ArrayListExtentIndexImpl

A GeoExtentIndex that knows how to work with Shape files. Plots the shape file contents in memory in lat/lon space, can then be used with the Intersection class to do spatial analysis on the shape file contents.

Author:
ddietrick

Nested Class Summary
static class ShapeGeoIndex.Builder
          Use this class to create a ShapeGeoIndex.
 
Nested classes/interfaces inherited from interface com.bbn.openmap.geo.ExtentIndex
ExtentIndex.AbstractExtentIndex, ExtentIndex.ArrayListExtentIndexImpl, ExtentIndex.HashSetExtentIndexImpl
 
Field Summary
protected  java.util.HashMap<java.lang.Object,OMGraphic> omgraphics
           
 
Fields inherited from class com.bbn.openmap.geo.ExtentIndex.AbstractExtentIndex
all, buckets, D_MARGIN, D_NBUCKETS, discarded, margin, nbuckets, polar
 
Method Summary
 OMGraphic getForID(java.lang.Object id)
          After you test for intersections with some GeoExtent, you get an iterator of GeoExtents.
 java.util.Iterator getIntersections(GeoExtent extent)
          Get an iterator with all of the objects in this ShapeGeoIndex that intersect with the given extent.
 java.util.Iterator getIntersections(GeoExtent extent, MatchFilter filter, MatchCollector collector)
          Get an iterator with all of the objects in this ShapeGeoIndex that intersect with the given extent.
 void load(EsriGraphicList list)
           
 
Methods inherited from class com.bbn.openmap.geo.ExtentIndex.ArrayListExtentIndexImpl
makeBucket
 
Methods inherited from class com.bbn.openmap.geo.ExtentIndex.AbstractExtentIndex
add, addExtent, bucketFor, clear, indexHorizontalRange, iterator, iterator, lookup, lookup, lookupByBoundingCircle, lookupByPath, lookupBySegment, makeBucket, normalizeLon, normalizeLons, removeExtent, size, toString
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
addAll, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Field Detail

omgraphics

protected java.util.HashMap<java.lang.Object,OMGraphic> omgraphics
Method Detail

getForID

public OMGraphic getForID(java.lang.Object id)
After you test for intersections with some GeoExtent, you get an iterator of GeoExtents. You can get the ID from each of those, which will in turn allow you to ask for the OMGraphic representing the shape from the given file. The ID is an integer index into the shape file and attribute dbf file, btw.

Parameters:
id - The id provided by the extent in the intersection test.
Returns:
OMGraphic or null (if not found).

load

public void load(EsriGraphicList list)

getIntersections

public java.util.Iterator getIntersections(GeoExtent extent)
Get an iterator with all of the objects in this ShapeGeoIndex that intersect with the given extent.

Parameters:
extent - GeoExtent (GeoPoint, GeoPath, GeoRegion) to test against.
Returns:
Iterator over intersecting shape objects.

getIntersections

public java.util.Iterator getIntersections(GeoExtent extent,
                                           MatchFilter filter,
                                           MatchCollector collector)
Get an iterator with all of the objects in this ShapeGeoIndex that intersect with the given extent.

Parameters:
extent - GeoExtext (GeoPoint, GeoPath, GeoRegion) to test against.
filter - MatchFilter a MatchFilter can eliminate
collector -
Returns:
Iterator over intersecting shape objects.


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details