|
POST
|
All, I have a river network and a tool I am creating is failing because there are self intersections in the polylines that make up the river network (see attached image of a good example of a polyline with this problem, these can be less than a meter in length so very hard to spot visually, unless zoomed right in). Now I've written some code that can go through the entire network and identify these "offending" polylines. I use the ITopologicalOperator and ask if it IsSimple, a False tells me that the polyline has a self-intersection. So I have a programmatic way of find these on mass but what I am unsure is how to fix these programmatically on mass. I need to remove these loops. As they are so small a simple deletion of a vertex will resolve this (don't care which one) and I have been doing that manually. I want to automate this but I can't figure out how to resolve it in ArcObjects. Has anyone tried to do this and willing to share their technique? Duncan
... View more
10-03-2012
03:16 PM
|
0
|
3
|
7007
|
|
POST
|
Looking at your code you select out a county then use that single county to clip a layer called trex_clip? Looks fine to me. Although I would put an "r" infront of your text where you declare the workspace. So your line of code should look like this: gp.workspace = r"Y:\GIS_FILES\Georgia\GDOT\TSPLOST" Duncan
... View more
10-03-2012
08:03 AM
|
0
|
0
|
663
|
|
POST
|
Tai, I converted your code into VBA and it ran without error for me, is it something as silly as no write permisson to the folder? Duncan
... View more
10-03-2012
07:42 AM
|
0
|
0
|
786
|
|
POST
|
All, Very useful thread this, it saved me! I was getting the same COM error, found this thread, implemented Simplify and IsKnownSimple_2 but was still getting the error. I eventually solved it by adding a SimplifyNetwork of my polylines that I was attempting to do the Symmetrical difference on. So for the record my full code snippet is:
pPolylineStart.SimplifyNetwork()
pPolylineTest.SimplifyNetwork()
pTopoOp = pPolylineTest
pTopoOp.IsKnownSimple_2 =False
pTopoOp.Simplify()
pPolyline = pTopoOp.SymmetricalDifference(pPolylineStart)
Thanks Duncan
... View more
10-03-2012
07:28 AM
|
0
|
0
|
2793
|
|
POST
|
Philip, If you read the Help for this tool the very first thing it states under the usage section is this: All input rasters must be integer. A floating-point raster must first be converted to an integer raster before it can be used in Weighted Overlay. Duncan
... View more
10-01-2012
09:38 AM
|
0
|
0
|
614
|
|
POST
|
Alex, Never used these objects before so this is just a guess but the method CreateCursorEx takes an Ipnt object as a parameter but you've set that as Null in your code... Duncan
... View more
09-26-2012
02:19 PM
|
0
|
0
|
479
|
|
POST
|
If I've understood you correctly you have a layer that you have done some calculations on and you want to merge this layer with a second layer into a third "in memory" layer and then display this third layer? You should be able to do this with an in_memory workspace. When you use the merge tool the output is a FEATURECLASS this is not a FEATURE DATASET which is a sort of "folder" in a geodatabase. As you noted an in_memory workspace cannot support a FEATURE DATASET but it will hold a FEATURECLASS. From this you can write code to create a FeatureLayer and render as you wish then add that to the Map Document (IMap). Duncan
... View more
09-26-2012
02:07 PM
|
0
|
0
|
872
|
|
POST
|
If you want to get a lot more sophisticated with logging progress, you could use the Python logger module?
... View more
09-24-2012
01:00 PM
|
0
|
0
|
1370
|