本文整理汇总了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();
}
}
示例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();
}
}
示例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();
}
}