<?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: VB.Net - GetGeometry only returns a ShapeBuffer in File Geodatabase API Questions</title>
    <link>https://community.esri.com/t5/file-geodatabase-api-questions/vb-net-getgeometry-only-returns-a-shapebuffer/m-p/738929#M1170</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I have been playing with the API in VB.net and can not get a geometry from the GetGeometry() function.&lt;BR /&gt;&lt;BR /&gt;According to the C# examples:&lt;BR /&gt;PointShapeBuffer pointGeometry = row.GetGeometry();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; point = pointGeometry.point;&lt;BR /&gt;&lt;BR /&gt;In Vb.net the GetGeometry function explicity states it returns a ShapeBuffer. It will not accept a CType converstion to PointShapeBuffer, and will not accept a PointShapeBuffer as an output. The Help states the Geometry function returns a ShapeBuffer so I do not understand how to get a point from (Get)Geometry function.&lt;BR /&gt;&lt;BR /&gt;Any advice would be appreciated. &lt;BR /&gt;&lt;BR /&gt;David&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi David,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am running into a very similar issue on casting ShapeBuffer to MultipartBuffer. I find the cast works with .NET Wrapper-C#, but not with VB.net. I don't know why exactly the cast fails with VB.net, and I am trying to find out too. I guess it has something to do with generated C++\CLI .NET code. But, anyway, give C# a try, hope it also fix the issue at your end too. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Aug 2012 12:31:01 GMT</pubDate>
    <dc:creator>SiqiLi</dc:creator>
    <dc:date>2012-08-16T12:31:01Z</dc:date>
    <item>
      <title>VB.Net - GetGeometry only returns a ShapeBuffer</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/vb-net-getgeometry-only-returns-a-shapebuffer/m-p/738928#M1169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have been playing with the API in VB.net and can not get a geometry from the GetGeometry() function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;According to the C# examples:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;PointShapeBuffer pointGeometry = row.GetGeometry();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; point = pointGeometry.point;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In Vb.net the GetGeometry function explicity states it returns a ShapeBuffer. It will not accept a CType converstion to PointShapeBuffer, and will not accept a PointShapeBuffer as an output. The Help states the Geometry function returns a ShapeBuffer so I do not understand how to get a point from (Get)Geometry function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advice would be appreciated. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;David&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2012 23:04:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/vb-net-getgeometry-only-returns-a-shapebuffer/m-p/738928#M1169</guid>
      <dc:creator>DavidTriggs</dc:creator>
      <dc:date>2012-05-17T23:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: VB.Net - GetGeometry only returns a ShapeBuffer</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/vb-net-getgeometry-only-returns-a-shapebuffer/m-p/738929#M1170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I have been playing with the API in VB.net and can not get a geometry from the GetGeometry() function.&lt;BR /&gt;&lt;BR /&gt;According to the C# examples:&lt;BR /&gt;PointShapeBuffer pointGeometry = row.GetGeometry();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; point = pointGeometry.point;&lt;BR /&gt;&lt;BR /&gt;In Vb.net the GetGeometry function explicity states it returns a ShapeBuffer. It will not accept a CType converstion to PointShapeBuffer, and will not accept a PointShapeBuffer as an output. The Help states the Geometry function returns a ShapeBuffer so I do not understand how to get a point from (Get)Geometry function.&lt;BR /&gt;&lt;BR /&gt;Any advice would be appreciated. &lt;BR /&gt;&lt;BR /&gt;David&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi David,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am running into a very similar issue on casting ShapeBuffer to MultipartBuffer. I find the cast works with .NET Wrapper-C#, but not with VB.net. I don't know why exactly the cast fails with VB.net, and I am trying to find out too. I guess it has something to do with generated C++\CLI .NET code. But, anyway, give C# a try, hope it also fix the issue at your end too. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 12:31:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/vb-net-getgeometry-only-returns-a-shapebuffer/m-p/738929#M1170</guid>
      <dc:creator>SiqiLi</dc:creator>
      <dc:date>2012-08-16T12:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: VB.Net - GetGeometry only returns a ShapeBuffer</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/vb-net-getgeometry-only-returns-a-shapebuffer/m-p/738930#M1171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anyone still having problems with this in VB.Net?&amp;nbsp; I ran on to the same problem with version 1.4 as well as 1.5. I wrote a C# DLL with some "Get Geometry" functions to deal with all the buffer types.&amp;nbsp; One point to note is that when the new geometry is returned, it still shows as a ShapeBuffer in debugging, but you can still access the PointShapeBuffer, MultiPointShapeBuffer, MultiPartShapeBuffer, MultiPatchShapeBuffer properties regardless.&amp;nbsp; I hope this helps someone:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Usage:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Imports ESRIFileGDB.ConvertShapeBuffer&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Dim geometry As New PointShapeBuffer = GetPointGeometry(row)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;ESRIFileGDB.cs&lt;/P&gt;&lt;P&gt;===============================&lt;/P&gt;&lt;P&gt;using System;&lt;BR /&gt;using System.Collections.Generic;&lt;BR /&gt;using System.Linq;&lt;BR /&gt;using System.Text;&lt;BR /&gt;using System.Threading.Tasks;&lt;BR /&gt;using Esri.FileGDB;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;namespace ESRIFileGDB&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public class ConvertShapeBuffer&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public ConvertShapeBuffer()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static PointShapeBuffer GetPointGeometry(ref Esri.FileGDB.Row shapeRow)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PointShapeBuffer pointGeometry = shapeRow.GetGeometry();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return pointGeometry;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static MultiPointShapeBuffer GetMultiPointGeometry(ref Esri.FileGDB.Row shapeRow)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MultiPointShapeBuffer multipointGeometry = shapeRow.GetGeometry();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return multipointGeometry;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static MultiPatchShapeBuffer GetMultiPatchGeometry(ref Esri.FileGDB.Row shapeRow)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MultiPatchShapeBuffer patchGeometry = shapeRow.GetGeometry();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return patchGeometry;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static MultiPartShapeBuffer GetMultiPartGeometry(ref Esri.FileGDB.Row shapeRow)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MultiPartShapeBuffer multipartGeometry = shapeRow.GetGeometry();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return multipartGeometry;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;===========================================================&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jul 2017 15:27:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/vb-net-getgeometry-only-returns-a-shapebuffer/m-p/738930#M1171</guid>
      <dc:creator>WillFreeman</dc:creator>
      <dc:date>2017-07-28T15:27:07Z</dc:date>
    </item>
  </channel>
</rss>

