示例#1
0
        /// <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);
        }
示例#2
0
 /// <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));
 }
示例#3
0
 /// <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();
         }
     }
 }
示例#4
0
        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);
        }
示例#5
0
 /// <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);
         }
     }
 }
示例#6
0
 public byte[] AsBinary()
 {
     return(GeometryToWKB.Write(this));
 }
示例#7
0
 public new byte[] AsBinary()
 {
     return(GeometryToWKB.Write(Envelope));
 }