POST
|
So if my understanding is correct, you want split the polygons in the layer with the given polygon. let's call it cutting polygon. As you said, you can get the polygon parts inside the cutting polygon using ITopologicalOperator.Intersect method. In order to get the parts outside the cutting polygon, you need to call ITopologicalOpearator.Difference. See the link below. http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/Difference_Method/002m000003vr000000/
... View more
03-13-2013
08:33 AM
|
0
|
0
|
206
|
POST
|
The easiest way right now to deal with these situations is to work on a pre 10.1 set up, say 10.0 or 9.3, until 10.2 comes out. The work around probably won't be pretty. To make it work in 10.1, you might want to avoid the cases such as the bounding box or the envelope which holds the 2 input polylines has an area equal to 0. For example, in your case, you can add an extra non-horizontal segment to one of the input lines. Or rotate-intersect-rotate back? Maybe you have better idea.
... View more
03-01-2013
01:11 PM
|
0
|
0
|
337
|
POST
|
I believe this is a special case. Both input lines are horizontal and overlapping with each other. This can causes the crash as you mentioned. The problem has already been addressed in 10.2.
... View more
03-01-2013
09:16 AM
|
0
|
0
|
337
|
POST
|
You can store the result geometry to database or draw in ArcMap to verify whether or not the output is correct. There is code snippet in ArcObjects SDK to select map features by attribute query. http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//004900000088000000 You can also select the feature using IFeatureClass::Search with query filter set, this will return a feature cursor. Call IFeatureCursor::NextFeature gets the feature object you want.
... View more
03-01-2013
08:41 AM
|
0
|
0
|
1926
|
POST
|
Can you please add the data so I can try to repro the issue? Also, I'd set targetOperator.IsKnownSimple = false before calling Simplify. Here targetOperator is of ITopologicalOperator2.
... View more
02-28-2013
07:10 AM
|
0
|
0
|
143
|
POST
|
In order to get the area of intersection, both input geometries have to be polygon type geometry, and you need to choose the result dimenstion to be esriGeometry2Dimension. And you will need IArea interface to get the area. ITopologicalOperator t = polygon1 IGeometry g = t.Intersect(polygon2, esriGeometry2Dimension) IArea a = g a.Area is what you want. There is no behavior change between 9.3 and 10 for Intersect method.
... View more
02-28-2013
06:50 AM
|
0
|
0
|
1926
|
POST
|
The call ConstructBuffersByDistances2 is more straight forward. buffConst.ConstructBuffersByDistances2(inGeometryColl as IEnumGeometry, bufferDistance, outGeomColl); inGeometryColl is of IGeometryCollection.
... View more
02-07-2013
07:29 AM
|
0
|
0
|
146
|
POST
|
This is a piece of C# code might help. IGeometryCollection outGeomColl = new GeometryBagClass() as IGeometryCollection; (outGeomColl as IGeometry).SpatialReference = (inFeatureClass as IGeoDataset).SpatialReference; IBufferConstruction buffConst = new BufferConstructionClass(); IBufferConstructionProperties buffProp = buffConst as IBufferConstructionProperties; buffProp.DistancesSource = bufferDistance; buffProp.GeometriesSource = inGeometryColl as IEnumGeometry; ; buffProp.GeometriesSink = outGeomColl; buffConst.ConstructBuffersByDistances(buffConst as IGeometricBufferSourceSink);
... View more
02-07-2013
07:26 AM
|
0
|
0
|
146
|
POST
|
I'd use IRelationalOperator::equals to find out whether or not 2 geometries are duplicate.
... View more
02-07-2013
07:02 AM
|
0
|
0
|
575
|
POST
|
One way I think that might work: 1. Call IProximityOperator::ReturnDistance to find the distance between the polyline and polygon. 2. Call ITopologicalOperator::Buffer with the distance as the input to create a polygon. 3. Find the touch point on one geometry to the boundary of the buffer polygon. This will be the nearest point of the geometry. 4. Using the same steps or call ReturnNearestPoint to find the nearest point on the other geometry.
... View more
01-31-2013
11:39 AM
|
0
|
0
|
1163
|
POST
|
Not clear of "sometimes the line is drawn randomly". There are a couple of methods from IPolycurve might be useful for your application: SplitAtDistance and SplitAtPoint. You specify the input parameters as your requirement, and you get the part of the polyline you want.
... View more
01-31-2013
10:16 AM
|
0
|
0
|
74
|
POST
|
One obvious mistake I can see here is: addFeature.Shape = coll.get_Geometry(0); Instead, it should be addFeature.Shape = coll; I guess the error message "No support for this geometry type" coming from this line.
... View more
01-31-2013
09:55 AM
|
0
|
0
|
244
|
POST
|
Is the spatial reference for the polyline feature class the same as the public map? Because when you saved the output to the feature class, it get snapped to the spatial reference of the feature class. One thing you can check is that after cutting, run the selection on the out put polylines before saving to the feature class and see whether or not the results ok.
... View more
01-31-2013
08:01 AM
|
0
|
0
|
152
|
POST
|
In a console application, you don't have the hook. You need to have a workspace, and connect to the dataset use the workspace. You probably won't have an GxDataset, instead you will use IDataset interface. If I see more code of yours, I can tell what type of workspace or dataset to use.
... View more
07-05-2012
03:06 PM
|
0
|
0
|
188
|
POST
|
Is your pcVertices a polygon or a polyline? You cannot insert a polygon into a polyline feature class. You need to create a new polyline type IPointCollection object, add the points extracted from polygon into the new point collection.
... View more
06-27-2012
03:04 PM
|
0
|
0
|
165
|
Title | Kudos | Posted |
---|---|---|
1 | 10-28-2020 05:13 PM |
Online Status |
Offline
|
Date Last Visited |
Wednesday
|