.Net 토폴로지 제품군을 사용하는 사람이 있습니까? 나는 내가 복용하고 IGeometry있어.Net 토폴로지 집합을 사용하여 IGeometry 형식에서 IEnvelope 가져 오기
(페이지 하단에있는 C# 예제를 사용) 크기
http://resources.esri.com/help/9.3/arcgisengine/dotnet/c6e6b26c-be52-4176-b1e5-bb628d10acd0.htm에 따라 유효성을 검사 할 수 있도록 봉투를 얻으려고, 조금 붙어 유형 (경계) 내가 너비와 높이 속성
그러나 봉투를보고 기대하고있는이있는 IEnvelope (봉투)에 그 다각형의 봉투를 캐스팅 항상IGeometry boundary;
var wktReader = new WKTReader(OSGBGeometryFactory.Factory);
boundary = wktReader.Read(projectDTO.BoundaryWKT);
IEnvelope envelope = boundary.Envelope as IEnvelope;
수있는 사람의 도움이 null의 경우 이 스위트 룸은 처음입니다. 내가 해결하기 위해 노력하고있어
이 다음 예제 나는 이미 IGeometry 유형 (내 경계 변수)를 가지고 있다면 시도하고 캐스팅 할 때 왜 널 (null)입니다.
using ESRI.ArcGIS.Geometry;
class temp
{
public void test()
{
// Create an empty polygon object.
IArea areaPolygon = new PolygonClass();
// Cast to the IGeometry interface of the polygon object.
IGeometry geometryPolygon = (IGeometry)areaPolygon;
// Use the .Envelope property on the IGeometry interface of the
// polygon object to get an envelope object.
IEnvelope envelope = geometryPolygon.Envelope;
// Test to make sure you have an envelope object.
if (envelope is Envelope)
{
// The polygon object and resulting envelope are empty.
if (envelope.IsEmpty)
{
System.Windows.Forms.MessageBox.Show("The envelope is empty.");
}
}
}
}
내가 새로운 다각형을 만들고 그 (즉,
IArea areaPolygon = new PolygonClass();
복제) 주조 시도해야합니까?