/** * Adds the given {@link Feature} instance and updates the index structures. * * @param features * feature to be added, must not be <code>null</code> and must have an id (as well as every geometry) */ void addFeature( Feature feature ) { FeatureType ft = feature.getType(); FeatureCollection fc = ftToFeatures.get( ft ); if ( fc == null ) { fc = new GenericFeatureCollection(); ftToFeatures.put( ft, fc ); } fc.add( feature ); idToObject.put( feature.getId(), feature ); if ( feature.getEnvelope() != null ) { RTree<Feature> rTree = ftToIndex.get( ft ); float[] insertBox = toFloats( feature.getEnvelope() ); if ( rTree == null ) { rTree = new RTree<Feature>( insertBox, 16 ); } rTree.insert( insertBox, feature ); } }
insert( orphaned.bbox, orphaned.entryValue );