<?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 Can I create a spatialreference from an existing prj file? in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-i-create-a-spatialreference-from-an-existing/m-p/1178065#M8199</link>
    <description>&lt;P&gt;When developing under ArcMap, we used to be able to create a spatialreference from a prj file just like in this example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;pSpatialReference = pSRFact.CreateESRISpatialReferenceFromPRJFile(_sPrjFile);&lt;/P&gt;&lt;P&gt;But when I look at the documentation for ArcGIS Pro SDK, I only see that in order to create a spatial reference, the most common way of doing it is using a wkid number.&lt;/P&gt;&lt;P&gt;Can I do it using a prj file, or am I missing something here?&lt;/P&gt;</description>
    <pubDate>Fri, 27 May 2022 19:18:29 GMT</pubDate>
    <dc:creator>MarioLandry2</dc:creator>
    <dc:date>2022-05-27T19:18:29Z</dc:date>
    <item>
      <title>Can I create a spatialreference from an existing prj file?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-i-create-a-spatialreference-from-an-existing/m-p/1178065#M8199</link>
      <description>&lt;P&gt;When developing under ArcMap, we used to be able to create a spatialreference from a prj file just like in this example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;pSpatialReference = pSRFact.CreateESRISpatialReferenceFromPRJFile(_sPrjFile);&lt;/P&gt;&lt;P&gt;But when I look at the documentation for ArcGIS Pro SDK, I only see that in order to create a spatial reference, the most common way of doing it is using a wkid number.&lt;/P&gt;&lt;P&gt;Can I do it using a prj file, or am I missing something here?&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 19:18:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-i-create-a-spatialreference-from-an-existing/m-p/1178065#M8199</guid>
      <dc:creator>MarioLandry2</dc:creator>
      <dc:date>2022-05-27T19:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a spatialreference from an existing prj file?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-i-create-a-spatialreference-from-an-existing/m-p/1178230#M8201</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We don't have anything to use the prj file directly, but I believe you should be able to use the following code as the prj file contains text in the wkt format.&amp;nbsp; I have wrapped the CreateSpatialReference call in a try/catch in case of error which would need to be handled.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;      try
      {
        string path = @"c:\60571.prj";
        var sText = System.IO.File.ReadAllText(path);
        SpatialReference sr  = SpatialReferenceBuilder.CreateSpatialReference(sText);
      }
      catch (Exception e)
      {
      }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Narelle&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 03:06:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-i-create-a-spatialreference-from-an-existing/m-p/1178230#M8201</guid>
      <dc:creator>NarelleChedzey</dc:creator>
      <dc:date>2022-05-30T03:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a spatialreference from an existing prj file?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-i-create-a-spatialreference-from-an-existing/m-p/1178312#M8203</link>
      <description>&lt;P&gt;Thanks a lot Narelle. &amp;nbsp;It will work for me.&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 11:45:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-i-create-a-spatialreference-from-an-existing/m-p/1178312#M8203</guid>
      <dc:creator>MarioLandry2</dc:creator>
      <dc:date>2022-05-30T11:45:59Z</dc:date>
    </item>
  </channel>
</rss>

