Exemple #1
0
        /// <summary>
        /// Gets the object IDs in the view.
        /// </summary>
        /// <param name="bbox">The bbox.</param>
        /// <returns></returns>
        public Collection <uint> GetObjectIDsInView(BoundingBox bbox)
        {
            // Identifies all the features within the given BoundingBox
            Envelope          envelope = GeometryConverter.ToNTSEnvelope(bbox);
            Collection <uint> geoms    = new Collection <uint>();

            for (int i = 0; i < _features.Count; i++)
            {
                if (envelope.Intersects(_features[i].Geometry.EnvelopeInternal))
                {
                    geoms.Add(Convert.ToUInt32(i));
                }
            }
            return(geoms);
        }
Exemple #2
0
        /// <summary>
        /// Returns features within the specified bounding box.
        /// </summary>
        /// <param name="bbox"></param>
        /// <returns></returns>
        public Collection <SharpMap.Geometries.Geometry> GetGeometriesInView(SharpMap.Geometries.BoundingBox bbox)
        {
            // Identifies all the features within the given BoundingBox
            GisSharpBlog.NetTopologySuite.Geometries.Envelope envelope = GeometryConverter.ToNTSEnvelope(bbox);
            Collection <SharpMap.Geometries.Geometry>         geoms    = new Collection <SharpMap.Geometries.Geometry>();

            foreach (GisSharpBlog.NetTopologySuite.Features.Feature feature in features)
            {
                if (envelope.Intersects(feature.Geometry.EnvelopeInternal))
                {
                    geoms.Add(GeometryConverter.ToSharpMapGeometry(feature.Geometry as GisSharpBlog.NetTopologySuite.Geometries.Geometry));
                }
            }
            return(geoms);
        }
Exemple #3
0
        /// <summary>
        /// Gets the object IDs in the view.
        /// </summary>
        /// <param name="bbox">The bbox.</param>
        /// <returns></returns>
        public List <uint> GetObjectIDsInView(SharpMap.Geometries.BoundingBox bbox)
        {
            // Identifies all the features within the given BoundingBox
            GisSharpBlog.NetTopologySuite.Geometries.Envelope envelope = GeometryConverter.ToNTSEnvelope(bbox);
            List <uint> geoms = new List <uint>(features.Count);

            for (int i = 0; i < features.Count; i++)
            {
                if (envelope.Intersects(features[i].Geometry.EnvelopeInternal))
                {
                    geoms.Add(Convert.ToUInt32(i));
                }
            }
            return(geoms);
        }
Exemple #4
0
        /// <summary>
        /// Returns features within the specified bounding box.
        /// </summary>
        /// <param name="bbox"></param>
        /// <returns></returns>
        public Collection <Geometry> GetGeometriesInView(BoundingBox bbox)
        {
            // Identifies all the features within the given BoundingBox
            Envelope envelope           = GeometryConverter.ToNTSEnvelope(bbox);
            Collection <Geometry> geoms = new Collection <Geometry>();

            foreach (Feature feature in _features)
            {
                if (envelope.Intersects(feature.Geometry.EnvelopeInternal))
                {
                    geoms.Add(
                        GeometryConverter.ToSharpMapGeometry(
                            feature.Geometry as NtsGeometry));
                }
            }
            return(geoms);
        }
Exemple #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="box"></param>
        /// <param name="ds"></param>
        public void ExecuteIntersectionQuery(SharpMap.Geometries.BoundingBox box, FeatureDataSet ds)
        {
            // Identifies all the features within the given BoundingBox
            GisSharpBlog.NetTopologySuite.Geometries.Envelope     envelope = GeometryConverter.ToNTSEnvelope(box);
            List <GisSharpBlog.NetTopologySuite.Features.Feature> results  = new List <GisSharpBlog.NetTopologySuite.Features.Feature>(features.Count);

            foreach (GisSharpBlog.NetTopologySuite.Features.Feature feature in features)
            {
                if (envelope.Intersects(feature.Geometry.EnvelopeInternal))
                {
                    results.Add(feature);
                }
            }

            // Fill DataSet
            SharpMap.Data.FeatureDataTable dataTable = CreateFeatureDataTable();
            foreach (GisSharpBlog.NetTopologySuite.Features.Feature feature in results)
            {
                CreateNewRow(dataTable, feature);
            }
            ds.Tables.Add(dataTable);
        }
Exemple #6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="box"></param>
        /// <param name="ds"></param>
        public void ExecuteIntersectionQuery(BoundingBox box, FeatureDataSet ds)
        {
            // Identifies all the features within the given BoundingBox
            Envelope       envelope = GeometryConverter.ToNTSEnvelope(box);
            List <Feature> results  = new List <Feature>(_features.Count);

            foreach (Feature feature in _features)
            {
                if (envelope.Intersects(feature.Geometry.EnvelopeInternal))
                {
                    results.Add(feature);
                }
            }

            // Fill DataSet
            FeatureDataTable dataTable = CreateFeatureDataTable();

            foreach (Feature feature in results)
            {
                CreateNewRow(dataTable, feature);
            }
            ds.Tables.Add(dataTable);
        }