<?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: Create RestEndPoint Geoprocessing Tool in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/create-restendpoint-geoprocessing-tool/m-p/1246721#M67834</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/562389"&gt;@sxw_eaglegis&lt;/a&gt;&amp;nbsp;- Ok cool... well thats good news in a way that the code seems to be correct... I will give this a shot....Cheers&lt;/P&gt;</description>
    <pubDate>Tue, 10 Jan 2023 12:44:00 GMT</pubDate>
    <dc:creator>kapalczynski</dc:creator>
    <dc:date>2023-01-10T12:44:00Z</dc:date>
    <item>
      <title>Create RestEndPoint Geoprocessing Tool</title>
      <link>https://community.esri.com/t5/python-questions/create-restendpoint-geoprocessing-tool/m-p/1246131#M67829</link>
      <description>&lt;P&gt;I am trying to create a GP Tool that I am trying to publish to Portal.&amp;nbsp; It works in ArcGIS Pro but will not publish...&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I created a new Toolbox&lt;/LI&gt;&lt;LI&gt;I created a New Script in the tool box&lt;/LI&gt;&lt;LI&gt;I set 4 parameters in the Script and set defaults for them&lt;UL&gt;&lt;LI&gt;Parameters&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Default Values&lt;/LI&gt;&lt;LI&gt;in_las&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;&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\Temp\LazToLas\LazFiles&lt;/LI&gt;&lt;LI&gt;target_folder&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\Temp\LazToLas\LazFiles&lt;/LI&gt;&lt;LI&gt;define_coordinate_system&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; ALL_FILES&lt;/LI&gt;&lt;LI&gt;in_coordinate_system&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;GEOGCS["GCS_NAD_1983_2011, DATUM["D_NAD_1983_2011",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I put this code in the Script and when I double click the script in the toolbox it runs fine….Basically converting .laz files to .las files.&lt;/P&gt;&lt;P&gt;I then go to publish this GP Tool to my server and I get these two errors:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT color="#FF0000"&gt;Server version 10.8.1 tool ConvertLas_conversion does not have new parameter in_coordinate_system&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT color="#FF0000"&gt;Server version 10.8.1 tool ConvertLas_conversion does not have new parameter define_coordinate_system&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Why does this run via double clicking the script in the toolbox and fails when I try to publish this?&amp;nbsp; Errors above…..&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;------- Parameters on the Script File in the Toolbox&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kapalczynski_1-1673030156342.png" style="width: 684px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/59900i84B4D5166B0937E6/image-dimensions/684x195?v=v2" width="684" height="195" role="button" title="kapalczynski_1-1673030156342.png" alt="kapalczynski_1-1673030156342.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;------- ERROR:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kapalczynski_0-1673029821531.png" style="width: 552px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/59899iA62C61422CCFD824/image-dimensions/552x218?v=v2" width="552" height="218" role="button" title="kapalczynski_0-1673029821531.png" alt="kapalczynski_0-1673029821531.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;------- CODE:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import arcpy
def ScriptTool(param0, param1, param2, param3):
    
    # Script execution code goes here
    LazFiles = param0
    LasDataset = param1
    defineCoord = param2
    inCoord = param3
    OutputLASDataset_lasd = param1 + "output.lasd"
    
    arcpy.conversion.ConvertLas(in_las=LazFiles, target_folder=LasDataset, file_version="SAME_AS_INPUT", point_format="",compression="NO_COMPRESSION",
                                las_options=["REARRANGE_POINTS"], out_las_dataset=OutputLASDataset_lasd,define_coordinate_system=param2, in_coordinate_system=param3)

    
    return
# This is used to execute code if the file was run but not imported
if __name__ == '__main__':
    # Tool parameter accessed with GetParameter or GetParameterAsText
    param0 = arcpy.GetParameterAsText(0)
    param1 = arcpy.GetParameterAsText(1)
    param2 = arcpy.GetParameterAsText(2)
    param3 = arcpy.GetParameterAsText(3)
"GEOGCS['GCS_NAD_1983_2011',DATUM['D_NAD_1983_2011',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]"
    ScriptTool(param0, param1, param2, param3)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 18:37:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-restendpoint-geoprocessing-tool/m-p/1246131#M67829</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2023-01-06T18:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create RestEndPoint Geoprocessing Tool</title>
      <link>https://community.esri.com/t5/python-questions/create-restendpoint-geoprocessing-tool/m-p/1246345#M67830</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;It might be the version of ArcGIS Server you've got (10.8.1) does not have those two parameters available yet, they may have been added at a later version.&lt;/P&gt;&lt;P&gt;What version of ArcGIS Pro are you using?&lt;/P&gt;&lt;P&gt;Take note of this when publishing geoprocessing services -&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/share-analysis/geoprocessing-service-compatibility.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/share-analysis/geoprocessing-service-compatibility.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 03:14:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-restendpoint-geoprocessing-tool/m-p/1246345#M67830</guid>
      <dc:creator>sxw_eaglegis</dc:creator>
      <dc:date>2023-01-09T03:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create RestEndPoint Geoprocessing Tool</title>
      <link>https://community.esri.com/t5/python-questions/create-restendpoint-geoprocessing-tool/m-p/1246407#M67832</link>
      <description>&lt;UL&gt;&lt;LI&gt;So I removed those two parameters from the tool properties&lt;/LI&gt;&lt;LI&gt;I removed them from my python code&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;I am still getting the error?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using ArcGISPro 2.9.5&lt;/P&gt;&lt;P&gt;We are on ArcGIS Server 10.8.1&lt;/P&gt;&lt;P&gt;Is this issue related to the version of Pro and Server?&amp;nbsp; One is expecting the 2 extra parameters and the other is expecting neither?&lt;/P&gt;&lt;P&gt;I thought by removing them from the script it would work but still getting the errors....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kapalczynski_0-1673268724457.png" style="width: 617px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/59951iD6596FAED313A04B/image-dimensions/617x372?v=v2" width="617" height="372" role="button" title="kapalczynski_0-1673268724457.png" alt="kapalczynski_0-1673268724457.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
def ScriptTool(param0, param1):
    print(param0)
    print(param1)
    LazFiles = param0
    LasDataset = param1
    OutputLASDataset_lasd = param1 + "output.lasd"
    
    arcpy.conversion.ConvertLas(in_las=LazFiles, target_folder=LasDataset, file_version="SAME_AS_INPUT", point_format="",compression="NO_COMPRESSION",
                                las_options=["REARRANGE_POINTS"], out_las_dataset=OutputLASDataset_lasd)   
    return

# This is used to execute code if the file was run but not imported
if __name__ == '__main__':
    # Tool parameter accessed with GetParameter or GetParameterAsText
    param0 = arcpy.GetParameterAsText(0)
    param1 = arcpy.GetParameterAsText(1)

    ScriptTool(param0, param1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kapalczynski_2-1673268919941.png" style="width: 730px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/59954i8C64DA4AB6F6293A/image-dimensions/730x394?v=v2" width="730" height="394" role="button" title="kapalczynski_2-1673268919941.png" alt="kapalczynski_2-1673268919941.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 13:04:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-restendpoint-geoprocessing-tool/m-p/1246407#M67832</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2023-01-09T13:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create RestEndPoint Geoprocessing Tool</title>
      <link>https://community.esri.com/t5/python-questions/create-restendpoint-geoprocessing-tool/m-p/1246662#M67833</link>
      <description>&lt;P&gt;Yeah it looks like the spatial reference parameters were added to the convert LAS tool at ArcGIS Server 10.9.&lt;/P&gt;&lt;P&gt;I believe you'll need to publish from ArcGIS Pro 2.7 or lower (ideally 2.7 or 2.6) to get that to work.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 03:03:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-restendpoint-geoprocessing-tool/m-p/1246662#M67833</guid>
      <dc:creator>sxw_eaglegis</dc:creator>
      <dc:date>2023-01-10T03:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Create RestEndPoint Geoprocessing Tool</title>
      <link>https://community.esri.com/t5/python-questions/create-restendpoint-geoprocessing-tool/m-p/1246721#M67834</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/562389"&gt;@sxw_eaglegis&lt;/a&gt;&amp;nbsp;- Ok cool... well thats good news in a way that the code seems to be correct... I will give this a shot....Cheers&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 12:44:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-restendpoint-geoprocessing-tool/m-p/1246721#M67834</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2023-01-10T12:44:00Z</dc:date>
    </item>
  </channel>
</rss>

