<?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: Spatial Reference Info in File Geodatabase API Questions</title>
    <link>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186620#M358</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do the samples execute? This is important. We have tested the samples on most Windows platforms and have never seen a problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Feb 2011 14:28:47 GMT</pubDate>
    <dc:creator>LanceShipman</dc:creator>
    <dc:date>2011-02-25T14:28:47Z</dc:date>
    <item>
      <title>Spatial Reference Info</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186611#M349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need read the SpatialReference info of a FeatureClass.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;XML samples in the doc-SDK contains this description (WKT, WKID...) but calling to Table::GetDefinition() function it always returns no data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have test all sample gdb files and other personal gdb files FgdbV10.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What it's wrong?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you very much&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Feb 2011 09:28:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186611#M349</guid>
      <dc:creator>ahuarte</dc:creator>
      <dc:date>2011-02-18T09:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Reference Info</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186612#M350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The following code produces XML with the spatial information:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; // Open the geodatabase.
&amp;nbsp; int hr;
&amp;nbsp; Geodatabase geodatabase;
&amp;nbsp; if ((hr = OpenGeodatabase(L"../data/ctg94AllDataset.gdb", geodatabase)) != S_OK)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; wcout &amp;lt;&amp;lt; "An error occurred while opening the geodatabase." &amp;lt;&amp;lt; endl;
&amp;nbsp;&amp;nbsp;&amp;nbsp; wcout &amp;lt;&amp;lt; "Error code: " &amp;lt;&amp;lt; hr &amp;lt;&amp;lt; endl;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return -1;
&amp;nbsp; }

&amp;nbsp; // Open the ManyFieldTypes table.
&amp;nbsp; Table table;
&amp;nbsp; if ((hr = geodatabase.OpenTable(L"\\ctg83FDS\\ctg83FCinTopo", table)) != S_OK)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; wcout &amp;lt;&amp;lt; "An error occurred while opening the table." &amp;lt;&amp;lt; endl;
&amp;nbsp;&amp;nbsp;&amp;nbsp; wcout &amp;lt;&amp;lt; "Error code: " &amp;lt;&amp;lt; hr &amp;lt;&amp;lt; endl;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return -1;
&amp;nbsp; }

&amp;nbsp; // GetDefitition
&amp;nbsp; wcout &amp;lt;&amp;lt; "Test GetDefitition:" &amp;lt;&amp;lt; endl;
&amp;nbsp; string xmlDef;
&amp;nbsp; if ((hr = table.GetDefinition(xmlDef)) != S_OK)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; wcout &amp;lt;&amp;lt; "An error occurred getting the table definition." &amp;lt;&amp;lt; endl;
&amp;nbsp;&amp;nbsp;&amp;nbsp; wcout &amp;lt;&amp;lt; "Error code: " &amp;lt;&amp;lt; hr &amp;lt;&amp;lt; endl;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return -1;
&amp;nbsp; }

&amp;nbsp; cout &amp;lt;&amp;lt; xmlDef &amp;lt;&amp;lt; endl;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've attached the XML that this code produces.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:27:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186612#M350</guid>
      <dc:creator>LanceShipman</dc:creator>
      <dc:date>2021-12-11T09:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Reference Info</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186613#M351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thanks your reply&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am confused. I get this XML reading the ExecuteSQL-cities gdb sample from the sdk.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It have not WKT and WKID info and Table::getDefinition returns me the -2147211775 error code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The table was opened success.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All samples from SDK and my gdbv10 files return equals.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;why ¿?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Feb 2011 16:18:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186613#M351</guid>
      <dc:creator>ahuarte</dc:creator>
      <dc:date>2011-02-19T16:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Reference Info</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186614#M352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;thanks your reply&lt;BR /&gt;&lt;BR /&gt;I am confused. I get this XML reading the ExecuteSQL-cities gdb sample from the sdk.&lt;BR /&gt;&lt;BR /&gt;It have not WKT and WKID info and Table::getDefinition returns me the -2147211775 error code.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;What beta are you using we have released 2. I get the WKT in the XML. When does the error get returned? It's an item not found error. Can you post your code?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;All samples from SDK and my gdbv10 files return equals.&lt;BR /&gt;why ¿?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm sorry, I don't understand. What returns equals?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 15:54:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186614#M352</guid>
      <dc:creator>LanceShipman</dc:creator>
      <dc:date>2011-02-22T15:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Reference Info</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186615#M353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I use the beta release 2. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;my code...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; std::wstring tempString = L"";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Helper_MarshalString(tableName, tempString);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; m_pDatabase = database-&amp;gt;m_pDatabase;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; m_pTable = new FileGDBAPI::Table();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; long hr = m_pDatabase-&amp;gt;OpenTable(tempString, *m_pTable);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; if (hr==S_OK) return false;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; std::string tempString2 = "";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; long hr = m_pTable-&amp;gt;GetDefinition(tempString2); //-&amp;gt; ### ERROR -2147211775 &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;tempString2 has XML content but NO WKT info!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;all samples and my FGDB files (Imported in ArcCatalog 10 from shapefiles) return this error. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry my bad english!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you very much&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 21:41:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186615#M353</guid>
      <dc:creator>ahuarte</dc:creator>
      <dc:date>2011-02-22T21:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Reference Info</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186616#M354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I use the beta release 2. &lt;BR /&gt;&lt;BR /&gt;my code...&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; std::wstring tempString = L"";&lt;BR /&gt;&amp;nbsp; Helper_MarshalString(tableName, tempString);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; m_pDatabase = database-&amp;gt;m_pDatabase;&lt;BR /&gt;&amp;nbsp; m_pTable = new FileGDBAPI::Table();&lt;BR /&gt;&amp;nbsp; long hr = m_pDatabase-&amp;gt;OpenTable(tempString, *m_pTable);&lt;BR /&gt;&amp;nbsp; if (hr==S_OK) return false;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; std::string tempString2 = "";&lt;BR /&gt;&amp;nbsp; long hr = m_pTable-&amp;gt;GetDefinition(tempString2); //-&amp;gt; ### ERROR -2147211775 &lt;BR /&gt;&lt;BR /&gt;tempString2 has XML content but NO WKT info!&lt;BR /&gt;all samples and my FGDB files (Imported in ArcCatalog 10 from shapefiles) return this error. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sorry my bad english!&lt;BR /&gt;Thank you very much&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What version of Winodow and Visual Studio are you using?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Feb 2011 00:06:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186616#M354</guid>
      <dc:creator>LanceShipman</dc:creator>
      <dc:date>2011-02-23T00:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Reference Info</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186617#M355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I use&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Windows XP 32bits SP3 (spanish)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Visual Studio 2008 9.0.30729.1 SP (english)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Feb 2011 09:24:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186617#M355</guid>
      <dc:creator>ahuarte</dc:creator>
      <dc:date>2011-02-23T09:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Reference Info</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186618#M356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;std::wstring tempString = L"";
Helper_MarshalString(tableName, tempString);

m_pDatabase = database-&amp;gt;m_pDatabase;
m_pTable = new FileGDBAPI::Table();
long hr = m_pDatabase-&amp;gt;OpenTable(tempString, *m_pTable);
if (hr==S_OK) return false; &amp;lt;- this is incorrect. 

std::string tempString2 = "";
long hr = m_pTable-&amp;gt;GetDefinition(tempString2); //-&amp;gt; ### ERROR -2147211775&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if (hr != S_OK) return false &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;S_OK (0) indicates success. The likely problem is that the table name is incorrect. Using&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if(hr==S_OK) return false&lt;/PRE&gt;&lt;SPAN&gt; the code will only continue executing if OpenTable fails. Any results from the GetDefinition is an error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do the samples execute for you?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:27:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186618#M356</guid>
      <dc:creator>LanceShipman</dc:creator>
      <dc:date>2021-12-11T09:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Reference Info</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186619#M357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm sorry, I copied the wrong code. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please, ignore... "if (hr==S_OK) return false;" &amp;lt;- this is incorrect&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;XML file that I sent is the example "ExecuteSQL.gdb"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thak you very much!!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Feb 2011 05:27:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186619#M357</guid>
      <dc:creator>ahuarte</dc:creator>
      <dc:date>2011-02-25T05:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Reference Info</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186620#M358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do the samples execute? This is important. We have tested the samples on most Windows platforms and have never seen a problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Feb 2011 14:28:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186620#M358</guid>
      <dc:creator>LanceShipman</dc:creator>
      <dc:date>2011-02-25T14:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Reference Info</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186621#M359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I test Table::GetDefinition() in the ExecutingSQL sample and it works OK.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I got to know how it fails!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm developing a C++ CLI/.NET with a 'ref class' which handle the FileGDBAPI::Table*.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This 'ref class' has two data member...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; FileGDBAPI:: Database*&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; FileGDBAPI:: Table*&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The database and table are open correctly. Envelope, RowCount, Search ... work fine!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Only "Table::GetDefinition()" return error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if instead of using a database* I use database&amp;amp;, it work fine :confused:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can rewrite the code, but I still question why the failure&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you ver much!!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2011 13:11:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186621#M359</guid>
      <dc:creator>ahuarte</dc:creator>
      <dc:date>2011-03-01T13:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Reference Info</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186622#M360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I just replied to the .NET Wrapper thread with this, but here is the summary:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems you must prefix the table name with a "\".&amp;nbsp; So in case of the ExecuteSQL.gdb database, if you want to open the cities table you'll want to make the call as OpenTable(L"\\Cities").&amp;nbsp; If you don't prefix the path with a "\", the table opens successfully AND the table definition is populated properly from the GetDefinition call.&amp;nbsp; However, the result code is -2147211775, indicating the path is not found.&amp;nbsp; Prefixing the table will make the function return 0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is made even more confusing with the samples opening the table by using both L"Cities" (Display/Querying) and L"\\Cities" (Editing).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2011 12:41:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/spatial-reference-info/m-p/186622#M360</guid>
      <dc:creator>SasaI_</dc:creator>
      <dc:date>2011-03-02T12:41:16Z</dc:date>
    </item>
  </channel>
</rss>

