public List < EsriFeature > getFeatures ( Rectangle2D bBox ) { if ( bBox == null ) return features ; List < EsriFeature > list = new ArrayList <> ( ) ; for ( EsriFeature gf : features ) { if ( gf . getBounds2D ( ) . intersects ( bBox ) ) list . add ( gf ) ; } return list ; }
Get a List of all the features in the shapefile that intersect the specified bounding box . This requires testing every feature in the List created at construction so it s faster to just give a bounding box o the constructor if you will only do this once .