Exemplo n.º 1
0
 public List<Feature> FilterFeatureCollection(Extent ext)
 {
     var filteredFeatures = new List<Feature>();
     foreach (var f in features)
     {
         var envelope = f.GetEnvelope();
         if (envelope.Intersects(ext))
         {
             filteredFeatures.Add(f);
         }
     }
     return filteredFeatures;
 }
 public static Geometry ToLatLon(this Geometry geometry)
 {
     Geometry result = null;
     if (geometry is Extent)
     {
         var extent = (Extent) geometry;
         var resultExtent = new Extent();
         var lo = Projections.MercatorToLatLon(extent.xmin, extent.ymin);
         var rb = Projections.MercatorToLatLon(extent.xmax, extent.ymax);
         resultExtent.xmin = (float)lo.Longitude;
         resultExtent.ymin = (float)lo.Latitude;
         resultExtent.xmax = (float)rb.Longitude;
         resultExtent.ymax = (float)rb.Latitude;
         result = resultExtent;
     }
     return result;
 }