<?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: Buffering using VBA in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/buffering-using-vba/m-p/214281#M5549</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Attaching a couple of screenshots of the buffers. East is measured at 0.75 mile. and North at 1mile. This is using NAD83 projection. But when I change the projection to Mercator, East and West measure fine, but North and South are off.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Nov 2013 02:41:39 GMT</pubDate>
    <dc:creator>RamaGangavall</dc:creator>
    <dc:date>2013-11-07T02:41:39Z</dc:date>
    <item>
      <title>Buffering using VBA</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/buffering-using-vba/m-p/214275#M5543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using the following code to draw a 1 mile buffer around a polygon. When I measure the distance from the edge of the polygon to the buffer, its not accurate. North and South are fine, but East and West are off. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim pMxDoc As IMxDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pActiveView As IActiveView&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pGraphicsContainer As IGraphicsContainer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pEnumFeature As IEnumFeature&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pFeature As IFeature&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pTopoOp As ITopologicalOperator&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pElement As IElement&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim strBufferDistance As String&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pMxDoc = Application.Document&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pActiveView = pMxDoc.FocusMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pGraphicsContainer = pMxDoc.FocusMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'Verify there is a feature selection&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; If pMxDoc.FocusMap.SelectionCount = 0 Then Exit Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'Get a buffer distance from the user&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; strBufferDistance = InputBox("Enter Distance:", "Buffer")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; If strBufferDistance = "" Or Not IsNumeric(strBufferDistance) Then Exit Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'Buffer all the selected features by the BufferDistance&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'and create a new polygon element from each result&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pEnumFeature = pMxDoc.FocusMap.FeatureSelection&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pEnumFeature.Reset&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pFeature = pEnumFeature.Next&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Do While Not pFeature Is Nothing&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pTopoOp = pFeature.Shape&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pElement = New PolygonElement&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pElement.Geometry = pTopoOp.Buffer(CInt(strBufferDistance))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pGraphicsContainer.AddElement pElement, 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFeature = pEnumFeature.Next&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Loop&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'Redraw the graphics&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 01:48:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/buffering-using-vba/m-p/214275#M5543</guid>
      <dc:creator>RamaGangavall</dc:creator>
      <dc:date>2013-10-31T01:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: Buffering using VBA</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/buffering-using-vba/m-p/214276#M5544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I notice that you aren't giving your graphic element a spatial reference.&amp;nbsp; Without a spatial reference defined, it's quite possible that ArcMap will not properly project the element.&amp;nbsp; Have you determined that this is not a spatial reference issue?&amp;nbsp; I've been using ITopoOp.Buffer for over a decade and have never had any problems with it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 12:23:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/buffering-using-vba/m-p/214276#M5544</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2013-10-31T12:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Buffering using VBA</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/buffering-using-vba/m-p/214277#M5545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you're using the measure tool, check what type of distance it's returning. A problem with east-west distances implies to me that the geodesic distance is being returned. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Melita&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 20:16:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/buffering-using-vba/m-p/214277#M5545</guid>
      <dc:creator>MelitaKennedy</dc:creator>
      <dc:date>2013-10-31T20:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Buffering using VBA</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/buffering-using-vba/m-p/214278#M5546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I notice that you aren't giving your graphic element a spatial reference.&amp;nbsp; Without a spatial reference defined, it's quite possible that ArcMap will not properly project the element.&amp;nbsp; Have you determined that this is not a spatial reference issue?&amp;nbsp; I've been using ITopoOp.Buffer for over a decade and have never had any problems with it.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Modified my code to the following, but still it doesn't work. When I measure the distance using the measuring tool, E is 0.75 miles and W is 0.78 miles, but N and S returns 1 mile.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pMxDoc As IMxDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pxMap As IMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pActiveView As IActiveView&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pGraphicsContainer As IGraphicsContainer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pEnumFeature As IEnumFeature&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pFeature As iFeature&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pTopoOp As ITopologicalOperator&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pElement As IElement&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim strBufferDistance As String&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pMxDoc = ThisDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pxMap = pMxDoc.FocusMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pSpatRefFact As ISpatialReferenceFactory&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pSpatRefFact = New SpatialReferenceEnvironment&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pspatref As ISpatialReference&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pspatref = pSpatRefFact.CreateESRISpatialReferenceFromPRJFile("NAD83.prj")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pxMap.SpatialReference = pspatref&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pActiveView = pxMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pGraphicsContainer = pMxDoc.FocusMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'Verify there is a feature selection&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; If pMxDoc.FocusMap.SelectionCount = 0 Then Exit Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pEnumFeature = pMxDoc.FocusMap.FeatureSelection&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pEnumFeature.Reset&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pFeature = pEnumFeature.Next&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Do While Not pFeature Is Nothing&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pTopoOp = pFeature.Shape&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pElement = New PolygonElement&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pElement.Geometry = pTopoOp.Buffer(ConvertUnits(1#, esriMiles, esriDecimalDegrees))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pGraphicsContainer.AddElement pElement, 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFeature = pEnumFeature.Next&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Loop&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'Redraw the graphics&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pActiveView.PartialRefresh esriViewGraphics, Nothing, Nothing&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Nov 2013 23:38:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/buffering-using-vba/m-p/214278#M5546</guid>
      <dc:creator>RamaGangavall</dc:creator>
      <dc:date>2013-11-04T23:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: Buffering using VBA</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/buffering-using-vba/m-p/214279#M5547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;If you're using the measure tool, check what type of distance it's returning. A problem with east-west distances implies to me that the geodesic distance is being returned. &lt;BR /&gt;&lt;BR /&gt;Melita&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It returns me in miles.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Nov 2013 23:38:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/buffering-using-vba/m-p/214279#M5547</guid>
      <dc:creator>RamaGangavall</dc:creator>
      <dc:date>2013-11-04T23:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: Buffering using VBA</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/buffering-using-vba/m-p/214280#M5548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The geodesic distance is the distance on the ellipsoid/spheroid. It will be in linear units like miles or meters. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The ConvertUnits is making an assumption to convert miles to degrees, probably using a mile at the equator to calculate the equivalent length in degrees. When you check that with the measure tool, the fact that the meridians (longitude lines) converge toward the pole means that the east-west distance is shorter than the north-south distance.&amp;nbsp; My guess, based on the difference in the lengths, is that the data is at approximately 41 North latitude. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Melita&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 17:16:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/buffering-using-vba/m-p/214280#M5548</guid>
      <dc:creator>MelitaKennedy</dc:creator>
      <dc:date>2013-11-05T17:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Buffering using VBA</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/buffering-using-vba/m-p/214281#M5549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Attaching a couple of screenshots of the buffers. East is measured at 0.75 mile. and North at 1mile. This is using NAD83 projection. But when I change the projection to Mercator, East and West measure fine, but North and South are off.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 02:41:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/buffering-using-vba/m-p/214281#M5549</guid>
      <dc:creator>RamaGangavall</dc:creator>
      <dc:date>2013-11-07T02:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: Buffering using VBA</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/buffering-using-vba/m-p/214282#M5550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You should reread Melita's last post.&amp;nbsp; Your screenshots clearly indicate you are looking at the geodesic distance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 12:18:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/buffering-using-vba/m-p/214282#M5550</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2013-11-07T12:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Buffering using VBA</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/buffering-using-vba/m-p/214283#M5551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Once I switched to the right Projection (UTM) it worked. Thanks for your replies.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Nov 2013 02:10:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/buffering-using-vba/m-p/214283#M5551</guid>
      <dc:creator>RamaGangavall</dc:creator>
      <dc:date>2013-11-08T02:10:08Z</dc:date>
    </item>
  </channel>
</rss>

