<?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: Add Vertex to Polygon in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/add-vertex-to-polygon/m-p/1574636#M20696</link>
    <description>&lt;P&gt;Sorry are you saying you are trying to insert a vertex into a polygon that is composed of 8 million vertices? I would imagine any sort of spatial processing would be quite slow and you would need to dice up your data?&lt;/P&gt;</description>
    <pubDate>Sun, 12 Jan 2025 00:54:15 GMT</pubDate>
    <dc:creator>DuncanHornby</dc:creator>
    <dc:date>2025-01-12T00:54:15Z</dc:date>
    <item>
      <title>Add Vertex to Polygon</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/add-vertex-to-polygon/m-p/1544204#M20684</link>
      <description>&lt;P&gt;&lt;SPAN&gt;To add a vertex to the polygon, we are creating an application. After a few runs, the application displays the error message "Attempt to read and write protected memory."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="download.png" style="width: 407px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/116227i56EC27D124B9F3A7/image-size/large?v=v2&amp;amp;px=999" role="button" title="download.png" alt="download.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;DIV&gt;IHitTest hitTest = polygon.ShapeCopy as IHitTest;&lt;/DIV&gt;&lt;DIV&gt;bool result = hitTest.HitTest(, searchRadius, esriGeometryHitPartType.esriGeometryPartBoundary, hitPoint, ref hitDist, ref hitPartIndex, ref hitSegmentIndex, ref bTrue);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;if (result)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IGeometryCollection geometryCol = polygon.ShapeCopy as IGeometryCollection;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IPointCollection pathOrRingPointCollection = geometryCol.get_Geometry(hitPartIndex) as IPointCollection;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;object hitSegmentIndexObject = new object();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;hitSegmentIndexObject = hitSegmentIndex;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;object partIndexObject = new object();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;partIndexObject = hitPartIndex;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if(hitSegmentIndex == 0)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;pathOrRingPointCollection.AddPoint(point, 1, Type.Missing);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;else if(hitSegmentIndex &amp;gt; 0)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;pathOrRingPointCollection.AddPoint(point, Type.Missing, hitSegmentIndexObject);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//remove the old PointCollection from the GeometryCollection and replace with the new one&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;geometryCol.RemoveGeometries(hitPartIndex, 1);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;geometryCol.AddGeometry(pathOrRingPointCollection as IGeometry, ref partIndexObject, Type.Missing);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;polygon.Shape = geometryCol as IGeometry;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;invalidArea.Invalidate(2);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;polygon.Store();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any recommendations or an alternative interface would be much appreciated.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Oct 2024 13:20:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/add-vertex-to-polygon/m-p/1544204#M20684</guid>
      <dc:creator>sonj</dc:creator>
      <dc:date>2024-10-01T13:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Add Vertex to Polygon</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/add-vertex-to-polygon/m-p/1545083#M20688</link>
      <description>&lt;P&gt;Is anyone here to help&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2024 06:19:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/add-vertex-to-polygon/m-p/1545083#M20688</guid>
      <dc:creator>sonj</dc:creator>
      <dc:date>2024-10-03T06:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: Add Vertex to Polygon</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/add-vertex-to-polygon/m-p/1574609#M20693</link>
      <description>&lt;P&gt;I'm surprised the HitTest() even works as the help file indicates the first parameter is a point object which in your code you don't supply?&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jan 2025 01:04:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/add-vertex-to-polygon/m-p/1574609#M20693</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2025-01-11T01:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Add Vertex to Polygon</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/add-vertex-to-polygon/m-p/1574612#M20695</link>
      <description>&lt;P&gt;I apologize; it was overlooked during copy and paste. Points are collected throughout the process, and each repetition will send a point. The polygon vertex count is approximately 8 to 9 million.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jan 2025 03:19:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/add-vertex-to-polygon/m-p/1574612#M20695</guid>
      <dc:creator>sonj</dc:creator>
      <dc:date>2025-01-11T03:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Add Vertex to Polygon</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/add-vertex-to-polygon/m-p/1574636#M20696</link>
      <description>&lt;P&gt;Sorry are you saying you are trying to insert a vertex into a polygon that is composed of 8 million vertices? I would imagine any sort of spatial processing would be quite slow and you would need to dice up your data?&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jan 2025 00:54:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/add-vertex-to-polygon/m-p/1574636#M20696</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2025-01-12T00:54:15Z</dc:date>
    </item>
  </channel>
</rss>

