GetGeometriesInView() public méthode

Returns geometries whose bounding box intersects 'bbox'

Please note that this method doesn't guarantee that the geometries returned actually intersect 'bbox', but only that their boundingbox intersects 'bbox'.

This method is much faster than the QueryFeatures method, because intersection tests are performed on objects simplifed by their boundingbox, and using the Spatial Index.

public GetGeometriesInView ( SharpMap bbox ) : List
bbox SharpMap
Résultat List
Exemple #1
0
 public void TestTwoOpenClose()
 {
     ///Simulates two threads using the same provider at the same time..
     var provider = new ShapeFile(TestDataPath, false, true);
     provider.Open();
     provider.Open();
     provider.GetGeometriesInView(GetRandomEnvelope());
     provider.Close();
     provider.GetGeometriesInView(GetRandomEnvelope());
     provider.Close();
 }
Exemple #2
0
 public void TestTwoThreadsUsingDifferentProviders()
 {
     var provider1 = new ShapeFile(TestDataPath, false, true);
     var provider2 = new ShapeFile(TestDataPath, false, true);
     provider1.Open();
     provider2.Open();
     provider1.GetGeometriesInView(GetRandomEnvelope());
     provider1.Close();
     provider2.GetGeometriesInView(GetRandomEnvelope());
     provider2.Close();
 }
        private Collection<IGeometry> GetBorders()
        {
            Collection<IGeometry> stateBorders;
            using (ShapeFile shapefile = new ShapeFile (ShpFileName)) {
                shapefile.Open ();

                // Get extents, assign to svg "viewbox" attribute.
                Envelope bbox = shapefile.GetExtents ();
                stateBorders = shapefile.GetGeometriesInView (bbox);

                shapefile.Close ();
            }
            return stateBorders;
        }