/// <summary> /// Returns the data associated with all the geometries that are intersected by 'geom' /// </summary> /// <param name="geom">Geometry to intersect with</param> /// <param name="ds">FeatureDataSet to fill data into</param> protected override void OnExecuteIntersectionQuery(Geometry geom, FeatureDataSet ds) { OgrGeometry ogrGeometry = OgrGeometry.CreateFromWkb(GeometryToWKB.Write(geom)); _ogrLayer.SetSpatialFilter(ogrGeometry); ExecuteIntersectionQuery(ds); }
/// <summary> /// Converts an SharpMap Geometry to a FDO geometry /// </summary> /// <param name="geom">The SharpMap geometry</param> /// <returns></returns> public static FdoGeometry ToFdoGeometry(Sm.Geometry geom) { //Get the WKB form of the geometry byte[] wkb = GeometryToWKB.Write(geom); Fdo.IGeometry fg = FdoGeometryFactory.Instance.CreateGeometryFromWkb(wkb); return(new FdoGeometry(fg)); }
/// <summary> /// Returns the data associated with all the geometries that are intersected by 'geom' /// </summary> /// <param name="geom">Geometry to intersect with</param> /// <param name="ds">FeatureDataSet to fill data into</param> protected override void OnExecuteIntersectionQuery(Geometry geom, FeatureDataSet ds) { using (var ogrGeometry = OgrGeometry.CreateFromWkb(GeometryToWKB.Write(geom))) { OgrDataSource ogrDataSource; using (var ogrLayer = GetLayer(_layerIndex, out ogrDataSource)) { ogrLayer.SetSpatialFilter(ogrGeometry); ExecuteIntersectionQuery(ds, ogrLayer); ogrDataSource.Dispose(); } } }
private Geometry ToBinaryAndBack(Geometry gIn, WkbByteOrder byteOrder) { MemoryStream stream = new MemoryStream(); BinaryWriter writer = new BinaryWriter(stream); writer.Write(GeometryToWKB.Write(gIn, byteOrder)); BinaryReader reader = new BinaryReader(stream); stream.Position = 0; Geometry gOut = GeometryFromWKB.Parse(reader); return(gOut); }
/// <summary> /// Returns the data associated with all the geometries that are intersected by 'geom' /// </summary> /// <param name="geom">Geometry to intersect with</param> /// <param name="ds">FeatureDataSet to fill data into</param> protected override void OnExecuteIntersectionQuery(Geometry geom, IFeatureCollectionSet fcs, CancellationToken?ct = null) { using (var ogrGeometry = OgrGeometry.CreateFromWkb(GeometryToWKB.Write(geom))) { _ogrLayer.SetSpatialFilter(ogrGeometry); var fds = new FeatureDataSet(); ExecuteIntersectionQuery(fds); foreach (var fd in fds) { fcs.Add(fd); } } }
public byte[] AsBinary() { return(GeometryToWKB.Write(this)); }
public new byte[] AsBinary() { return(GeometryToWKB.Write(Envelope)); }