Select to view content in your preferred language

Spatial Reference Info

3523
11
02-18-2011 01:28 AM
ahuarte
Deactivated User
Hi!

I need read the SpatialReference info of a FeatureClass.

XML samples in the doc-SDK contains this description (WKT, WKID...) but calling to Table::GetDefinition() function it always returns no data.

I have test all sample gdb files and other personal gdb files FgdbV10.
What it's wrong?

thank you very much
0 Kudos
11 Replies
ahuarte
Deactivated User
Hi!
I test Table::GetDefinition() in the ExecutingSQL sample and it works OK.

I got to know how it fails!
I'm developing a C++ CLI/.NET with a 'ref class' which handle the FileGDBAPI::Table*.

This 'ref class' has two data member...

  FileGDBAPI:: Database*
  FileGDBAPI:: Table*

The database and table are open correctly. Envelope, RowCount, Search ... work fine!
Only "Table::GetDefinition()" return error.


if instead of using a database* I use database&, it work fine :confused:

I can rewrite the code, but I still question why the failure

thank you ver much!!!!
0 Kudos
SasaI_
by
Emerging Contributor
I just replied to the .NET Wrapper thread with this, but here is the summary:

It seems you must prefix the table name with a "\".  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").  If you don't prefix the path with a "\", the table opens successfully AND the table definition is populated properly from the GetDefinition call.  However, the result code is -2147211775, indicating the path is not found.  Prefixing the table will make the function return 0.

This is made even more confusing with the samples opening the table by using both L"Cities" (Display/Querying) and L"\\Cities" (Editing).
0 Kudos