Beispiel #1
0
        /// <summary>
        /// Returns the features that intersects with 'geom'
        /// </summary>
        /// <param name="geom">Geometry</param>
        /// <returns>FeatureDataTable</returns>
        public FeatureDataTable ExecuteIntersectionQuery(Geometry geom)
        {
            FeatureDataSet fds = new FeatureDataSet();

            ExecuteIntersectionQuery(geom, fds);
            return(fds.Tables[0]);
        }
Beispiel #2
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>
        public void ExecuteIntersectionQuery(Geometry geom, FeatureDataSet ds)
        {
            OgrGeometry ogrGeometry = OgrGeometry.CreateFromWkb(GeometryToWKB.Write(geom));

            _ogrLayer.SetSpatialFilter(ogrGeometry);
            ExecuteIntersectionQuery(ds);
        }
Beispiel #3
0
            public void EndGeometry()
            {
                GeometryType type = _CurrentType.Peek();

                switch (type)
                {
                case GeometryType.Polygon:
                    if (_Figures.Count > 0)
                    {
                        var g = new SmGeometries.Polygon(
                            (SmGeometries.LinearRing)_Figures[0],
                            _Figures.Skip(1).Cast <SmGeometries.LinearRing>().ToList <SmGeometries.LinearRing>()
                            );
                        _Figures = new SmGeometries.Geometry[] { g };
                    }
                    else
                    {
                        _Figures = new SmGeometries.Geometry[] { new SmGeometries.Polygon() }
                    };
                    break;
                }

                _CurrentType.Pop();

                if (_CurrentType.Count == 0)
                {
                    _Figures[0].SpatialReference = CoordinateSystemUtils.Convert(_SpatialReference);
                }
            }
Beispiel #4
0
        public static ImageMapFeatureElement CreateImageMapElement(SharpMap.Geometries.Geometry geom, SharpMap.Map map, ImageMapStyle mapStyle)
        {
            if (!mapStyle.Enabled)
            {
                return(null);
            }

            if (geom as Polygon != null &&
                mapStyle.Polygon.Enabled &&
                map.Zoom > mapStyle.Polygon.MinVisible &&
                map.Zoom < mapStyle.Polygon.MaxVisible)
            {
                return(new ImageMapPolygon(geom, map));
            }
            else if (geom as LineString != null &&
                     mapStyle.Line.Enabled &&
                     map.Zoom > mapStyle.Line.MinVisible &&
                     map.Zoom < mapStyle.Line.MaxVisible)
            {
                return(new ImageMapLine(geom, map, mapStyle));
            }
            else if (geom as SharpMap.Geometries.Point != null &&
                     mapStyle.Point.Enabled &&
                     map.Zoom > mapStyle.Point.MinVisible &&
                     map.Zoom < mapStyle.Point.MaxVisible)
            {
                return(new ImageMapPoint(geom, map, mapStyle));
            }
            return(null);
        }
Beispiel #5
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));
 }
Beispiel #6
0
        /// <summary>
        /// Returns geometries within the specified bounding box
        /// </summary>
        /// <param name="bbox"></param>
        /// <returns></returns>
        public Collection <Geometry> GetGeometriesInView(BoundingBox bbox)
        {
            Collection <Geometry> geoms = new Collection <Geometry>();

            _ogrLayer.SetSpatialFilterRect(bbox.Left, bbox.Bottom, bbox.Right, bbox.Top);
            _ogrLayer.ResetReading();

            try
            {
                OgrFeature ogrFeature;
                while ((ogrFeature = _ogrLayer.GetNextFeature()) != null)
                {
                    Geometry geom = ParseOgrGeometry(ogrFeature.GetGeometryRef());
                    if (geom != null)
                    {
                        geoms.Add(geom);
                    }
                    ogrFeature.Dispose();
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }

            return(geoms);
        }
Beispiel #7
0
        public ImageMapLine(SharpMap.Geometries.Geometry geom, SharpMap.Map map, ImageMapStyle mapStyle)
            : base(geom, map)
        {
            PointF[] transLine = (geom as LineString).TransformToImage(map);
            map.MapTransform.TransformPoints(transLine);

            List <PointF> tempPoly = new List <PointF>();

            for (int i = 0; i < transLine.Length; i++)
            {
                PointF p = transLine[i];
                tempPoly.Add(new System.Drawing.PointF((p.X - mapStyle.Line.BufferWidth), (p.Y + mapStyle.Line.BufferWidth)));
                tempPoly.Add(new System.Drawing.PointF((p.X + mapStyle.Line.BufferWidth), (p.Y + mapStyle.Line.BufferWidth)));
            }

            for (int i = transLine.Length - 1; i > -1; i--)
            {
                PointF p = transLine[i];
                tempPoly.Add(new System.Drawing.PointF((p.X - mapStyle.Line.BufferWidth), (p.Y - mapStyle.Line.BufferWidth)));
                tempPoly.Add(new System.Drawing.PointF((p.X + mapStyle.Line.BufferWidth), (p.Y - mapStyle.Line.BufferWidth)));
            }

            if (!tempPoly[0].Equals(tempPoly[tempPoly.Count - 1]))
            {
                tempPoly.Add(tempPoly[0]);
            }

            PointF[] tp = tempPoly.ToArray();
            tp = ImageMapUtilities.ClipPolygon(tp, map.Size.Width, map.Size.Height);
            foreach (PointF pf in tp)
            {
                coords.Add(pf);
            }
        }
            public void EndFigure()
            {
                GeometryType type=_CurrentType.Peek();
                switch (type)
                {
                case GeometryType.GeometryCollection:
                    {
                        var g=new SmGeometries.GeometryCollection();
                        g.Collection=_Figures;
                        _Figures=new SmGeometries.Geometry[] { g };
                    }
                    break;
                case GeometryType.LineString:
                    _Figures.Add(new SmGeometries.LineString(_CurrentPoints));
                    break;
                case GeometryType.MultiLineString:
                    {
                        var g=new SmGeometries.MultiLineString();
                        g.LineStrings=_Figures.Cast<SmGeometries.LineString>().ToList<SmGeometries.LineString>();
                        _Figures=new SmGeometries.Geometry[] { g };
                    }
                    break;
                case GeometryType.MultiPoint:
                    {
                        var g=new SmGeometries.MultiPoint();
                        g.Points=_Figures.Cast<SmGeometries.Point>().ToList<SmGeometries.Point>();
                        _Figures=new SmGeometries.Geometry[] { g };
                    }
                    break;
                case GeometryType.MultiPolygon:
                    {
                        var g=new SmGeometries.MultiPolygon();
                        g.Polygons=_Figures.Cast<SmGeometries.Polygon>().ToList<SmGeometries.Polygon>();
                        _Figures=new SmGeometries.Geometry[] { g };
                    }
                    break;
                case GeometryType.Point:
                    if (_CurrentPoints.Count>0)
                        _Figures.Add(_CurrentPoints[0]);
                    else
                        _Figures.Add(new SmGeometries.Point());
                    break;
                case GeometryType.Polygon:
                    _Figures.Add(new SmGeometries.LinearRing(_CurrentPoints));
                    break;
                default:
                    throw new NotSupportedException(
                        string.Format(
                            CultureInfo.CurrentCulture,
                            SR.UnsupportedGeometryTypeException,
                            type
                        )
                    );
                }

                _CurrentPoints.Clear();
            }
Beispiel #9
0
 public void ExecuteIntersectionQuery(SharpMap.Geometries.Geometry geom, FeatureDataSet ds)
 {
     if (_LabelInfo == null)
     {
         return;
     }
     ds.Tables.Add(_LabelInfo);
     // Destroy internal reference
     _LabelInfo = null;
 }
Beispiel #10
0
        /// <summary>Creates a new instance of the <see cref="SharpGeometry" /> class.</summary>
        /// <param name="geometry">The <see cref="SmGeometries.Geometry" /> to encapsulate.
        /// Its spatial reference must be initialized. </param>
        /// <exception cref="ArgumentNullException">
        ///  <para>The <paramref name="geometry" /> is <c>null</c>.</para>
        /// </exception>
        /// <exception cref="ArgumentException">
        ///   <para>The spatial reference of the specified <paramref name="geometry" /> was
        /// not initialized.</para>
        /// </exception>
        public SharpGeometry(SmGeometries.Geometry geometry)
        {
            Debug.Assert(geometry != null);
            if (geometry == null)
            {
                throw new ArgumentNullException("geometry");
            }
            Debug.Assert(geometry.SpatialReference != null);
            if (geometry.SpatialReference == null)
            {
                throw new ArgumentException(SR.SharpMapSpatialReferenceMustBeInitializedException, "geometry");
            }

            _Geometry = geometry;
        }
Beispiel #11
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="geom"></param>
        /// <param name="ds"></param>
        public void ExecuteIntersectionQuery(Geometry geom, FeatureDataSet ds)
        {
            GeoAPI.Geometries.IGeometry geometry  = GeometryConverter.ToNTSGeometry(geom, _geometryFactory);
            FeatureDataTable            dataTable = CreateFeatureDataTable();

            foreach (Feature feature in _features)
            {
                if (feature.Geometry.Intersects(geometry))
                {
                    CreateNewRow(dataTable, feature);
                }
            }

            ds.Tables.Add(dataTable);
        }
Beispiel #12
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="geom"></param>
        /// <param name="ds"></param>
        public void ExecuteIntersectionQuery(Geometry geom, FeatureDataSet ds)
        {
            GisSharpBlog.NetTopologySuite.Geometries.Geometry geometry = GeometryConverter.ToNTSGeometry(geom,
                                                                                                         geometryFactory);
            FeatureDataTable dataTable = CreateFeatureDataTable();

            foreach (Feature feature in features)
            {
                if (feature.Geometry.Intersects(geometry))
                {
                    CreateNewRow(dataTable, feature);
                }
            }

            ds.Tables.Add(dataTable);
        }
Beispiel #13
0
        public ImageMapPolygon(SharpMap.Geometries.Geometry geom, SharpMap.Map map)
            : base(geom, map)
        {
            PointF[] transRing = (geom as Polygon).ExteriorRing.TransformToImage(map);
            map.MapTransform.TransformPoints(transRing);


            for (int i = 0; i < transRing.Length; i++)
            {
                coords.Add(transRing[i]);
            }

            if (coords.Count > 0 && !coords[0].Equals(coords[coords.Count - 1]))
            {
                coords.Add(coords[0]);
            }
        }
Beispiel #14
0
 private static Geometry ParseOgrGeometry(OgrGeometry ogrGeometry)
 {
     if (ogrGeometry != null)
     {
         //Just in case it isn't 2D
         ogrGeometry.FlattenTo2D();
         byte[] wkbBuffer = new byte[ogrGeometry.WkbSize()];
         ogrGeometry.ExportToWkb(wkbBuffer);
         Geometry geom = GeometryFromWKB.Parse(wkbBuffer);
         if (geom == null)
         {
             Debug.WriteLine(string.Format("Failed to parse '{0}'", ogrGeometry.GetGeometryType()));
         }
         return(geom);
     }
     return(null);
 }
Beispiel #15
0
        private static void _PopulateSimpleType(IGeometrySink sink, SmGeometries.Geometry geometry)
        {
            sink.BeginGeometry(GeometryTypeUtils.Convert(geometry.GeometryType));

            switch (geometry.GeometryType)
            {
            case SmGeometries.GeometryType2.LineString:
                CreateFigure(sink, ((SmGeometries.LineString)geometry).Vertices);
                break;

            case SmGeometries.GeometryType2.Point:
                CreateFigure(sink, new SmGeometries.Point[] { (SmGeometries.Point)geometry });
                break;

            case SmGeometries.GeometryType2.Polygon:
            {
                var pol = (SmGeometries.Polygon)geometry;
                CreateFigure(sink, pol.ExteriorRing.Vertices);

                if (pol.InteriorRings != null)
                {
                    foreach (SmGeometries.LinearRing lr in pol.InteriorRings)
                    {
                        CreateFigure(sink, lr.Vertices);
                    }
                }
            }
            break;

            default:
                throw new NotSupportedException(
                          string.Format(
                              CultureInfo.CurrentCulture,
                              SR.UnsupportedGeometryTypeException,
                              geometry.GeometryType
                              )
                          );
            }

            sink.EndGeometry();
        }
Beispiel #16
0
 /// <summary>
 /// Returns true if this <see cref="BoundingBox"/> intersects the geometry
 /// </summary>
 /// <param name="g">Geometry</param>
 /// <returns>True if intersects</returns>
 public bool Intersects(Geometry g)
 {
     return Touches(g);
 }
Beispiel #17
0
            public void EndFigure()
            {
                GeometryType type = _CurrentType.Peek();

                switch (type)
                {
                case GeometryType.GeometryCollection:
                {
                    var g = new SmGeometries.GeometryCollection();
                    g.Collection = _Figures;
                    _Figures     = new SmGeometries.Geometry[] { g };
                }
                break;

                case GeometryType.LineString:
                    _Figures.Add(new SmGeometries.LineString(_CurrentPoints));
                    break;

                case GeometryType.MultiLineString:
                {
                    var g = new SmGeometries.MultiLineString();
                    g.LineStrings = _Figures.Cast <SmGeometries.LineString>().ToList <SmGeometries.LineString>();
                    _Figures      = new SmGeometries.Geometry[] { g };
                }
                break;

                case GeometryType.MultiPoint:
                {
                    var g = new SmGeometries.MultiPoint();
                    g.Points = _Figures.Cast <SmGeometries.Point>().ToList <SmGeometries.Point>();
                    _Figures = new SmGeometries.Geometry[] { g };
                }
                break;

                case GeometryType.MultiPolygon:
                {
                    var g = new SmGeometries.MultiPolygon();
                    g.Polygons = _Figures.Cast <SmGeometries.Polygon>().ToList <SmGeometries.Polygon>();
                    _Figures   = new SmGeometries.Geometry[] { g };
                }
                break;

                case GeometryType.Point:
                    if (_CurrentPoints.Count > 0)
                    {
                        _Figures.Add(_CurrentPoints[0]);
                    }
                    else
                    {
                        _Figures.Add(new SmGeometries.Point());
                    }
                    break;

                case GeometryType.Polygon:
                    _Figures.Add(new SmGeometries.LinearRing(_CurrentPoints));
                    break;

                default:
                    throw new NotSupportedException(
                              string.Format(
                                  CultureInfo.CurrentCulture,
                                  SR.UnsupportedGeometryTypeException,
                                  type
                                  )
                              );
                }

                _CurrentPoints.Clear();
            }
Beispiel #18
0
 /// <summary>
 /// Returns true if this <see cref="BoundingBox"/> touches the geometry
 /// </summary>
 /// <param name="s">Geometry</param>
 /// <returns>True if touches</returns>
 public bool Touches(Geometry s)
 {
     if (s is Point) return Touches(s as Point);
     throw new NotImplementedException("Touches: Not implemented on this geometry type");
 }
Beispiel #19
0
 public FeatureDataTable QueryFeatures(Geometry geom, double distance)
 {
     throw new NotSupportedException();
 }
Beispiel #20
0
 /// <summary>
 /// Returns the features that intersects with 'geom'
 /// </summary>
 /// <param name="geom">Geometry</param>
 /// <returns>FeatureDataTable</returns>
 public FeatureDataTable ExecuteIntersectionQuery(Geometry geom)
 {
     FeatureDataSet fds = new FeatureDataSet();
     ExecuteIntersectionQuery(geom, fds);
     return fds.Tables[0];
 }
Beispiel #21
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>
 public void ExecuteIntersectionQuery(Geometry geom, FeatureDataSet ds)
 {
     OgrGeometry ogrGeometry = OgrGeometry.CreateFromWkb(GeometryToWKB.Write(geom));
     _ogrLayer.SetSpatialFilter(ogrGeometry);
     ExecuteIntersectionQuery(ds);
 }
Beispiel #22
0
        public void RenderLayer(ILabelLayer layer, Map map, Graphics g)
        {
            if (layer.Style.Enabled &&
                layer.Style.MaxVisible >= map.Zoom &&
                layer.Style.MinVisible < map.Zoom)
            {
                if (layer.DataSource == null)
                {
                    throw (new ApplicationException("DataSource property not set on layer '" + layer.LayerName + "'"));
                }

                g.TextRenderingHint = layer.TextRenderingHint;
                g.SmoothingMode     = layer.SmoothingMode;

                SharpMap.Geometries.BoundingBox envelope = map.Envelope; //View to render
                if (layer.CoordinateTransformation != null)
                {
                    envelope = GeometryTransform.TransformBox(envelope, layer.CoordinateTransformation.MathTransform.Inverse());
                }

                FeatureDataSet ds = new FeatureDataSet();
                layer.DataSource.Open();
                layer.DataSource.ExecuteIntersectionQuery(envelope, ds);
                layer.DataSource.Close();
                if (ds.Tables.Count == 0)
                {
                    //base.Render(g, map);
                    return;
                }
                FeatureDataTable features = (FeatureDataTable)ds.Tables[0];

                //Initialize label collection
                List <Label> labels = new List <Label>();
                LabelLayer.GetLabelMethod lblDelegate = layer.LabelStringDelegate;

                //List<System.Drawing.Rectangle> LabelBoxes; //Used for collision detection
                //Render labels
                for (int i = 0; i < features.Count; i++)
                {
                    FeatureDataRow feature = features[i];
                    if (layer.CoordinateTransformation != null)
                    {
                        features[i].Geometry = GeometryTransform.TransformGeometry(features[i].Geometry, layer.CoordinateTransformation.MathTransform);
                    }

                    ILabelStyle style = null;
                    if (layer.Theme != null) //If thematics is enabled, lets override the style
                    {
                        style = layer.Theme.GetStyle(feature);
                    }
                    else
                    {
                        style = layer.Style;
                    }

                    float rotation = 0;
                    if (!String.IsNullOrEmpty(layer.RotationColumn))
                    {
                        float.TryParse(feature[layer.RotationColumn].ToString(), NumberStyles.Any, Map.numberFormat_EnUS, out rotation);
                    }

                    string text;
                    if (lblDelegate != null)
                    {
                        text = lblDelegate(feature);
                    }
                    else
                    {
                        text = feature[layer.LabelColumn].ToString();
                    }

                    if (text != null && text != String.Empty)
                    {
                        if (feature.Geometry is GeometryCollection)
                        {
                            if (layer.MultipartGeometryBehaviour == SharpMap.Layers.LabelLayer.MultipartGeometryBehaviourEnum.All)
                            {
                                foreach (SharpMap.Geometries.Geometry geom in (feature.Geometry as GeometryCollection))
                                {
                                    SharpMap.Rendering.Label lbl = CreateLabel(layer, geom, text, rotation, style, map, g);
                                    if (lbl != null)
                                    {
                                        labels.Add(lbl);
                                    }
                                }
                            }
                            else if (layer.MultipartGeometryBehaviour == SharpMap.Layers.LabelLayer.MultipartGeometryBehaviourEnum.CommonCenter)
                            {
                                Label lbl = CreateLabel(layer, feature.Geometry, text, rotation, style, map, g);
                                if (lbl != null)
                                {
                                    labels.Add(lbl);
                                }
                            }
                            else if (layer.MultipartGeometryBehaviour == SharpMap.Layers.LabelLayer.MultipartGeometryBehaviourEnum.First)
                            {
                                if ((feature.Geometry as GeometryCollection).Collection.Count > 0)
                                {
                                    SharpMap.Rendering.Label lbl = CreateLabel(layer, (feature.Geometry as GeometryCollection).Collection[0], text, rotation, style, map, g);
                                    if (lbl != null)
                                    {
                                        labels.Add(lbl);
                                    }
                                }
                            }
                            else if (layer.MultipartGeometryBehaviour == SharpMap.Layers.LabelLayer.MultipartGeometryBehaviourEnum.Largest)
                            {
                                GeometryCollection coll = (feature.Geometry as GeometryCollection);
                                if (coll.NumGeometries > 0)
                                {
                                    double largestVal   = 0;
                                    int    idxOfLargest = 0;
                                    for (int j = 0; j < coll.NumGeometries; j++)
                                    {
                                        SharpMap.Geometries.Geometry geom = coll.Geometry(j);
                                        if (geom is Geometries.LineString && ((Geometries.LineString)geom).Length > largestVal)
                                        {
                                            largestVal   = ((Geometries.LineString)geom).Length;
                                            idxOfLargest = j;
                                        }
                                        if (geom is Geometries.MultiLineString && ((Geometries.MultiLineString)geom).Length > largestVal)
                                        {
                                            largestVal   = ((Geometries.LineString)geom).Length;
                                            idxOfLargest = j;
                                        }
                                        if (geom is Geometries.Polygon && ((Geometries.Polygon)geom).Area > largestVal)
                                        {
                                            largestVal   = ((Geometries.Polygon)geom).Area;
                                            idxOfLargest = j;
                                        }
                                        if (geom is Geometries.MultiPolygon && ((Geometries.MultiPolygon)geom).Area > largestVal)
                                        {
                                            largestVal   = ((Geometries.MultiPolygon)geom).Area;
                                            idxOfLargest = j;
                                        }
                                    }

                                    SharpMap.Rendering.Label lbl = CreateLabel(layer, coll.Geometry(idxOfLargest), text, rotation, style, map, g);
                                    if (lbl != null)
                                    {
                                        labels.Add(lbl);
                                    }
                                }
                            }
                        }
                        else
                        {
                            SharpMap.Rendering.Label lbl = CreateLabel(layer, feature.Geometry, text, rotation, style, map, g);
                            if (lbl != null)
                            {
                                labels.Add(lbl);
                            }
                        }
                    }
                }
                if (labels.Count > 0) //We have labels to render...
                {
                    if (layer.Style.CollisionDetection && layer.LabelFilter != null)
                    {
                        layer.LabelFilter(labels);
                    }
                    for (int i = 0; i < labels.Count; i++)
                    {
                        VectorRenderer.DrawLabel(g, labels[i].LabelPoint, labels[i].Style.Offset, labels[i].Style.Font, labels[i].Style.ForeColor, labels[i].Style.BackColor, layer.Style.Halo, labels[i].Rotation, labels[i].Text, map);
                    }
                }
                labels = null;
            }
            //base.Render(g, map);
        }
Beispiel #23
0
 /// <summary>
 /// Returns true if this instance contains the geometry
 /// </summary>
 /// <param name="s"><see cref="BoundingBox"/></param>
 /// <returns>True it contains</returns>
 public bool Contains(Geometry s)
 {
     if (s is Point) return Contains(s as Point);
     throw new NotImplementedException("Contains: Not implemented on these geometries");
 }
            public void EndGeometry()
            {
                GeometryType type=_CurrentType.Peek();
                switch (type)
                {
                case GeometryType.Polygon:
                    if (_Figures.Count>0)
                    {
                        var g=new SmGeometries.Polygon(
                            (SmGeometries.LinearRing)_Figures[0],
                            _Figures.Skip(1).Cast<SmGeometries.LinearRing>().ToList<SmGeometries.LinearRing>()
                        );
                        _Figures=new SmGeometries.Geometry[] { g };
                    } else
                        _Figures=new SmGeometries.Geometry[] { new SmGeometries.Polygon() };
                    break;
                }

                _CurrentType.Pop();

                if (_CurrentType.Count==0)
                    _Figures[0].SpatialReference=CoordinateSystemUtils.Convert(_SpatialReference);
            }
Beispiel #25
0
 public IFeatureDataReader ExecuteIntersectionQuery(Geometry geom)
 {
     throw new NotImplementedException();
 }
Beispiel #26
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>
 public void ExecuteIntersectionQuery(Geometry geom, FeatureDataSet ds)
 {
     throw new NotImplementedException();
 }
Beispiel #27
0
 /// <summary>
 /// Returns a geometry that represents the point set symmetric difference of this Geometry with anotherGeometry.
 /// </summary>
 /// <param name="geom">Geometry to compare to</param>
 /// <returns>Geometry</returns>
 public override Geometry SymDifference(Geometry geom)
 {
     throw new NotImplementedException();
 }
Beispiel #28
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="geom"></param>
        /// <param name="ds"></param>
        public void ExecuteIntersectionQuery(Geometry geom, FeatureDataSet ds)
        {
            GeoAPI.Geometries.IGeometry geometry = GeometryConverter.ToNTSGeometry(geom, _geometryFactory);
            FeatureDataTable dataTable = CreateFeatureDataTable();

            foreach (Feature feature in _features)
                if (feature.Geometry.Intersects(geometry))
                    CreateNewRow(dataTable, feature);

            ds.Tables.Add(dataTable);
        }
Beispiel #29
0
 /// <summary>
 /// Returns true if this instance contains 'geom'
 /// </summary>
 /// <param name="geom">Geometry</param>
 /// <returns>True if geom is contained by this instance</returns>
 public override bool Contains(Geometry geom)
 {
     return(false);
 }
Beispiel #30
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="geom"></param>
        /// <param name="ds"></param>
        public void ExecuteIntersectionQuery(Geometry geom, FeatureDataSet ds)
        {
            GisSharpBlog.NetTopologySuite.Geometries.Geometry geometry = GeometryConverter.ToNTSGeometry(geom,
                                                                                                         geometryFactory);
            FeatureDataTable dataTable = CreateFeatureDataTable();

            foreach (Feature feature in features)
                if (feature.Geometry.Intersects(geometry))
                    CreateNewRow(dataTable, feature);

            ds.Tables.Add(dataTable);
        }
Beispiel #31
0
 public FeatureDataTable QueryFeatures(Geometry geom, double distance)
 {
     throw new NotSupportedException();
 }
Beispiel #32
0
 /// <summary>
 /// Returns a geometry that represents the point set union of this Geometry with anotherGeometry.
 /// </summary>
 /// <param name="geom">Geometry to union with</param>
 /// <returns>Unioned geometry</returns>
 public override Geometry Union(Geometry geom)
 {
     throw new NotImplementedException();
 }
Beispiel #33
0
 /// <summary>Converts the specified <paramref name="geometry" /> into a <see cref="SharpGeometry" />.</summary>
 /// <param name="geometry">The geometry to convert.</param>
 /// <returns>The converted geometry.</returns>
 public static SharpGeometry ToSharpGeometry(SmGeometries.Geometry geometry)
 {
     return(new SharpGeometry(geometry));
 }