本文整理汇总了C#中IEnvelope.CenterAt方法的典型用法代码示例。如果您正苦于以下问题:C# IEnvelope.CenterAt方法的具体用法?C# IEnvelope.CenterAt怎么用?C# IEnvelope.CenterAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEnvelope
的用法示例。
在下文中一共展示了IEnvelope.CenterAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetDynamicValues
//.........这里部分代码省略.........
AAState.WriteLine(" Searching for " + intersectLayerName);
intersectLayer = Globals.FindLayer(AAState._editor.Map, intersectLayerName) as IFeatureLayer;
if (intersectLayer != null)
{
AAState.WriteLine(" Layer Found " + intersectLayerName);
if (intersectLayer.FeatureClass != null)
{
AAState.WriteLine(" Datasource is valid for " + intersectLayerName);
sFilter = new SpatialFilterClass();
AAState.WriteLine(" Checking source Geometry Type");
if (inFeature.Shape.GeometryType == esriGeometryType.esriGeometryPoint)
{
// esriSpatialRelIntersects does not work properly for point intersecting line.
// hence expand point envelope (code cribbed from below)
try
{
ISpatialReferenceResolution pSRResolution;
pSRResolution = ((sourceLayer.FeatureClass as IGeoDataset).SpatialReference) as ISpatialReferenceResolution;
// sFilter = new SpatialFilterClass();
double intTol = pSRResolution.get_XYResolution(false);
bool hasXY = ((sourceLayer.FeatureClass as IGeoDataset).SpatialReference).HasXYPrecision();
searchEnvelope = new EnvelopeClass();
searchEnvelope.XMin = 0 - intTol;
searchEnvelope.YMin = 0 - intTol;
searchEnvelope.XMax = 0 + intTol;
searchEnvelope.YMax = 0 + intTol;
searchEnvelope.CenterAt(inFeature.ShapeCopy as IPoint);
//searchEnvelope.SpatialReference = ((inFeature.Class as IFeatureClass) as IGeoDataset).SpatialReference;
searchEnvelope.SpatialReference = ((inFeature.Class as IFeatureClass) as IGeoDataset).SpatialReference;
searchEnvelope.SnapToSpatialReference();
searchEnvelope.Project(AAState._editor.Map.SpatialReference);
sFilter.Geometry = Globals.Env2Polygon(searchEnvelope);
}
catch
{
sFilter.Geometry = inFeature.ShapeCopy;
}
}
else
{
AAState.WriteLine(" Geoemetry is not a point, using shape envelope");
sFilter.Geometry = inFeature.ShapeCopy;
}
sFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;
sFilter.GeometryField = intersectLayer.FeatureClass.ShapeFieldName;
AAState.WriteLine(" Searching " + intersectLayerName + "for intersected feature");
fCursor = intersectLayer.FeatureClass.Search(sFilter, true);
IFeature intsersectFeature;
int idx = 1;
while ((intsersectFeature = fCursor.NextFeature()) != null)
{
AAState.WriteLine(" Splitting Intersected Feature number: " + idx);
idx++;