<?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 Spatial Reference Object Creation Error (arcpy) in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/spatial-reference-object-creation-error-arcpy/m-p/145756#M11363</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently attempting to create a Python script tool that takes a user-specified GPX file (GPS data), and converts this data into ArcGIS features, which need to be in a specific coordinate system. I understand that there is a 'GPX to Features' Conversion tool within ArcToolbox, but the added funbtionality of the tool will be that the user will also be able to specify if they would like the data (which is always an array of points if collected as lines or polygons) converted into line features or polygon features. I work in county government, and my intentions are to share this tool with users in different departments who regularly collect GPX data and would like the above functionality within the framework of a single script tool. I am currently having some problems with the code I have written. The script runs correctly until reaching the point in which a spatial reference object must be created with the correct projection, at which point i get the error: RuntimeError: ERROR 999999: Error executing function. Here is the code that I have so far:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;import os&lt;/P&gt;&lt;P&gt;import sys&lt;/P&gt;&lt;P&gt;import traceback&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Set variables&lt;/P&gt;&lt;P&gt;GPX = arcpy.GetParameterAsText(0)&amp;nbsp;&amp;nbsp; # User-specified GPX file&lt;/P&gt;&lt;P&gt;outlocGDB = arcpy.GetParameterAsText(1) # Output workspce to store GDB&lt;/P&gt;&lt;P&gt;fcnm = arcpy.GetParameterAsText(2)&amp;nbsp; # Name/location of the feature class that is to be created&lt;/P&gt;&lt;P&gt;##que = ##arcpy.GetParameterAsText(3)&amp;nbsp;&amp;nbsp; # "Would you like to display you input GPX file as a Line Feature Class in ArcGIS?"&lt;/P&gt;&lt;P&gt;##que1 = ##arcpy.GetParameterAsText(4)&amp;nbsp; # "Would you like to display your input GPX file as a Polygon Feature Class in ArcGIS?"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Create new File Geodatabase to store the output data&lt;/P&gt;&lt;P&gt;GDB = arcpy.CreateFileGDB_management(outlocGDB, "GPXFeatures")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;outgdb = GDB.getOutput(0)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Derive output of creation of File Geodatabase above&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;outfile = os.path.join(outgdb, fcnm) # output feature class for GPX to Features conversion&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Convert GPX files into features&lt;/P&gt;&lt;P&gt;arcpy.GPXtoFeatures_conversion(GPX, outfile)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Set variables in preparation for projection operation&lt;/P&gt;&lt;P&gt;outprj = os.path.join(outgdb, str(fcnm) + "_prj")&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Create output name for projected version of above Feature Class&lt;/P&gt;&lt;P&gt;outSR = arcpy.SpatialReference("NAD_1983_StatePlane_Virginia_North_FIPS_4501_Feet")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# PROJECT DATA&lt;/P&gt;&lt;P&gt;arcpy.Project_management(outfile, outprj, outSR, "WGS_1984_(ITRF00)_To_NAD_1983")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any sort of help would be greatly appreciated. Thanks so much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Jacob Snyder&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Sep 2015 17:28:12 GMT</pubDate>
    <dc:creator>JacobSnyder2</dc:creator>
    <dc:date>2015-09-02T17:28:12Z</dc:date>
    <item>
      <title>Spatial Reference Object Creation Error (arcpy)</title>
      <link>https://community.esri.com/t5/python-questions/spatial-reference-object-creation-error-arcpy/m-p/145756#M11363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently attempting to create a Python script tool that takes a user-specified GPX file (GPS data), and converts this data into ArcGIS features, which need to be in a specific coordinate system. I understand that there is a 'GPX to Features' Conversion tool within ArcToolbox, but the added funbtionality of the tool will be that the user will also be able to specify if they would like the data (which is always an array of points if collected as lines or polygons) converted into line features or polygon features. I work in county government, and my intentions are to share this tool with users in different departments who regularly collect GPX data and would like the above functionality within the framework of a single script tool. I am currently having some problems with the code I have written. The script runs correctly until reaching the point in which a spatial reference object must be created with the correct projection, at which point i get the error: RuntimeError: ERROR 999999: Error executing function. Here is the code that I have so far:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;import os&lt;/P&gt;&lt;P&gt;import sys&lt;/P&gt;&lt;P&gt;import traceback&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Set variables&lt;/P&gt;&lt;P&gt;GPX = arcpy.GetParameterAsText(0)&amp;nbsp;&amp;nbsp; # User-specified GPX file&lt;/P&gt;&lt;P&gt;outlocGDB = arcpy.GetParameterAsText(1) # Output workspce to store GDB&lt;/P&gt;&lt;P&gt;fcnm = arcpy.GetParameterAsText(2)&amp;nbsp; # Name/location of the feature class that is to be created&lt;/P&gt;&lt;P&gt;##que = ##arcpy.GetParameterAsText(3)&amp;nbsp;&amp;nbsp; # "Would you like to display you input GPX file as a Line Feature Class in ArcGIS?"&lt;/P&gt;&lt;P&gt;##que1 = ##arcpy.GetParameterAsText(4)&amp;nbsp; # "Would you like to display your input GPX file as a Polygon Feature Class in ArcGIS?"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Create new File Geodatabase to store the output data&lt;/P&gt;&lt;P&gt;GDB = arcpy.CreateFileGDB_management(outlocGDB, "GPXFeatures")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;outgdb = GDB.getOutput(0)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Derive output of creation of File Geodatabase above&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;outfile = os.path.join(outgdb, fcnm) # output feature class for GPX to Features conversion&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Convert GPX files into features&lt;/P&gt;&lt;P&gt;arcpy.GPXtoFeatures_conversion(GPX, outfile)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Set variables in preparation for projection operation&lt;/P&gt;&lt;P&gt;outprj = os.path.join(outgdb, str(fcnm) + "_prj")&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Create output name for projected version of above Feature Class&lt;/P&gt;&lt;P&gt;outSR = arcpy.SpatialReference("NAD_1983_StatePlane_Virginia_North_FIPS_4501_Feet")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# PROJECT DATA&lt;/P&gt;&lt;P&gt;arcpy.Project_management(outfile, outprj, outSR, "WGS_1984_(ITRF00)_To_NAD_1983")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any sort of help would be greatly appreciated. Thanks so much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Jacob Snyder&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Sep 2015 17:28:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/spatial-reference-object-creation-error-arcpy/m-p/145756#M11363</guid>
      <dc:creator>JacobSnyder2</dc:creator>
      <dc:date>2015-09-02T17:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Reference Object Creation Error (arcpy)</title>
      <link>https://community.esri.com/t5/python-questions/spatial-reference-object-creation-error-arcpy/m-p/145757#M11364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's a little murky in the documentation, but judging from the example "&lt;CODE style="font-size: 10.8680000305176px;"&gt;&lt;SPAN class="s" style="font-size: 10.8680000305176px; color: #a31515;"&gt;Hawaii Albers Equal Area Conic&lt;/SPAN&gt;&lt;/CODE&gt;" the name of your coordinate system should be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="_jivemacro_uid_14412154223752082 jive_macro_code jive_text_macro" data-renderedposition="71_8_912_16" jivemacro_uid="_14412154223752082"&gt;&lt;P&gt;outSR = arcpy.SpatialReference("NAD 1983 StatePlane Virginia North FIPS 4501 (US Feet)")&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Sep 2015 17:37:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/spatial-reference-object-creation-error-arcpy/m-p/145757#M11364</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-09-02T17:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Reference Object Creation Error (arcpy)</title>
      <link>https://community.esri.com/t5/python-questions/spatial-reference-object-creation-error-arcpy/m-p/145758#M11365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your help!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Sep 2015 17:55:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/spatial-reference-object-creation-error-arcpy/m-p/145758#M11365</guid>
      <dc:creator>JacobSnyder2</dc:creator>
      <dc:date>2015-09-02T17:55:56Z</dc:date>
    </item>
  </channel>
</rss>

