<?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 How to get Projection Details(GCS / PCS) using file Geodtabase API. in File Geodatabase API Questions</title>
    <link>https://community.esri.com/t5/file-geodatabase-api-questions/how-to-get-projection-details-gcs-pcs-using-file/m-p/333900#M564</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I would like to get the spatial reference of the feature class using file Geodtabase API.I am using FGDB API 1.4 and C# VS 2010. I have tried to use FieldDef to get Spatial Reference but receiving null error. Please guide me. Also attaching the error message.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="80574" alt="Untitled.jpg" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/80574_Untitled.jpg" style="width: 620px; height: 236px;" /&gt;&lt;/P&gt;&lt;P&gt;string fcName = gdbFCList[2].Remove(0, 1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table fcTable = _geodatabase.OpenTable(fcName);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FieldInfo fieldInfo = fcTable.FieldInformation as FieldInfo;&lt;/P&gt;&lt;P&gt;FieldDef[] fieldDefs=fcTable.FieldDefs;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also tried following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;string spr = fcTable.FieldDefs[2].geometryDef.spatialReference.ToString();&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Mar 2015 14:28:59 GMT</pubDate>
    <dc:creator>GaneshmoorthiM</dc:creator>
    <dc:date>2015-03-31T14:28:59Z</dc:date>
    <item>
      <title>How to get Projection Details(GCS / PCS) using file Geodtabase API.</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/how-to-get-projection-details-gcs-pcs-using-file/m-p/333900#M564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I would like to get the spatial reference of the feature class using file Geodtabase API.I am using FGDB API 1.4 and C# VS 2010. I have tried to use FieldDef to get Spatial Reference but receiving null error. Please guide me. Also attaching the error message.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="80574" alt="Untitled.jpg" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/80574_Untitled.jpg" style="width: 620px; height: 236px;" /&gt;&lt;/P&gt;&lt;P&gt;string fcName = gdbFCList[2].Remove(0, 1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table fcTable = _geodatabase.OpenTable(fcName);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FieldInfo fieldInfo = fcTable.FieldInformation as FieldInfo;&lt;/P&gt;&lt;P&gt;FieldDef[] fieldDefs=fcTable.FieldDefs;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also tried following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;string spr = fcTable.FieldDefs[2].geometryDef.spatialReference.ToString();&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 14:28:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/how-to-get-projection-details-gcs-pcs-using-file/m-p/333900#M564</guid>
      <dc:creator>GaneshmoorthiM</dc:creator>
      <dc:date>2015-03-31T14:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Projection Details(GCS / PCS) using file Geodtabase API.</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/how-to-get-projection-details-gcs-pcs-using-file/m-p/333901#M565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's difficult to tell from your question what error was generated from what code.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While a ToString exists on all objects, the documentation offers a SpatialReferenceText property to return "The Text Representation of the Spatial Reference System."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can post a more complete example, either using the sample data included with the API, or with your data included in the question, and for testing purposes, with each object in the retrieval process as it's own object, with error trapping at each stage, and with the complete output of the test, we'll probably be better able to help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 02:12:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/how-to-get-projection-details-gcs-pcs-using-file/m-p/333901#M565</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2015-04-01T02:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Projection Details(GCS / PCS) using file Geodtabase API.</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/how-to-get-projection-details-gcs-pcs-using-file/m-p/333902#M566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You didn't include your output, and your code still assumes that the geometry field will be in the third column (array radix 2).&amp;nbsp; If you don't test the column type of the columns, and attempt to extract a coordinate reference from a string field, a null GeometryDef is the correct response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- V &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 12:49:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/how-to-get-projection-details-gcs-pcs-using-file/m-p/333902#M566</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2015-04-01T12:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Projection Details(GCS / PCS) using file Geodtabase API.</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/how-to-get-projection-details-gcs-pcs-using-file/m-p/333903#M567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am facing problem with FieldDef&amp;nbsp; and it throw null while assigning to FieldDefs (FieldDef[] fieldDefs = fcTable.FieldDefs; ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have declared it after validating geometry. But still receiving the same null error in the FieldDef.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My out put is get the spatial reference/Projection Name of Feature class or Feature Dataset as a string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the attached updated code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 13:35:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/how-to-get-projection-details-gcs-pcs-using-file/m-p/333903#M567</guid>
      <dc:creator>GaneshmoorthiM</dc:creator>
      <dc:date>2015-04-01T13:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Projection Details(GCS / PCS) using file Geodtabase API.</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/how-to-get-projection-details-gcs-pcs-using-file/m-p/333904#M568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Best practice is to construct a simple test without extraneous function calls, so that the operation order is clearly evident.&amp;nbsp; Adapting existing code is fine, if the file is renamed and the fat trimmed away.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As this question has morphed from proper method invocation to a casting issue, I'm going to have to leave it to someone who uses C# to review what may be wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 14:02:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/how-to-get-projection-details-gcs-pcs-using-file/m-p/333904#M568</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2015-04-01T14:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Projection Details(GCS / PCS) using file Geodtabase API.</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/how-to-get-projection-details-gcs-pcs-using-file/m-p/333905#M569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The code throws null error when i try to cast FieldDef ( FieldDef[] fieldDefs =fcTable.FieldDefs;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While debugging, the definition( FieldDefs, IndexDef)properties in the Esri:FileGDB:Table getting null values (Also tried with other C# samples provide with File Geodatabase API). Can any one tell me why it is throwing null value and can i&amp;nbsp; get Spatial Reference Details using File GeoDatabase API without using FieldDefs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 15:12:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/how-to-get-projection-details-gcs-pcs-using-file/m-p/333905#M569</guid>
      <dc:creator>GaneshmoorthiM</dc:creator>
      <dc:date>2015-04-01T15:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Projection Details(GCS / PCS) using file Geodtabase API.</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/how-to-get-projection-details-gcs-pcs-using-file/m-p/333906#M570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/people/gm.moorthi"&gt;gm.moorthi&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I'm having the same issue. Whenever I try to access&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;FieldDefs, its null.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Did you solve this?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2017 15:37:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/how-to-get-projection-details-gcs-pcs-using-file/m-p/333906#M570</guid>
      <dc:creator>DonnyVelazquez</dc:creator>
      <dc:date>2017-05-17T15:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Projection Details(GCS / PCS) using file Geodtabase API.</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/how-to-get-projection-details-gcs-pcs-using-file/m-p/333907#M571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;.........&lt;/P&gt;&lt;P&gt;Table table = geodatabase.OpenTable(&lt;A href="https://community.esri.com/"&gt;\\featuredatasetname&lt;/A&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// get table definition anp put in&amp;nbsp;xml&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt; var ds = table.Definition;&lt;BR /&gt;var xmlDocument = new XmlDocument();&lt;BR /&gt;xmlDocument.LoadXml(ds);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//parse xml nodes&lt;/P&gt;&lt;P&gt;/*&lt;/P&gt;&lt;P&gt;&lt;EM&gt;...&lt;/EM&gt;&lt;/P&gt;&lt;DIV&gt;&lt;EM&gt;&amp;lt;SpatialReference xsi:type="esri:GeographicCoordinateSystem"&amp;gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;lt;WKT&amp;gt;GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",.......&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;........&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;lt;WKID&amp;gt;4326&amp;lt;/WKID&amp;gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;lt;/SpatialReference&amp;gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 May 2017 13:16:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/how-to-get-projection-details-gcs-pcs-using-file/m-p/333907#M571</guid>
      <dc:creator>UkrgeoconsultingLtd_</dc:creator>
      <dc:date>2017-05-21T13:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Projection Details(GCS / PCS) using file Geodtabase API.</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/how-to-get-projection-details-gcs-pcs-using-file/m-p/333908#M572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;And I'm having the same issue. Whenever I try to access&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;FieldDefs, its null&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jun 2018 14:14:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/how-to-get-projection-details-gcs-pcs-using-file/m-p/333908#M572</guid>
      <dc:creator>MichaelBarsky</dc:creator>
      <dc:date>2018-06-01T14:14:03Z</dc:date>
    </item>
  </channel>
</rss>

