Hi Kevin,Sorry that it has taken me so long to get back to this, you know how it goes.I am still having trouble. I have implemented my code with a directory which is registered in the Data Store as a variable. When I execute on the server it finishes fine, but then I am unable to locate the output in either the scratchGDB or the local GDB I specify.This is the code I am using:# Import Python Libraries
import arcpy, os, string
from arcpy import env
# Set Overwrite Output Environment
env.overwriteOutput = True
# Define Output Folder
outputFolder = r"E:\arcserver\data\tooldata"
# helper method to check if a field exists in a fc
def check_for_field(featClass,fieldName):
hasField = 0
desc = arcpy.Describe(featClass)
fields = desc.fields
for field in fields:
# check without case as ArcGIS is not case sensitive
if field.name.upper() == fieldName:
hasField = 1
return hasField
# Define inputs
# Input ISOCODE
fcString = arcpy.GetParameterAsText(0)
# Project Data
# Input Fishnet
fish = outputFolder + os.path.sep + fcString + ".gdb" + os.path.sep + fcString + "_fishnet_full_attributes"
# Coordinate System
wgs84 = arcpy.SpatialReference(4326)
# Describe Fish
desc = arcpy.Describe(fish)
# Calculate Raster Extent
extent = desc.Extent
xmin = int(round(extent.XMin - .5))
xmax = int(round(extent.XMax + .5))
ymin = int(round(extent.YMin - .5))
ymax = int(round(extent.YMax + .5))
# Define Gridding Variables
gridFieldsWildCard = arcpy.GetParameter(1)#"*TOTPOPBT_2010*M"
gridFields = arcpy.ListFields(fish,gridFieldsWildCard)
# Lines per degree, determines the output resolution 120 = 30 arc-seconds resolution
# 1 degree divided into 120 parts is 30 seconds
linespd = 120 ## Update As Needed
cellSize = 1.0 / linespd
# Output the gridded count rasters
for field in gridFields:
gridField = field.name
arcpy.AddMessage("The field to be gridded is " + gridField)
# Output Grids
outPopGrid = outputFolder + os.path.sep + fcString + "_grids.gdb" + os.path.sep + fcString + "_" + gridField
arcpy.env.extent = arcpy.Extent(xmin,ymin,xmax,ymax)
arcpy.env.outputCoordinateSystem = wgs84
arcpy.env.cellSize = cellSize
arcpy.AddMessage("The extent is " + str(arcpy.env.extent))
if arcpy.Exists(outPopGrid):
arcpy.AddMessage(outPopGrid + " exists")
else:
try:
arcpy.PolygonToRaster_conversion(fish,gridField,outPopGrid,'CELL_CENTER','#',cellSize)
arcpy.AddMessage("Created " + outPopGrid)
except:
arcpy.AddMessage(arcpy.GetMessages())
Any advice you could provide would be very helpful.Thanks so much, Kytt