예제 #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
파일: WKBTests.cs 프로젝트: cugkgq/Project
        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));
 }