/** * Constructs a spatial index * * @param store * Feature store whose contents to index */ public SimpleSpatialIndex(FeatureStore _store) { store = _store; if (store != null) { buildIndex(); } }
/** * Constructs a feature cursor * * @param oids * Object IDs of features over which to iterate * @param store * Feature store from which to read the Feature data * @param search_extent * Search extent that was used to generate the list of OIDs in this * cursor - this is used to refine the list of Features actually * returned from the cursor * @param match_exactly * True to only return Feature instances that "exactly" match the * original search criteria. When querying a FeatureStore by spatial * extent (GeoExtent), the store will actually return a FeatureCursor * corresponding to all features whose bounding extents intersect the * search extent; i.e. it does not test down to the shape level. Passing * true to this parameter will perform shape-level intersection testing * when using this cursor. */ public FeatureCursor( FeatureOIDList _oids, FeatureStore _store, GeoExtent _search_extent, bool _match_exactly) { oids = _oids; store = _store; search_extent = _search_extent; match_exactly = _match_exactly; prefetch_size = DEFAULT_PREFETCH_SIZE; at_bof = false; reset(); }
/** * Creates a feature layer by connecting to a feature store. * * @param uri * URI of the feature store to use as the underlying data * source for this layer. * @return * A new feature layer. Caller is responsible for deleting * the return object. */ public FeatureLayer createFeatureLayer(string uri) { FeatureLayer result = null; if (getFeatureStoreFactory() != null) { FeatureStore store = getFeatureStoreFactory().connectToFeatureStore(uri); if (store != null && store.isReady()) { result = new FeatureLayer(store); #if TODO // if the store doesn't provide a spatial reference, try to load one from // a PRJ file: if (result != null && result.getSRS() == null) { if (osgDB.fileExists(uri)) // make sure it's a file: { string prj_file = osgDB.getNameLessExtension(uri) + ".prj"; fstream istream; istream.open(prj_file.c_str()); if (istream.is_open()) { istream.seekg(0, std.ios.end); int length = istream.tellg(); istream.seekg(0, std.ios.beg); char[] buf = new char[length]; istream.read(buf, length); istream.close(); string prj = buf; SpatialReference prj_srs = Registry.instance().getSRSFactory().createSRSfromWKT(prj); result.setSRS(prj_srs); } } } #endif } } return(result); }
/** * Construct a new R-Tree spatial instance and populate it with * the data in a feature store. * * @param store * Feature store for which to build index */ public RTreeSpatialIndex(FeatureStore store);
/** * Constructs a new FeatureLayer and builds a spatial index. * * @param store * Feature store from which this layer accesses feature data. */ public FeatureLayer(FeatureStore _store) { store = _store; }
/** * Constructs a spatial index * * @param store * Feature store whose contents to index */ public SimpleSpatialIndex(FeatureStore _store) { store = _store; if (store!=null) buildIndex(); }