Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am try to automate a sync replica mxd a nightly basis. The issue I am running into is that in some the of the AXFs (that I get from the users and check-in) have polygons that are self-intersecting and is causing problems with the sync replica. The sync errors out and the polygons need to be fixed manually. Is there any way to detect if a polygon is self-intersecting in ArcPad 8.0, using VBA or some other technique, to stop the creation of the polygon? If not, is there some tool in ArcMap 9.3.1 that can be run again the mxd to detemine the self-intersecting polygons and fix them? Any ideas will be greatly appreciated.

Thanks.

Tim

share|improve this question
add comment

5 Answers

In ArcMap (ArcEditor) I often successfully use the Check Geometry tool in ArcToolbox (Data Management/ Features) tool to identify self-intersections but for POLYLINES (vs your polygons). Could work for you in a model? Just a suggestion.

share|improve this answer
add comment

Must Not Intersect or the Must Not Self-Intersect Topology Rule can detect self intersections of lines - so if you have polygons they need to be converted to lines and fixed by the split tool - then polygons rebuilt.

Split Line At Vertices (Data Management) http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000003z000000.htm

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001t000000sp000000.htm

9.3.1 have these tools.

(ArcEditor or ArcInfo licence required.)

This can be automated in Model Builder to find and replace 'self intersecting polygons' and the synced to the replica. Would not use VBA as the soon to be released 10.1 will NOT support VBA.

share|improve this answer
add comment

when you say you "have polygons that are self-intersecting", you mean A) a polygon feature intersects itself B) the many polygons in the feature class intersect each other

If A, then in arcmap, engine, or server, you can use the geoprocessing RepairGeometry tool to fix that. It uses IsSimple COM api as stated by dslamb but is wrapped in a tool that acts on all goemetries in the feature class. This gp tool (like all gp tools) has a dialog, can be used in a model, can be used in python, or in other programming languages (VB6, .net, etc.etc.etc.)

share|improve this answer
add comment

In VBA or ArcObjects you can use the IsSimple method to find out if the geometry self intersects. I think this works regardless of license level.

http://edndoc.esri.com/arcobjects/9.1/ComponentHelp/esriGeometry/ITopologicalOperator3_IsSimpleEx.htm

Hope that Helps,

David

share|improve this answer
add comment

In ArcPad I would run a validation script so that I have checked the data every time the feature is created.

You could run this after every polygon is created on the Map OnfeatureAdded.

dim myrs
set myrs = map.editlayer(3).records

dim myBookmark
myBookmark = map.selectionbookmark
console.print mybookmark

myrs.bookmark = myBookmark

console.print myrs.fields("name").value
Dim objSH
set objSH = myrs.fields.shape

Dim intJ, intI, objPart, objVertex
  'Initialize intJ
intJ = 1
  'Display information for each part of the feature
For Each objPart in objSH.Parts
    MsgBox "Part " & intJ & " contains " & objPart.Count & " vertices.",vbOKOnly," Vertex Count"
  'Initialize intI     
  intI = 1
    'Display information for each vertex in the current part
  For Each objVertex in objPart
      strVertexNo = "vertex(" & intI & ")"
    'Call PntInfo(objVertex, lngSHType, strVertexNo)
    Console.print objSH.isPointIn(objVertex)
    if objSH.isPointIn(objVertex) ="True" then
     msgbox "self intersecting. please edit now"
     exit sub
    end if
      'Increment intI
    intI = intI + 1
    Next
  'Increment intJ
    intJ = intJ + 1
Next

I hope this helps.

Cheers,

Gareth

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.