<?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: Final Geoprocessing output parameter is not generating Url  to download the file. in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/final-geoprocessing-output-parameter-is-not/m-p/1387972#M27186</link>
    <description>&lt;P&gt;Have you create an output in the scratch environment?&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;%scatchGDB%&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp; for gdb or&amp;nbsp;&lt;STRONG&gt;%scatchFolder%&lt;/STRONG&gt; for folder&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/scratch-gdb-in-modelbuilder/td-p/1139310" target="_blank"&gt;Solved: Scratch GDB in Modelbuilder - Esri Community&lt;/A&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Either shp file or gdb you need to put it in the scratch environment&lt;/P&gt;&lt;P&gt;Hope it helps you&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
    <pubDate>Wed, 28 Feb 2024 12:29:27 GMT</pubDate>
    <dc:creator>AlexanderDanielPratama</dc:creator>
    <dc:date>2024-02-28T12:29:27Z</dc:date>
    <item>
      <title>Final Geoprocessing output parameter is not generating Url  to download the file.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/final-geoprocessing-output-parameter-is-not/m-p/1387227#M27179</link>
      <description>&lt;P&gt;The model tool is created and Geoprocessing service is published.&lt;/P&gt;&lt;P&gt;The final out put of tool is File geodatabase .gdb and downloads on browser&lt;/P&gt;&lt;P&gt;Kindly assist the final output parameter is not generating Url&amp;nbsp; to download the file.&lt;/P&gt;&lt;P&gt;ArcMap8.1,ArcGis enterprise 10.8.1&lt;/P&gt;&lt;P&gt;T&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 837px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/95927i2E5E3DAC51FB9494/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 07:10:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/final-geoprocessing-output-parameter-is-not/m-p/1387227#M27179</guid>
      <dc:creator>MohammedAbdul</dc:creator>
      <dc:date>2024-02-27T07:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Final Geoprocessing output parameter is not generating Url  to download the file.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/final-geoprocessing-output-parameter-is-not/m-p/1387972#M27186</link>
      <description>&lt;P&gt;Have you create an output in the scratch environment?&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;%scatchGDB%&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp; for gdb or&amp;nbsp;&lt;STRONG&gt;%scatchFolder%&lt;/STRONG&gt; for folder&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/scratch-gdb-in-modelbuilder/td-p/1139310" target="_blank"&gt;Solved: Scratch GDB in Modelbuilder - Esri Community&lt;/A&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Either shp file or gdb you need to put it in the scratch environment&lt;/P&gt;&lt;P&gt;Hope it helps you&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 12:29:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/final-geoprocessing-output-parameter-is-not/m-p/1387972#M27186</guid>
      <dc:creator>AlexanderDanielPratama</dc:creator>
      <dc:date>2024-02-28T12:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: Final Geoprocessing output parameter is not generating Url  to download the file.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/final-geoprocessing-output-parameter-is-not/m-p/1388533#M27188</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your support.it is updated with scratchGDB workspace env , still output url is not generated in map service as shown below&lt;/P&gt;&lt;P&gt;Kindly suggest&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/96242i54B043103229A882/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 06:05:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/final-geoprocessing-output-parameter-is-not/m-p/1388533#M27188</guid>
      <dc:creator>MohammedAbdul</dc:creator>
      <dc:date>2024-02-29T06:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Final Geoprocessing output parameter is not generating Url  to download the file.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/final-geoprocessing-output-parameter-is-not/m-p/1391676#M27200</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I resolved myself as below ,Just incase it can be helpful to anyone&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcgisscripting
import arcpy
import os
import sys
import traceback
import zipfile
import re
import shutil

gp = arcgisscripting.create(9.3)

class LicenseError(Exception):
    pass


def setUpCoordSystemEnvironment(coordinateSystem, customCoordSystemFolder):
    # get the correct spatial reference and set it into the environment
    # so that the data will get projected when clip runs
    # if it is a number, assume we have a WKID and set it directly in
    # else, find the file in the Coordinate System directory
    if coordinateSystem.lower() == "same as input" or coordinateSystem == "":
        return "same as input"

    if coordinateSystem.strip().isalnum() and customCoordSystemFolder == "":
        try:
            gp.OutputCoordinateSystem = coordinateSystem.strip()
        except:
            #Message "Coordinate System WKID %s is not valid.  Output Coordinate System will be the same as the input layer's Coordinate System"
            gp.AddWarning(get_ID_message(86131) % (coordinateSystem))
            coordinateSystem = "same as input"
            gp.OutputCoordinateSystem = None
            pass
        return coordinateSystem

    found = False
    # Search custom folder if specified
    if customCoordSystemFolder != "":
        found, coordinateSystemPath = getPRJFile(coordinateSystem, customCoordSystemFolder)

    # Search to see if we can find the spatial reference
    if not found:
        srList = gp.ListSpatialReferences("*/%s" % coordinateSystem)
        if srList:
            coordinateSystemPath = os.path.join(os.path.join(gp.getinstallinfo()["InstallDir"], "Coordinate Systems"), srList[0]) + ".prj"
            found = True

    if found:
        gp.OutputCoordinateSystem = arcpy.SpatialReference(coordinateSystemPath).factoryCode
        return coordinateSystemPath
    else:
        #Message "Couldn't find the specified projection file %s.  Output Coordinate System will be the same as the input layer's Coordinate System."
        gp.AddWarning(get_ID_message(86132) % coordinateSystem)
        return "same as input"

def getPRJFile(inputCoordSysString, prjDir):
    inputCoordSysString += ".prj"
    # walk through the dirs to find the prj file
    if os.path.exists(prjDir):
        for x in os.walk(prjDir):
            if inputCoordSysString in x[2]:
                return True, os.path.join(x[0], inputCoordSysString)
    else:
        return False, ""

    # if we got to here then it didn't find the prj file
    return False, ""

def zipUpFolder(folder, outZipFile):
    # zip the data
    try:
        zip = zipfile.ZipFile(outZipFile, 'w', zipfile.ZIP_DEFLATED)
        zipws(folder, zip, "CONTENTS_ONLY")
        zip.close()
    except RuntimeError:
        # Delete zip file if exists
        if os.path.exists(outZipFile):
            os.unlink(outZipFile)
        zip = zipfile.ZipFile(outZipFile, 'w', zipfile.ZIP_STORED)
        zipws(unicode(folder), zip, "CONTENTS_ONLY")
        zip.close()
        #Message"  Unable to compress zip file contents."
        gp.AddWarning(get_ID_message(86133))

def zipws(path, zip, keep):
    path = os.path.normpath(path)
    # os.walk visits every subdirectory, returning a 3-tuple
    #  of directory name, subdirectories in it, and filenames
    #  in it.
    for (dirpath, dirnames, filenames) in os.walk(path):
        # Iterate over every filename
        for file in filenames:
            # Ignore .lock files
            if not file.endswith('.lock'):
                #gp.AddMessage("Adding %s..." % os.path.join(path, dirpath, file))
                try:
                    if keep:
                        zip.write(os.path.join(dirpath, file),
                        os.path.join(os.path.basename(path), os.path.join(dirpath, file)[len(path)+len(os.sep):]))
                    else:
                        zip.write(os.path.join(dirpath, file),
                        os.path.join(dirpath[len(path):], file))

                except Exception as e:
                    #Message "    Error adding %s: %s"
                    gp.AddWarning(get_ID_message(86134) % (file, e[0]))
    return None

def createFolderInScratch(folderName):
    # create the folders necessary for the job
    folderPath = gp.CreateUniqueName(folderName, gp.scratchworkspace)
    gp.CreateFolder_management(gp.scratchworkspace, os.path.basename(folderPath))
    return folderPath

def getTempLocationPath(folderPath, format):
    # make sure there is a location to write to for gdb and mdb
    if format == "mdb":
        MDBPath = os.path.join(folderPath, "data.mdb")
        if not gp.exists(MDBPath):
            gp.CreatePersonalGDB_management(folderPath, "data")
        return MDBPath
    elif format == "gdb":
        GDBPath = os.path.join(folderPath, "data.gdb")
        if not gp.exists(GDBPath):
            gp.CreateFileGDB_management(folderPath, "data")
        return GDBPath
    else:
        return folderPath


def get_ID_message(ID):
    return re.sub("%1|%2", "%s", gp.GetIDMessage(ID))


if __name__ == '__main__':
    try:
        zipFolder, scratchFolder = None, None

        # Get the Parameters      
        zipFolder = gp.getparameterastext(0)
        #inputGDBFolder = gp.getparameterastext(6)
        outputZipFile = gp.getparameterastext(1).replace("\\",os.sep)

      
	
        zipUpFolder(zipFolder, outputZipFile)

    except:
        e = sys.exc_info()[1]
        arcpy.AddError(e.args[0])
        sys.exit(1)
    finally:
        if zipFolder:
            shutil.rmtree(zipFolder, ignore_errors=True)
        if scratchFolder:
            shutil.rmtree(scratchFolder, ignore_errors=True)
&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 06 Mar 2024 06:51:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/final-geoprocessing-output-parameter-is-not/m-p/1391676#M27200</guid>
      <dc:creator>MohammedAbdul</dc:creator>
      <dc:date>2024-03-06T06:51:17Z</dc:date>
    </item>
  </channel>
</rss>

