/// <summary> /// Returns geometries within the specified bounding box /// </summary> /// <param name="bbox"></param> /// <returns></returns> public Collection <SharpMap.Geometries.Geometry> GetGeometriesInView(SharpMap.Geometries.BoundingBox bbox) { Collection <SharpMap.Geometries.Geometry> geoms = new Collection <SharpMap.Geometries.Geometry>(); _OgrLayer.SetSpatialFilterRect(bbox.Left, bbox.Bottom, bbox.Right, bbox.Top); OGR.Feature _OgrFeature = null; _OgrLayer.ResetReading(); while ((_OgrFeature = _OgrLayer.GetNextFeature()) != null) { geoms.Add(this.ParseOgrGeometry(_OgrFeature.GetGeometryRef())); _OgrFeature.Dispose(); } return(geoms); }
/// <summary> /// Returns the geometry corresponding to the Object ID /// </summary> /// <param name="oid">Object ID</param> /// <returns>geometry</returns> public SharpMap.Geometries.Geometry GetGeometryByID(uint oid) { using (OGR.Feature _OgrFeature = _OgrLayer.GetFeature((int)oid)) return(this.ParseOgrGeometry(_OgrFeature.GetGeometryRef())); }