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.




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.


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.)


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


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.


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.


Hope that Helps,



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
  'Increment intJ
    intJ = intJ + 1

I hope this helps.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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