POST
|
I have the following for loop which subsets 420 DEM's into 20 DEM's.: for i in range(0,420,21): low = i high = i + 21 interval = high / 21 AK_in = 'str_dems_AK' + str(interval) AK_out = 'NED_AK' + str(interval) subset_AK = AK_in + ' = str_dems_AK[' + str(low) + ':' + str(high) + ']' exec subset_AK arcpy.MosaicToNewRaster_management(AK_in, r"H:\dmf\pds\ned\grid\raster_mosaics", AK_out, "", "", "", "1", "", "") arcpy.BuildPyramids_management(AK_out, "", "", "", "", "", "SKIP_EXISTING") which results in the following error: Traceback (most recent call last): File "H:\NED_BuildPyramids_Mosaic_test.py", line 85, in <module> arcpy.MosaicToNewRaster_management(AK_in, r"H:\dmf\pds\ned\grid\raster_mosaics", AK_out, "", "", "", "1", "", "") File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\management.py", line 11619, in MosaicToNewRaster raise e ExecuteError: ERROR 000582: Error occurred during execution. If I manually run the following command it works so I assume the problem is passing the value of “AK_out” into the mosaic command: arcpy.MosaicToNewRaster_management(AK_in, r"H:\dmf\pds\ned\grid\raster_mosaics",”NED_AK1”, "", "", "", "1", "", "") If have tried a variety of alternatives but I always get an error so I'm hoping that someone can tell me how to (a) pass the value of AK_out into the mosiac command or (b) if that's not the problem, identify what is causing the eror. Thanks, Mike.
... View more
10-23-2014
10:23 AM
|
0
|
0
|
1873
|
POST
|
mdenil, Thank you. The SetNull option ended up accomplishing what I had wanted.
... View more
08-21-2013
10:32 AM
|
0
|
0
|
226
|
POST
|
I made the suggested change but it did not change any interior water bodies, only those that were on the boundary. I again tried with both the actual and scientific notation numbers.
... View more
08-20-2013
07:21 AM
|
0
|
0
|
226
|
POST
|
I'm working with a NETCDF file and am running the following code and the nodata option of the CopyRaster command doesn't appear to be working as I expect. The CopyRaster successfully creates the raster but in the properties the maximum value is still displayed as the value in the CopyRaster command. I've also tried entering the 36-digit number instead of the scientific notation and I get the same result. I'm not sure if it's the large value that's the problem or if I'm overlooking something. The nc variable I'm working with has the large value for water bodies and the remaining cells between 0-1 (floating point) so if the nodata option worked I'd expect a max <= 1. import arcpy
from arcpy import env
arcpy.CheckOutExtension("spatial")
from arcpy.sa import *
arcpy.env.overwriteOutput = True
arcpy.env.workspace = r"G:\data\NETCDF"
NetCDFFile = r"G:\data\NETCDF\year.nc"
GDB = r"G:\data\NETCDF\GCM\Hist_Output_Part_Burn4.gdb"
NetCDFFileProp = arcpy.CreateObject("NetCDFFileProperties", NetCDFFile)
##for i in range(0,int(NetCDFFileProp.getDimensionSize("year"))):
for i in range(0,1):
## # convert month from a floating point to an integer (prevents error in naming raster)
DIMENSION_VALUE = int(NetCDFFileProp.getDimensionValue("year",i))
print 'Working on Dimension Value: ', DIMENSION_VALUE, '(index ', i, ')'
# delete existing raster if it exists
if arcpy.Exists( GDB + "\\" + "year" + str(DIMENSION_VALUE )):
print '--- deleting ', "year" + str(DIMENSION_VALUE)
arcpy.Delete_management( GDB + "\\" + "year" + str(DIMENSION_VALUE ))
# create raster layer from NetCDF file
arcpy.MakeNetCDFRasterLayer_md(NetCDFFile, "part_burn", "lon", "lat", "year_"+str(i), "", "year " + str(DIMENSION_VALUE))
# create raster
arcpy.CopyRaster_management("year_"+str(i), GDB + "\\" + "Hist_PB_"+str(DIMENSION_VALUE+1895), "", "", "9.96921e+036")
#reclass raster
#Notify when finished
print "Finished!" Thanks, Mike
... View more
08-19-2013
12:20 PM
|
0
|
4
|
335
|
POST
|
I'd recommend reinstalling python/ArcGIS first. How much longer does it run unresponsive on your problem PC than when it is run successfully? When it is not responding is the process still utilizing the CPU? If so is it a constant CPU percentage or does it fluctuate? My recollection is that the Task Manager showed no CPU usage.
... View more
02-13-2013
08:21 AM
|
0
|
0
|
854
|
POST
|
I have a co-worker that is running a Python script that continually quits responding (i.e., Task Manager shows that Python is Not Responding). The script takes a NetCDF file and creates rasters for future analysis and when it quits responding it is at random rasters within the NetCDF file (occurs in both PythonWin and IDLE). We have run this same script/data on another "identical" PC (i.e., same make/model, RAM, and processing speed) as well as my PC (same make/different model, RAM, processing speed) and it successfully runs. This implies, along with the random locations where the script quits responding, that the problem is not with the script or the data. Does anyone have any thoughts on what might be causing Python to quit responding? We have gone so far as to remove the PC from our network, disable the anti-virus (from workstation aml days), no other programs running. Running ArcGIS 10.0, Python 2.6.5 on Windows XP. Thanks, Mike
... View more
02-13-2013
05:52 AM
|
0
|
2
|
4018
|
POST
|
I have a script which I've added to a toolbox in ArcGIS 10.0. The script asks the user for a geodatabase (I'm creating and storing rasters from a NetCDF file) and either uses an existing geodatabase or creates a new one if it doesn't exist. In adding the script to a toolbox the problem I'm having is what parameter data type to select and/or what parameter properties need to be set to allow me to put in a geodatabase that doesn't exist. The script runs if an existing geodatabase is selected but not if a new one is selected. Thanks, Mike
... View more
01-09-2013
06:34 AM
|
0
|
2
|
482
|
POST
|
In addition to the while row: change, I needed to specify the fields I wanted to print. while row: print row.POLYS_DD_, row.polys_dd_i row = rows.Next()
... View more
04-05-2012
08:38 AM
|
0
|
0
|
1594
|
POST
|
I've written the following code based on "Writing Geoprocessing Scripts with ArcGIS" but am getting an error which I can't figure out. What is Python storing the data as (string, list, etc)? Has there been changes to how ArcGIS interprets the code? Using Python 2.5.1; ArcGIS 9.3; Windows XP. import arcgisscripting GP = arcgisscripting.create(9.3) GP.overwriteoutput = 1 GP.workspace = "C:\\USER\\FLATHER\\great_plains_corridor\\experimental" rows = GP.SearchCursor("C:\\USER\\FLATHER\\great_plains_corridor\\experimental\\polys_dd.shp") row = rows.reset() row = rows.Next() for row in rows: # just in case, the following two lines are indented in the code but didn't appear indented in the preview print row(0) row = rows.Next() The error is: Traceback (most recent call last): File "C:\Python25\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\USER\FLATHER\great_plains_corridor\experimental\script3.py", line 23, in <module> for row in rows: TypeError: 'geoprocessing cursor object' object is not iterable
... View more
04-05-2012
07:12 AM
|
0
|
0
|
1594
|
POST
|
I'm new to geoprocessing with Python (but with a basic knowledge of Python) and have been trying to loop through a shapefile to perform analysis on each polygon in the shapefile. I have seen references to looping through directories. etc. but haven't been able to translate them to working with polygons within a shapefile. Thanks, Mike Using ArcGIS 9.3 on XP.
... View more
04-04-2012
12:01 PM
|
0
|
5
|
6591
|
POST
|
We have polygons for protected areas which are entirely contained within a study area polygon. We would like to randomly move, and rotate, each protected areas polygon such that they do not overlap, and are fully contained, within the study area polygon. We would like to repeat this randomization process x number of times. We currently have a corridor network based on the the existing configuration of protected areas and would like to compare this corridor network with the random protected areas configurations. Is this possible? This is currently outside my expertise (but willing to learn) and am looking for direction/terms/concepts/etc. I should be aware of to get me started. Thanks, Mike
... View more
02-29-2012
12:33 PM
|
0
|
13
|
5334
|
POST
|
I have a point shapefile of nest sites from which I created a TIN and then converted the TIN to a TIN edge (3D Analyst -- Conversion -- From TIN -- TIN Edge). This creates a line shapefile with no node identifiers and I would like to be able to identify the distance between the nodes (nest sites) that comprise each of the edge lines (I've added a length field). Is there a procedure or set of steps that could be recommended to accomplish this? I have done this by exporting the tables for the point shapefile, TIN edge, and Generate Near table and analyzing in SAS. Being new to 3D Analyst, I'm wondering if there is an alternative way(s) to do it within ArcMap? I've attached an image showing the point ID and the edge lines for a specific nest site. Running ArcMap 9.3.1 on Windows XP. Thanks, Mike
... View more
02-22-2012
04:53 AM
|
0
|
0
|
1230
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|