<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ITopologicalOperator.Buffer Fails - Error 0x80040239 in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/itopologicaloperator-buffer-fails-error-0x80040239/m-p/583332#M15785</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I know, it's very strange.&amp;nbsp; I even went so far as to trace the offending polygon, vertex for vertex and still got the error.&amp;nbsp; If anyone wants to play, I've attached the file GDB.&amp;nbsp; There is only the one polygon in it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Tony&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 May 2011 18:37:39 GMT</pubDate>
    <dc:creator>TonyThatcher</dc:creator>
    <dc:date>2011-05-25T18:37:39Z</dc:date>
    <item>
      <title>ITopologicalOperator.Buffer Fails - Error 0x80040239</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/itopologicaloperator-buffer-fails-error-0x80040239/m-p/583326#M15779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This appears be something that a couple other people have run into going back to 2007 or so.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am running a simple Buffer on a polygon.&amp;nbsp; See code below.&amp;nbsp; This Sub is a simplified version of a much more complex Function, but I've stripped it down to just the basics here to try and figure out what is going on.&amp;nbsp; This Sub is getting called from another routine that loops through a set of selected polygons, passing the current Feature to the Sub.&amp;nbsp; On occasion, the "topoOperator.Buffer(iBuffer)" line fails, returning the "0x80040239" Error.&amp;nbsp; It is ALWAYS on the same polygon, and ONLY when dBufferMiles = 5. If I change the buffer to 4.9 or 5.1, or just about any other number I've tried, the buffer works fine.&amp;nbsp; If I get rid of the 'convert to miles' text and just enter iBuffer = 8046 (e.g. 5 x 1069.3), it fails.&amp;nbsp; I've tried numbers slightly above and below 8046 as my buffer and it fails, so it appears to be a range of numbers for the buffer distance that it does not like.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can select any other polygon and it works fine with a 5 mile buffer.&amp;nbsp; This is in ArcGIS 10, but it also cropped up occasionally in 9.3.&amp;nbsp; I'm using a Personal GDB.&amp;nbsp; I've cleaned the geometry, created a new File GDB, and exported out only that polygon; each with the same results.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can usually run the Buffer tool from the Geoprocessing menu using a 5 mile buffer dist, but I've even seen that fail the first try, before working on the second try.&amp;nbsp; If I edit the polygon's vertices, then it will work, though I can't tell you which vertex solved the problem.&amp;nbsp; And if there was a problem with the geometry, then the Clean Geometry should have taken care of it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts?&amp;nbsp; This application works flawlessly for tens of thousands of polygons, but for some reason fails with certain polygons at specific buffer distances.&amp;nbsp; I'm stumped.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Tony&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Public Sub buffTest(ByVal pFeature As IFeature, ByVal pMap As IMap)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pLayer As IFeatureLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pCursor As IFeatureCursor = Nothing
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim sName As String

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sName = "clonelayer"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pLayer = FindLayerByName(sName, pMap)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeat4Buff As IFeature
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pFeat4Buff = pFeature
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pGeom As IGeometry = pFeat4Buff.Shape
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim topoOperator As ITopologicalOperator = CType(pGeom, ITopologicalOperator)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim iBuffer As Long
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim dBufferMiles As Double

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dBufferMiles = 5
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iBuffer = Int(dBufferMiles * 1609.3) 'convert miles to meters.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'iBuffer = 9000 'convert miles to meters.

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim buffer As IGeometry
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; buffer = topoOperator.Buffer(iBuffer)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pArea As IArea
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pArea = buffer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(pArea.Area / 4047, vbNormal, "Buffer Acres")

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch ex As Exception
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox("Buffer Error: " &amp;amp; ex.Message &amp;amp; " - Stack Trace: " &amp;amp; ex.StackTrace, vbInformation, "Buffer Select Error")

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 16:14:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/itopologicaloperator-buffer-fails-error-0x80040239/m-p/583326#M15779</guid>
      <dc:creator>TonyThatcher</dc:creator>
      <dc:date>2011-05-25T16:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: ITopologicalOperator.Buffer Fails - Error 0x80040239</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/itopologicaloperator-buffer-fails-error-0x80040239/m-p/583327#M15780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does this happen with only integer numbers as opposed to decimals or just 5 but not 6? Try forcing the number to a double data type as in&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim dBufferMiles As Double = 5.0R&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim dBufferMiles# = 5&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 16:23:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/itopologicaloperator-buffer-fails-error-0x80040239/m-p/583327#M15780</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2011-05-25T16:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: ITopologicalOperator.Buffer Fails - Error 0x80040239</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/itopologicaloperator-buffer-fails-error-0x80040239/m-p/583328#M15781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; It is ALWAYS on the same polygon, and ONLY when dBufferMiles = 5. If I change the buffer to 4.9 or 5.1, or just about any other number I've tried, the buffer works fine. &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Would this be a problem of Integer values rather than Double/Decimal values being used (ie, fails when the integer 5 is used)?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 16:28:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/itopologicaloperator-buffer-fails-error-0x80040239/m-p/583328#M15781</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2011-05-25T16:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: ITopologicalOperator.Buffer Fails - Error 0x80040239</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/itopologicaloperator-buffer-fails-error-0x80040239/m-p/583329#M15782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Does this happen with only integer numbers as opposed to decimals or just 5 but not 6? Try forcing the number to a double data type as in&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;Dim dBufferMiles As Double = 5.0R&lt;BR /&gt;or&lt;BR /&gt;Dim dBufferMiles# = 5&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Doh -- we were reading the same thing.&amp;nbsp; You were fast on the answering.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry there, Ken -- didn't mean to barge in!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 16:29:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/itopologicaloperator-buffer-fails-error-0x80040239/m-p/583329#M15782</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2011-05-25T16:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: ITopologicalOperator.Buffer Fails - Error 0x80040239</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/itopologicaloperator-buffer-fails-error-0x80040239/m-p/583330#M15783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dang! Fast fingers, guys!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But, no.&amp;nbsp; Forcing it to be an integer does not help.&amp;nbsp; I tried that earlier, with no luck.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That error shows up somewhere in the depths of the ESRI web as an Internal Geometry Error, or something like that.&amp;nbsp; I played around with some of the vertices and found a single vertex that, if moved, it would run fine.&amp;nbsp; See attached image.&amp;nbsp; This is a tiny, 1-meter notch on one edge.&amp;nbsp; One of many similar vertices.&amp;nbsp; If I move the vertex and straiten out the edge, it runs fine.&amp;nbsp; There is no way that this little spot should cause a buffer to fail!&amp;nbsp; It runs at just about any buffer distance, integer or floating, except for right at or around 5 miles.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And there is no way that the user can or should have to go in and find the one little vertex that is causing problems.&amp;nbsp; This is the tail end of a long data processing routine, and it works on 99.9999 percent of the polygons.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-T&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 16:58:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/itopologicaloperator-buffer-fails-error-0x80040239/m-p/583330#M15783</guid>
      <dc:creator>TonyThatcher</dc:creator>
      <dc:date>2011-05-25T16:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: ITopologicalOperator.Buffer Fails - Error 0x80040239</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/itopologicaloperator-buffer-fails-error-0x80040239/m-p/583331#M15784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Dang! Fast fingers, guys!&lt;BR /&gt;&lt;BR /&gt;But, no.&amp;nbsp; Forcing it to be an integer does not help.&amp;nbsp; I tried that earlier, with no luck.&lt;BR /&gt;&lt;BR /&gt;That error shows up somewhere in the depths of the ESRI web as an Internal Geometry Error, or something like that.&amp;nbsp; I played around with some of the vertices and found a single vertex that, if moved, it would run fine.&amp;nbsp; -T&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I cannot seem to replicate the error you are seeing -- switching around the miles value from whole integers (5) to double values.&amp;nbsp; I even added a little 1-meter notch into the polygon per the image you posted, and still your sub/code ran without error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="http://i263.photobucket.com/albums/ii135/jamesfreddyc/notched_poly.jpg" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 17:17:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/itopologicaloperator-buffer-fails-error-0x80040239/m-p/583331#M15784</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2011-05-25T17:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: ITopologicalOperator.Buffer Fails - Error 0x80040239</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/itopologicaloperator-buffer-fails-error-0x80040239/m-p/583332#M15785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I know, it's very strange.&amp;nbsp; I even went so far as to trace the offending polygon, vertex for vertex and still got the error.&amp;nbsp; If anyone wants to play, I've attached the file GDB.&amp;nbsp; There is only the one polygon in it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Tony&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 18:37:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/itopologicaloperator-buffer-fails-error-0x80040239/m-p/583332#M15785</guid>
      <dc:creator>TonyThatcher</dc:creator>
      <dc:date>2011-05-25T18:37:39Z</dc:date>
    </item>
  </channel>
</rss>

