当前位置: 首页>>代码示例>>C#>>正文


C# IGeometry.SetEmpty方法代码示例

本文整理汇总了C#中IGeometry.SetEmpty方法的典型用法代码示例。如果您正苦于以下问题:C# IGeometry.SetEmpty方法的具体用法?C# IGeometry.SetEmpty怎么用?C# IGeometry.SetEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IGeometry的用法示例。


在下文中一共展示了IGeometry.SetEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: QueryShape

		public void QueryShape(IGeometry pGeometry)
		{
			if (pGeometry == null)
				return;

			try
			{
				double x, y;
				x = Convert.ToDouble(m_sbuffer.Substring(0, 6));
				y = Convert.ToDouble(m_sbuffer.Substring(6, 6));

				#region set M and Z aware
				if (m_bZ)
					((IZAware)pGeometry).ZAware = true;
				if (m_bM)
					((IMAware)pGeometry).MAware = true;
				#endregion

				//HIGHLIGHT: 2.1 QueryShape - (advanced) geometry construction
				if (pGeometry is IPoint)
				{
					((IPoint)pGeometry).PutCoords(x, y);
					if (m_bM)
						((IPoint)pGeometry).M = m_iInterate;
					if (m_bZ)
						((IPoint)pGeometry).Z = m_iInterate * 100;
				}
				else if (pGeometry is IPolyline)	
					buildPolyline((IPointCollection)pGeometry, x, y);
				else if (pGeometry is IPolygon)
					buildPolygon((IPointCollection)pGeometry, x, y);
				else
					pGeometry.SetEmpty();
			}
			catch (Exception ex)
			{
				System.Diagnostics.Debug.WriteLine(" Error: " + ex.Message);
				pGeometry.SetEmpty();
			}
		}
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:40,代码来源:SimplePointCursor.cs

示例2: QueryShape

        public void QueryShape(IGeometry pGeometry)
        {
            if (pGeometry == null)
                return;

            try
            {
                OSGeo.OGR.Geometry ogrGeometry = m_currentOGRFeature.GetGeometryRef();

                // Flatten the geometry and ommit Z value until we add manual
                // Z-value zupport
                // See:
                // https://github.com/RBURHUM/arcgis-ogr/issues/11
                //
                //
                ogrGeometry.FlattenTo2D();

                //export geometry from OGR to WKB
                int wkbSize = ogrGeometry.WkbSize();
                byte[] wkbBuffer = new byte[wkbSize];
                ogrGeometry.ExportToWkb(wkbBuffer);

                //import geometry from WKB to ESRI Shape
                IWkb pWKB = pGeometry as IWkb;
                pWKB.ImportFromWkb(wkbSize, ref wkbBuffer[0]);

                pGeometry.SpatialReference = m_pDataset.SpatialReference;

            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(" Error: " + ex.Message);
                pGeometry.SetEmpty();
            }
        }
开发者ID:petr-k,项目名称:arcgis-ogr,代码行数:35,代码来源:OGRCursor.cs

示例3: QueryShape

        public void QueryShape(IGeometry pGeometry)
        {
            if (pGeometry == null)
                return;

            try
            {
                OSGeo.OGR.Geometry ogrGeometry = m_currentOGRFeature.GetGeometryRef();

                //export geometry from OGR to WKB
                int wkbSize = ogrGeometry.WkbSize();
                byte[] wkbBuffer = new byte[wkbSize];
                ogrGeometry.ExportToWkb(wkbBuffer);

                //import geometry from WKB to ESRI Shape
                IWkb pWKB = pGeometry as IWkb;
                pWKB.ImportFromWkb(wkbSize, ref wkbBuffer[0]);

                pGeometry.SpatialReference = m_pDataset.SpatialReference;

            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(" Error: " + ex.Message);
                pGeometry.SetEmpty();
            }
        }
开发者ID:fgcartographix,项目名称:arcgis-ogr,代码行数:27,代码来源:OGRCursor.cs


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