POST
|
Hi DavidSolari and Robert_LeClair I have been doing some experiments on Project Template and trying to figure out what the default gdb/atbx should be for multiple users when it comes to sharing ArcGIS Pro projects. Looks like Project Template does not really solve my default directory problem. What I am trying to figure out is how to prevent other users who will accidentally create geoprocessing outputs to my default directory when sharing an aprx or project template to multiple users. Say, I have DefaultDir_Test.aprx saved to our shared network drive (My organization has not utilized the Portal yet. We are starting soon). When User A opens DefaultDir_Test.aprx, this user will see my default gdb (Pro_Default_Test.gdb) and toolboox (Pro_Default_Test.atbx). When User A does a geoprocessing tool, User A might accidentally create an output feature class in my default directory if this user forgets to change the output path. Even me, sometimes I forget to change the path when creating an output. I am wondering what your practices/rules are in your organization. I guess, I need to let the users know that they need to change the settings from my default gdb/atbx to their default gdb/atbx when they first start using an aprx. Back to DavidSolari’s comment, “Just create a new project in each user's share folder, this includes a gdb and toolbox along with all the other project items.” If each user is doing this, they have to redo the symbology and labeling and other stuff. Or they can just open “DefaultDir_Test.aprx” and drag & drop the layers to their project. Project Template might be a good way as Robert_LeClair suggested. But this does not solve my default directory problem either. Any other suggestions on this? Thank you.
... View more
12-29-2023
08:10 AM
|
0
|
0
|
539
|
POST
|
Project Template sounds good too. I have not created a template (.aptx) before but will try it out. Thank you very much for your suggestion.
... View more
12-27-2023
05:22 AM
|
0
|
0
|
550
|
POST
|
Thank you for the suggestion. Yes, I do agree with you on this: "That said, treating Pro like ArcMap is going to lead to endless friction". Yep, I have been creating projects for each discrete task as well.
... View more
12-27-2023
05:17 AM
|
0
|
0
|
551
|
POST
|
I am slowly migrating the staff using Pro. I have about 20-25 GIS users in my department. I am trying to figure out how to effectively set default folders (gdb and atbx). Right now, there are about 5-6 ArcGIS Pro users. Should I set the default gdb/atbx for every user (everyone has their own default gdb/atbx)? Or should all of the users set the default gdb/atbx to one location on the shared drive? I would like your opinions on how you set the default folders up in your organization. What are pro’s and con’s and potential issues? If there were 1-2 users, I would not worry about this issue. Since I have 20-25 users, I would like to know if what I am doing is effective in terms of folder/data organization. Here is are my current settings: Under every user's folder name on the shared drive (we use a letter K here), I created a folder called “ArcGIS_Pro_Setup” In “ArcGIS_Pro_Setup”, I created “ProScratch_<username>.gdb” and “ProScratch__<username>.atbx” Here are examples, one folder structure is for user “cgillis” and the other is for “mbird”. Thank you all for your input.
... View more
12-22-2023
07:22 AM
|
0
|
5
|
638
|
POST
|
Hi, I am trying to build pyramid for NED DEM 30 meter raster files (and eventually mosaic them). I have a main directory and many subfolders. Please see the file attached. The problem is that I can't set it up so the program can read the raster files in the subfolders. I think I am missing a command line or something here. Any help would be very appreciated. Here is the code that I wrote so far. Note that I used lots of 'print' coz I wanted to know if the program reads the files. # Import system modules import sys, arcpy, os, time, os.path from time import time, ctime from arcpy import env from arcpy.sa import * print "The START time is:",ctime(time()) # Check out the ArcGIS Spatial Analyst extension license arcpy.CheckOutExtension("Spatial") # Main Directory arcpy.env.workspace = "Y:/Work/NED30M" inputDirectory = os.listdir(arcpy.env.workspace) # Loop through directory & files #Local variables: for inputFolder in inputDirectory: print "<<<----------------------------------------->>>" print "Input Directory is: " + str(inputDirectory) print "Input Fodler 01 is: " + str(inputFolder) inputFolderFiles = arcpy.ListFiles(inputFolder) RasterFiles = arcpy.ListRasters() for inputFiles in inputFolderFiles: print "Input FolderFiles are: " + str(inputFolderFiles) print "Input files are: " + str(inputFiles) print str(RasterFiles) + " ... Why Can't Read? ... " for filename in RasterFiles: arcpy.env.workspace = os.path.join (inputFolder, filename) print "Filename is: " + str(filename) print("\n Processing: " + filename) print "Input Raster is: " + str(filename) ## # Process: Build pyramid ## arcpy.BuildPyramids_management(filename) print "***" print "DONE!!" print "The FINISH time is:",ctime(time()) and here is the output: IDLE 2.6.5 >>> ================================ RESTART ================================ >>> The START time is: Fri Feb 15 16:22:08 2013 <<<----------------------------------------->>> Input Directory is: [u'n35w090', u'n35w091', u'n35w092'] Input Fodler 01 is: n35w090 Input FolderFiles are: [u'n35w090'] Input files are: n35w090 [] ... Why Can't Read? ... <<<----------------------------------------->>> Input Directory is: [u'n35w090', u'n35w091', u'n35w092'] Input Fodler 01 is: n35w091 Input FolderFiles are: [u'n35w091'] Input files are: n35w091 [] ... Why Can't Read? ... <<<----------------------------------------->>> Input Directory is: [u'n35w090', u'n35w091', u'n35w092'] Input Fodler 01 is: n35w092 Input FolderFiles are: [u'n35w092'] Input files are: n35w092 [] ... Why Can't Read? ... *** DONE!! The FINISH time is: Fri Feb 15 16:22:13 2013 >>> Thank you very much, Risa
... View more
02-15-2013
11:36 AM
|
0
|
0
|
452
|
POST
|
Try SAGA GIS. It is an open source GIS program. I has several topographic indices. However, I don't think can not handle a large scale project.
... View more
12-05-2012
11:21 AM
|
0
|
0
|
820
|
POST
|
Dear MBoucher21, That works but it took awhile to convert just one cell. thank you very much for your suggestions
... View more
10-10-2012
03:23 AM
|
0
|
0
|
1120
|
POST
|
Hi Jamal, Did you ever got the answer for this? I am just wondering the same. I am doing something that i wanted to find that pixel, but couldn't figure it out. Risa
... View more
10-08-2012
09:39 AM
|
0
|
0
|
1120
|
POST
|
I got a better code now but it's not really perfect yet #Make a separate raster *.img file for each dimension value (time) in a netcdf file
import arcpy, os, time, datetime, calendar
from arcpy import env
from arcpy.sa import *
# Input data source
#########Change folder
arcpy.env.workspace = "S:/PM_data/Climate_Idaho/Raw/tmmx" # Change folder++
#########
arcpy.env.overwriteOutput = True
arcpy.env.scratchWorkspace = "S:/Work/Risa/Trials_Errors/ScratchWorkSpace"
# Loop through a list of files in the workspace
NetCDFfiles = arcpy.ListFiles("*.nc")
for filename in NetCDFfiles:
print("Processing: " + filename)
# Set local variables
inNetCDF = arcpy.env.workspace + "/" + filename
#########Change the variable
variable = "air_temperature"
#########
XDimension = "lon"
YDimension = "lat"
bandDimension = ""
dimensionValues = "day "
valueSelectionMethod = "BY_VALUE"
#########Change the variable ###
InMemory_netcdf_raster = "air_temperature"
#########
#########Change folder
outRasterFolder = "S:/PM_data/Climate_Idaho/Output/tmmx_raster"
#########
#Global Attribute:
#ncFP = arcpy.NetCDFFileProperties(inNetCDF)
#ncDim = ncFP.getDimensions()
#Get Global Attribues
#ncAttributeNames = ncFP.getAttributeNames("")
#for ncAttributeName in ncAttributeNames:
#print " "
#print "Attribute Name: %s " % ncAttributeName
#print ncFP.getAttributeValue("", ncAttributeName)
#print " "
#Year info
#######change the lengths
fileroot = filename[5:(len(filename)-3)] #change the name lengths too
#######
Yr = int(fileroot)
print "Processing --> " + str(Yr)
#Month info
allmnths = range(1,13)
for mnths in allmnths:
Lastday = calendar.monthrange(Yr, mnths)[1]
MRange = range(1,Lastday+1)
for dyy in MRange:
dyys =int(dyy)
mnthsss = int(mnths)
a = str(mnthsss)+ "/" + str(dyys) +"/" + str(Yr)
#IF Days or Months less than 10, we want to put zero at the front so it is easier to sort.
if mnthsss < 10:
b = str(Yr)+ "_" + "0" + str(mnthsss)+ "_" + "0" + str(dyys)
else:
b = str(Yr)+ "_" + str(mnthsss)+ "_" + str(dyys)
if dyys < 10:
b = str(Yr)+ "_" + "0" + str(mnthsss)+ "_" + "0" + str(dyys)
else:
b = str(Yr)+ "_" + "0" + str(mnthsss)+ "_" + str(dyys)
############## ####### ####### ####### ####### ####### ####### #######
#the OUTPUT has zero in front of October, Nov, and DEc (month value >10)
#NEED TO FIX THIS ***
############## ####### ####### ####### ####### ####### ####### #######
dimensionValues = "day " + a
##########CHANGE the word too##
#################
outTIFF = outRasterFolder + "/" + "tmmx_" + b + ".tif"
#################
# Execute MakeNetCDFRasterLayer
arcpy.MakeNetCDFRasterLayer_md(inNetCDF, variable, XDimension, YDimension, InMemory_netcdf_raster, bandDimension, dimensionValues, valueSelectionMethod)
#print "Created NetCDF Layer for " + a
# Process: Copy Raster
arcpy.CopyRaster_management(InMemory_netcdf_raster, outTIFF, "", "", "", "NONE", "NONE", "")
print "Created Raster for _tmmx_" + b
#################
print "\nEnd of processing ... YAHOO!!!"
... View more
08-06-2012
12:21 PM
|
0
|
0
|
2347
|
POST
|
Dear Matt, The code works but I had to move the files to the local drive. I think there might be something wrong with the program reading from our server. Thank you very much for your help. Risa
... View more
07-13-2012
11:02 AM
|
0
|
0
|
220
|
POST
|
HI Matt, yeah...i changed the computer and it is still gives me the same error. Hopefully, someone else will comment on my post. I tried to specify the individual filename and it doesn't read the file name, it reads as 'band 1', which is weird. I changed this line: arcpy.env.workspace = "S:/Work/Risa/Trials_Errors/InputFiles02/ppt_1971_07.tif" and the output is: [u'Band_1']
Processing: Band_1
Traceback (most recent call last):
File "S:\Work\Risa\Python codes\zonalStats_test02.py", line 39, in <module>
saveRaster = arcpy.sa.ZonalStatistics(ZoneData, "ZoneField", inRaster, "MEAN", "DATA")
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\sa\Functions.py", line 5787, in ZonalStatistics
ignore_nodata)
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\sa\Utils.py", line 47, in swapper
result = wrapper(*args, **kwargs)
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\sa\Functions.py", line 5780, in wrapper
ignore_nodata)
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\_base.py", line 474, in <lambda>
return lambda *args: val(*gp_fixargs(args))
ExecuteError: ERROR 999999: Error executing function.
Failed to open raster dataset
Failed to execute (ZonalStatistics).
... View more
07-13-2012
04:32 AM
|
0
|
0
|
220
|
POST
|
Dear Matt, Yep, I saw that post. I will change the computer and see if it works. Wow..ESRI bugging problems are a waste of time!! I will let you know if it works or not. Thank you so much. Risa
... View more
07-12-2012
08:32 AM
|
0
|
0
|
220
|
POST
|
and for this it gives me # Import arcpy module
import arcpy
from arcpy import env
from arcpy.sa import *
# Check out any necessary licenses
arcpy.CheckOutExtension("spatial")
# Input data source
arcpy.env.workspace = "S:/Work/Risa/Trials_Errors/InputFiles02"
arcpy.env.scratchWorkspace = "S:/Work/Risa/Trials_Errors/ScratchWorkSpace"
arcpy.env.overwriteOutput = True
ZoneData = "S:/Work/Risa/USA Boundary_AlbersNAD83/PINEMAP_Counties_USCensus.shp"
# Output File
OutputFolder = "S:/Work/Risa/Trials_Errors/ZonalStats"
# Loop through a list of files in the workspace
RasterFiles = arcpy.ListRasters()
print RasterFiles
print " "
# Local variables:
for filename in RasterFiles:
print("Processing: " + filename)
inRaster = arcpy.env.workspace + "/" + filename
fileroot = filename
outRaster = OutputFolder + "/" + "Avg_" + fileroot + ".tif"
# Process: Zonal Statistics
arcpy.gp.ZonalStatistics_sa(ZoneData, "ZoneField", inRaster, outRaster, "MEAN", "DATA")
print " "
print ":o) End Processing :)"
print arcpy.GetMessages() this error message: >>> ================================ RESTART ================================
>>>
[u'ppt_1970_03.tif', u'ppt_1970_04.tif', u'ppt_1970_05.tif']
Processing: ppt_1970_03.tif
Traceback (most recent call last):
File "S:\Work\Risa\Python codes\zonalStats_test.py", line 39, in <module>
arcpy.gp.ZonalStatistics_sa(ZoneData, "ZoneField", inRaster, outRaster, "MEAN", "DATA")
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\_base.py", line 474, in <lambda>
return lambda *args: val(*gp_fixargs(args))
ExecuteError: ERROR 999999: Error executing function.
Failed to open raster dataset
Failed to execute (ZonalStatistics).
>>>
... View more
07-12-2012
07:46 AM
|
0
|
0
|
865
|
POST
|
so for this code # Import arcpy module
import arcpy
from arcpy import env
from arcpy.sa import *
# Check out any necessary licenses
arcpy.CheckOutExtension("spatial")
# Input data source
arcpy.env.workspace = "S:/Work/Risa/Trials_Errors/InputFiles02"
arcpy.env.scratchWorkspace = "S:/Work/Risa/Trials_Errors/ScratchWorkSpace"
arcpy.env.overwriteOutput = True
ZoneData = "S:/Work/Risa/USA Boundary_AlbersNAD83/PINEMAP_Counties_USCensus.shp"
# Output File
OutputFolder = "S:/Work/Risa/Trials_Errors/ZonalStats"
# Loop through a list of files in the workspace
RasterFiles = arcpy.ListRasters()
print RasterFiles
print " "
# Local variables:
for filename in RasterFiles:
print("Processing: " + filename)
inRaster = arcpy.env.workspace + "/" + filename
fileroot = filename
outRaster = OutputFolder + "/" + "Avg_" + fileroot + ".tif"
# Process: Zonal Statistics
outZonalStatistics = arcpy.sa.ZonalStatistics(ZoneData, "ZoneField", inRaster, "MEAN", "DATA")
# Process: Copy Raster
outZonalStatistics.save(outRaster)
print " "
print ":o) End Processing :)"
print arcpy.GetMessages() it gives me this error, which is pretty much the same as before: >>> ================================ RESTART ================================
>>>
[u'ppt_1970_03.tif', u'ppt_1970_04.tif', u'ppt_1970_05.tif']
Processing: ppt_1970_03.tif
Traceback (most recent call last):
File "S:\Work\Risa\Python codes\zonalStats_test.py", line 39, in <module>
outZonalStatistics = arcpy.sa.ZonalStatistics(ZoneData, "ZoneField", inRaster, "MEAN", "DATA")
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\sa\Functions.py", line 5787, in ZonalStatistics
ignore_nodata)
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\sa\Utils.py", line 47, in swapper
result = wrapper(*args, **kwargs)
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\sa\Functions.py", line 5780, in wrapper
ignore_nodata)
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\_base.py", line 474, in <lambda>
return lambda *args: val(*gp_fixargs(args))
ExecuteError: ERROR 999999: Error executing function.
Failed to open raster dataset
Failed to execute (ZonalStatistics).
>>>
... View more
07-12-2012
07:43 AM
|
0
|
0
|
865
|
POST
|
Dear Matt, Sorry, I am new to Python. I tried the loop that you gave me but it still gives me the same errors. Here is the code that I put together: # Import arcpy module
import arcpy, os
from arcpy import env
from arcpy.sa import *
# Check out any necessary licenses
arcpy.CheckOutExtension("spatial")
# Input data source
arcpy.env.workspace = "S:/Work/Risa/Trials_Errors/InputFiles02"
arcpy.env.scratchWorkspace = "S:/Work/Risa/Trials_Errors/ScratchWorkSpace"
arcpy.env.overwriteOutput = True
ZoneData = "S:/Work/Risa/USA Boundary_AlbersNAD83/PINEMAP_Counties_USCensus.shp"
# Output File
OutputFolder = "S:/Work/Risa/Trials_Errors/ZonalStats"
# Loop through a list of files in the workspace
RasterFiles = arcpy.ListRasters()
print RasterFiles
print " "
# Local variables:
for filename in RasterFiles:
print "Processing: {0}".format(filename)
input_dir = arcpy.env.workspace
inRaster = os.path.join(input_dir,filename)
outRaster = os.path.join(OutputFolder,"Avg_" + filename)
# Process: Zonal Statistics
saveRaster = arcpy.sa.ZonalStatistics(ZoneData, "ZoneField", inRaster, "MEAN", "DATA")
saveRaster.save(outRaster)
print " "
print ":o) End Processing :)"
print arcpy.GetMessages() and here is the error message: [u'ppt_1970_03.tif', u'ppt_1970_04.tif', u'ppt_1970_05.tif']
Processing: ppt_1970_03.tif
Traceback (most recent call last):
File "S:/Work/Risa/Python codes/zonalStats_test02.py", line 39, in <module>
saveRaster = arcpy.sa.ZonalStatistics(ZoneData, "ZoneField", inRaster, "MEAN", "DATA")
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\sa\Functions.py", line 5787, in ZonalStatistics
ignore_nodata)
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\sa\Utils.py", line 47, in swapper
result = wrapper(*args, **kwargs)
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\sa\Functions.py", line 5780, in wrapper
ignore_nodata)
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\_base.py", line 474, in <lambda>
return lambda *args: val(*gp_fixargs(args))
ExecuteError: ERROR 999999: Error executing function.
Failed to open raster dataset
Failed to execute (ZonalStatistics). thank you very much for your help. I will post the previous code and error message shortly. Risa
... View more
07-12-2012
07:39 AM
|
0
|
0
|
865
|
Online Status |
Offline
|
Date Last Visited |
01-03-2024
09:55 AM
|