• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IEnvelope类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IEnvelope的典型用法代码示例。如果您正苦于以下问题:C# IEnvelope类的具体用法?C# IEnvelope怎么用?C# IEnvelope使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IEnvelope类属于命名空间,在下文中一共展示了IEnvelope类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreateAois

        /// <summary>
        /// Takes the users large AOI and breaks it down to smaller 1x1 degree AOI's to query all information in the larger one.  
        /// </summary>
        /// <param name="env">
        /// The envelope of the large AOI
        /// </param>
        /// <returns>
        /// Returns a list of polygons that are used to query GBD.
        /// </returns>
        public static List<GbdPolygon> CreateAois(IEnvelope env)
        {
            try
            {
                env.Project(Jarvis.ProjectedCoordinateSystem);
                List<GbdPolygon> polygons = new List<GbdPolygon>();
                IPoint startingPoint = env.UpperLeft;

                if (startingPoint.IsEmpty)
                {
                    return null;
                }
                while (startingPoint.Y != env.LowerLeft.Y)
                {
                    var temp = ProcessRow(new List<GbdPolygon>(), startingPoint, env);
                    polygons.AddRange(temp);

                    var newY = GetY(startingPoint, env);
                    startingPoint.Y = newY;
                }

                return polygons;
            }
            catch (Exception error)
            {
                return null;
            }
        }
开发者ID:DigitalGlobe,项目名称:DGConnect-ESRI,代码行数:37,代码来源:GbdJarvis.cs


示例2: Insert

 /// <summary> 
 /// Insert an item into the quadtree this is the root of.
 /// </summary>
 public virtual void Insert(IEnvelope itemEnv, object item)
 {
     int index = GetSubnodeIndex(itemEnv, origin);
     // if index is -1, itemEnv must cross the X or Y axis.
     if (index == -1) 
     {
         Add(item);
         return;
     }
     /*
     * the item must be contained in one quadrant, so insert it into the
     * tree for that quadrant (which may not yet exist)
     */
     Node node = Nodes[index];
     /*
     *  If the subquad doesn't exist or this item is not contained in it,
     *  have to expand the tree upward to contain the item.
     */
     if (node == null || ! node.Envelope.Contains(itemEnv)) 
     {
         Node largerNode = Node.CreateExpanded(node, itemEnv);
         Nodes[index] = largerNode;
     }
     /*
     * At this point we have a subquad which exists and must contain
     * contains the env for the item.  Insert the item into the tree.
     */
     InsertContained(Nodes[index], itemEnv, item);            
 }
开发者ID:zhongshuiyuan,项目名称:mapwindowsix,代码行数:32,代码来源:Root.cs


示例3: InMemoryCache

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="repository">The repository</param>
        /// <param name="fullExtent">Full Extent</param>
        /// <param name="featureClass">FeatureClass name</param>
        public InMemoryCache(IRepository repository, IEnvelope fullExtent, string featureClass)
        {
            this._repository = repository;
            this._featureName = featureClass;

            this.BuildGrid(fullExtent);
        }
开发者ID:OliveiraThales,项目名称:GeoCache,代码行数:13,代码来源:InMemoryCache.cs


示例4: Remove

 /// <summary>
 /// Remove the row
 /// </summary>
 /// <param name="itemEnv"></param>
 /// <param name="item"></param>
 /// <returns></returns>
 public bool Remove(IEnvelope itemEnv, int item)
 {
     bool retValue = base.Remove(itemEnv, item);
     if (retValue)
         AdjustNodesForDeletedItem(Root, item);
     return retValue;
 }
开发者ID:DIVEROVIEDO,项目名称:DotSpatial,代码行数:13,代码来源:ShapefileFeatureSourceQuadtree.cs


示例5: Identify

        private void Identify(IEnumerable<ILayer> layers, IEnvelope strict, IEnvelope tolerant)
        {
            foreach (IMapLayer layer in layers)
            {
                IGroup grp = layer as IGroup;
                if (grp != null)
                {
                    Identify(grp, strict, tolerant);
                }
                else
                {
                    IMapFeatureLayer gfl = layer as IMapFeatureLayer;
                    if (gfl != null)
                    {
                        if (gfl.DataSet.FeatureType == FeatureTypes.Polygon)
                        {
                            frmFeatureIdentifier.Add(gfl, strict);
                        }
                        else
                        {
                            frmFeatureIdentifier.Add(gfl, tolerant);
                        }
                    }
                }

            }
        }
开发者ID:zhongshuiyuan,项目名称:mapwindowsix,代码行数:27,代码来源:IdentifyFunction.cs


示例6: boundingBox

        /// <summary> Class to handle a boundingbox, that make sure it is within Flanderers 
        /// and return string string in the wanted format from arcgis IEnvelope </summary>
        /// <param name="arcgisBbox">arcgis IEnvelope </param>
        public boundingBox(IEnvelope arcgisBbox)
        {
            //handle SRS
            inSRS = arcgisBbox.SpatialReference;

            //Set maxbounds
            Type factoryType = Type.GetTypeFromProgID("esriGeometry.SpatialReferenceEnvironment");
            System.Object obj = Activator.CreateInstance(factoryType);
            ISpatialReferenceFactory3 spatialReferenceFactory = obj as ISpatialReferenceFactory3;

            ISpatialReference lam72 = spatialReferenceFactory.CreateSpatialReference(31370);
            IEnvelope maxBounds = geopuntHelper.makeExtend(17750, 23720, 297240, 245340, lam72); //not outside flanders
            if (inSRS.FactoryCode != lam72.FactoryCode)
            {
                maxBounds = geopuntHelper.Transform(maxBounds as IGeometry, inSRS) as IEnvelope;
            }
            if (arcgisBbox.XMin > maxBounds.XMin) Xmin = arcgisBbox.XMin;
            else Xmin = maxBounds.XMin;
            if (arcgisBbox.YMin > maxBounds.YMin) Ymin = arcgisBbox.YMin;
            else Ymin = maxBounds.YMin;
            if (arcgisBbox.XMax < maxBounds.XMax) Xmax = arcgisBbox.XMax;
            else Xmax = maxBounds.XMax;
            if (arcgisBbox.YMax < maxBounds.YMax) Ymax = arcgisBbox.YMax;
            else Ymax = maxBounds.YMax;
        }
开发者ID:geopunt,项目名称:geopunt4arcgis,代码行数:28,代码来源:boundingBox.cs


示例7: DrawStratCorDiagram

 public static void DrawStratCorDiagram(IEnvelope Envelope)
 {
     double Text2BoxY = 0.2; //Y distance between the bottom of text and the next box
     double Text2BoxX = 0.1; //X distance between a box and the text that describes it
     double ColumnX = 0.1; //Space between columns
     DrawMapUnits(Envelope, false, ColumnX);
 }
开发者ID:chinasio,项目名称:azgs-toolbar,代码行数:7,代码来源:drawMapUnits.cs


示例8: GetGeometriesInView

        public Collection<IGeometry> GetGeometriesInView(IEnvelope bbox, double minGeometrySize)
        {
            Collection<IGeometry> features = new Collection<IGeometry>();
            using (SQLiteConnection conn = new SQLiteConnection(_ConnectionString))
            {
                string BoxIntersect = GetBoxClause(bbox);

                string strSQL = "SELECT " + this.GeometryColumn + " AS Geom ";
                strSQL += "FROM " + this.Table + " WHERE ";
                strSQL += BoxIntersect;
                if (!String.IsNullOrEmpty(_defintionQuery))
                    strSQL += " AND " + this.DefinitionQuery;

                using (SQLiteCommand command = new SQLiteCommand(strSQL, conn))
                {
                    conn.Open();
                    using (SQLiteDataReader dr = command.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            if (dr[0] != DBNull.Value)
                            {
                                IGeometry geom = SharpMap.Converters.WellKnownText.GeometryFromWKT.Parse((string)dr[0]);
                                if (geom != null)
                                    features.Add(geom);
                            }
                        }
                    }
                    conn.Close();
                }
            }
            return features;
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:33,代码来源:SqlLite.cs


示例9: GetFeatures

 //Why ask the renderer when you know already?
 public override IList GetFeatures(IEnvelope box, ILayer layer)
 {
     var coverage = ((NetworkCoverageSegmentLayer)layer).Coverage;
     var segments = coverage.Segments.Values
         .Where(networkLocation => networkLocation.Geometry.EnvelopeInternal.Intersects(box)).ToList();
     return segments;
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:8,代码来源:NetworkCoverageSegmentRenderer.cs


示例10: SimplePointCursor

		public SimplePointCursor(string filePath, IFields fields, int OID, 
			System.Array fieldMap, IEnvelope queryEnv, esriGeometryType geomType)	
		{
			//HIGHLIGHT: 0 - Set up cursor
			m_bIsFinished = false;
			m_pStreamReader = new System.IO.StreamReader(filePath);
			m_fields = fields;
			m_iOID = OID;
			m_fieldMap = fieldMap;
			m_searchEnv = queryEnv;
			switch (geomType)
			{
				case esriGeometryType.esriGeometryPolygon:
					m_wkGeom = new Polygon() as IGeometry;
					m_workPts = new PointClass[5];
					for (int i = 0; i < m_workPts.Length; i++)
						m_workPts[i] = new PointClass();
					break;
				case esriGeometryType.esriGeometryPolyline:
					m_wkGeom = new PolylineClass() as IGeometry;
					m_workPts = new PointClass[5];
					for (int i = 0; i < m_workPts.Length; i++)
						m_workPts[i] = new PointClass();
					break;
				
				case esriGeometryType.esriGeometryPoint:
					m_wkGeom = new PointClass() as IGeometry;
					break;
				default:	//doesn't need to set worker geometry if it is table 
					break;
			}

			//advance cursor so data is readily available
			this.NextRecord();
		}
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:35,代码来源:SimplePointCursor.cs


示例11: GetPersistentSubscriptionStats

 public GetPersistentSubscriptionStats(IEnvelope envelope, string eventStreamId, string groupName)
 {
     Ensure.NotNull(envelope, "envelope");
     Envelope = envelope;
     _eventStreamId = eventStreamId;
     _groupName = groupName;
 }
开发者ID:rbanks54,项目名称:EventStore,代码行数:7,代码来源:MonitoringMessage.cs


示例12: EnsureExtent

 /// <summary>
 /// Ensure that the envelope for the inserted item has non-zero extents.
 /// Use the current minExtent to pad the envelope, if necessary.
 /// </summary>
 /// <param name="itemEnv"></param>
 /// <param name="minExtent"></param>
 public static IEnvelope EnsureExtent(IEnvelope itemEnv, double minExtent)
 {
     //The names "ensureExtent" and "minExtent" are misleading -- sounds like
     //this method ensures that the extents are greater than minExtent.
     //Perhaps we should rename them to "ensurePositiveExtent" and "defaultExtent".
     //[Jon Aquino]
     double minx = itemEnv.MinX;
     double maxx = itemEnv.MaxX;
     double miny = itemEnv.MinY;
     double maxy = itemEnv.MaxY;            
     // has a non-zero extent
     if (minx != maxx && miny != maxy) 
         return itemEnv;
     // pad one or both extents
     if (minx == maxx) 
     {
         minx = minx - minExtent / 2.0;
         maxx = minx + minExtent / 2.0;
     }
     if (miny == maxy) 
     {
         miny = miny - minExtent / 2.0;
         maxy = miny + minExtent / 2.0;
     }
     return new Envelope(minx, maxx, miny, maxy);
 }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:32,代码来源:Quadtree.cs


示例13: RetriveData

        public bool RetriveData(IEnvelope envelop, ref IList<IGeometry> outerData)
        {
            IEnvelope affected = envelop;
            var toUpdate = new List<ICache>();
            bool found = false;

            foreach (var cache in this.Caches)
            {
                var has = cache.RetriveData(affected, ref outerData, ref affected);

                if(!has)
                {
                    toUpdate.Add(cache);
                }
                else
                {
                    found = true;
                    break;
                }
            }

            if (found && toUpdate.Count > 0)
            {
                IEnumerable<IGeometry> cursor = outerData;
                toUpdate.ForEach(x => x.BuildCursor(cursor));

                var first = this.Caches.First();
                first.RetriveData(envelop, ref outerData, ref affected);
            }

            return true;
        }
开发者ID:OliveiraThales,项目名称:GeoCache,代码行数:32,代码来源:CacheManager.cs


示例14: Snap

        ///// <summary>
        ///// snapping specific for a tool. Called before layer specific snappping is applied.
        ///// </summary>
        ///// <param name="sourceLayer"></param>
        ///// <param name="snapSource"></param>
        ///// <param name="worldPos"></param>
        ///// <param name="Envelope"></param>
        ///// <returns></returns>
        public void Snap(ILayer sourceLayer, IGeometry snapSource, ICoordinate worldPos, IEnvelope Envelope)
        {
            SnapResult = null;
            IFeature sourceFeature = MapControl.SelectTool.FeatureEditors[0].SourceFeature;
            if (sourceFeature.Geometry != snapSource)
                return;
            SnapRole snapRole = SnapRole.FreeAtObject;
            if ((Control.ModifierKeys & Keys.Control) == Keys.Control)
                snapRole = SnapRole.Free;
            ISnapRule snapRule = new SnapRule
                                     {
                                         SourceLayer = sourceLayer,
                                         TargetLayer = sourceLayer,
                                         Obligatory = true,
                                         SnapRole = snapRole,
                                         PixelGravity = 4
                                     };

            SnapResult = MapControl.SnapTool.ExecuteSnapRule(
                                                snapRule,
                                                sourceFeature,
                                                sourceFeature.Geometry,
                                                new List<IFeature>
                                                    {
                                                        sourceFeature
                                                    },
                                                worldPos,
                                                -1);
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:37,代码来源:CurvePointTool.cs


示例15: GetObjectIDsInView

        public System.Collections.ObjectModel.Collection<uint> GetObjectIDsInView(IEnvelope bbox)
        {
            Collection<uint> objectlist = new Collection<uint>();
            using (SQLiteConnection conn = new SQLiteConnection(_ConnectionString))
            {
                string strSQL = "SELECT " + this.ObjectIdColumn + " ";
                strSQL += "FROM " + this.Table + " WHERE ";

                strSQL += GetBoxClause(bbox);

                if (!String.IsNullOrEmpty(_defintionQuery))
                    strSQL += " AND " + this.DefinitionQuery + " AND ";

                using (SQLiteCommand command = new SQLiteCommand(strSQL, conn))
                {
                    conn.Open();
                    using (SQLiteDataReader dr = command.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            if (dr[0] != DBNull.Value)
                            {
                                uint ID = (uint)(int)dr[0];
                                objectlist.Add(ID);
                            }
                        }
                    }
                    conn.Close();
                }
            }
            return objectlist;
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:32,代码来源:SqlLite.cs


示例16: Delete

 public Delete(IEnvelope envelope, string name, bool deleteCheckpointStream, bool deleteStateStream)
 {
     _envelope = envelope;
     _name = name;
     _deleteCheckpointStream = deleteCheckpointStream;
     _deleteStateStream = deleteStateStream;
 }
开发者ID:robashton,项目名称:EventStore,代码行数:7,代码来源:ProjectionManagementMessage.cs


示例17: Dispatch

        public async Task Dispatch(string contentType, IEnvelope<IMessage> envelope, ISession session = null)
        {

            try
            {
                if (envelope.Body == null)
                    throw new MessageDispatcherException("The envelope did not contain a body. Unable to process message.");

                var bodyType = envelope.Body.GetType();

                // Get the handler types.
                if (!_handlerMap.HandlerTypes.ContainsKey(bodyType))
                {
                    throw new MessageDispatcherException("The message {0} has not been registered with a handler.", bodyType.Name);
                }

                // Execute handlers.
                foreach (var handlerType in _handlerMap.HandlerTypes[bodyType])
                {
                    // Log start.
                    MessengerEventSource.Log.MessageProcessing(bodyType, handlerType, envelope);

                    // Create the handler.
                    var handler = _container.Resolve(handlerType) as IMessageHandler;
                    if (handler == null)
                        throw new NullReferenceException("handler");

                    // Set envelope.
                    var envelopedHandler = handler as IEnvelopedHandler;
                    if (envelopedHandler != null)
                    {
                        envelopedHandler.Envelope = envelope;
                    }

                    // Set session.
                    var sessionHandler = handler as ISessionHandler;
                    if (sessionHandler != null)
                    {
                        sessionHandler.Session = session;
                    }

                    // Execute.
                    var startTime = DateTime.Now;
                    await ((handler as dynamic).Handle((dynamic)(envelope.Body)) as Task)
                        .ConfigureAwait(false);

                    // Log end.
                    MessengerEventSource.Log.MessageProcessed(bodyType, handlerType, (DateTime.Now - startTime).TotalSeconds, envelope);
                }
            }
            catch (Exception ex)
            {
                // Log.
                MessengerEventSource.Log.MessageProcessingException(contentType, envelope, ex);

                // Rethrow.
                throw;
            }
        }
开发者ID:Mecabot,项目名称:RedDog,代码行数:59,代码来源:MessageDispatcher.cs


示例18: UnwrapPing

 private static Message UnwrapPing(TcpPackage package, IEnvelope envelope)
 {
     var data = new byte[package.Data.Count];
     Buffer.BlockCopy(package.Data.Array, package.Data.Offset, data, 0, package.Data.Count);
     var pongMessage = new TcpMessage.PongMessage(package.CorrelationId, data);
     envelope.ReplyWith(pongMessage);
     return pongMessage;
 }
开发者ID:adbrowne,项目名称:EventStore,代码行数:8,代码来源:ClientTcpDispatcher.cs


示例19: ComputeQuadLevel

 /// <summary>
 /// 
 /// </summary>
 /// <param name="env"></param>
 /// <returns></returns>
 public static int ComputeQuadLevel(IEnvelope env)
 {
     double dx = env.Width;
     double dy = env.Height;
     double dMax = dx > dy ? dx : dy;
     int level = DoubleBits.GetExponent(dMax) + 1;
     return level;
 }
开发者ID:DIVEROVIEDO,项目名称:DotSpatial,代码行数:13,代码来源:Key.cs


示例20: GetFeatures

 //Why ask the renderer when you know already?
 public override IList GetFeatures(IEnvelope box, ILayer layer)
 {
     return layer.DataSource.GetFeatures(box);
     /*var coverage = ((NetworkCoverageLocationLayer)layer).Coverage;
     var segments = coverage.Locations.Values
         .Where(networkLocation => networkLocation.Geometry.EnvelopeInternal.Intersects(box)).ToList();
     return segments;*/
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:9,代码来源:NetworkCoverageLocationRenderer.cs



注:本文中的IEnvelope类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IEnvironment类代码示例发布时间:2022-05-24
下一篇:
C# IEnumerator类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap