POST
|
Here is hawth's tools replacement: http://gisandscience.com/2010/01/05/geospatial-modelling-environment-a-platform-designed-for-rigorous-spatial-analysis-and-modelling/
... View more
09-27-2011
10:26 AM
|
0
|
0
|
347
|
POST
|
Have you checked this page out? http://docs.python.org/tutorial/errors.html
... View more
09-23-2011
03:14 PM
|
0
|
0
|
903
|
POST
|
I almost had a seizure after I read the replies to this post. Really impressive stuff. A quick and dirty way to do this, although less modular, might look like this: search_dir=r'C:\Project'
out_dir=r'C:\Workspace'
import os, shutil
for root, dirs, files in os.walk(search_dir):
print '____________________________________'
print 'searching for files in', root
print ''
for f in files:
if f.endswith('.jpg'):
infile = os.path.join(root, f)
outfile = os.path.join(out_dir, f)
print 'copying', infile
shutil.copy(infile, outfile)
... View more
09-19-2011
01:54 PM
|
0
|
0
|
604
|
POST
|
I wouldn't do this in Arc. I would generate a sample of (point) locations, get the values of the your different surfaces for each location, then use a proper stats package like R or SPSS to determine the importance of your different predictor variables on biodiversity. You could use something like Akaike's information criterion to select the best subset of predictor variables to narrow things down a bit.
... View more
08-03-2011
12:40 PM
|
0
|
0
|
181
|
POST
|
I wanted to let others know that i have found a workaround to my problem, although I would rather it work how it was intended to. There is a bug report for this and its nimbus id is NIM063814, and here is a link http://resources.arcgis.com/content/nimbus-bug?bugID=TklNMDYzODE0 I had used a os.spawnv to perform the "Zonal Statistics as Table" for each individual raster, which kept the memory isolated and ran without any crashing. I will share the scripts here soon or send me an email if they aren't up yet. thanks -Colin edit: here are some links that got me on the track to use os.spawnv http://forums.esri.com/Thread.asp?c=93&f=1729&t=177007 http://forums.esri.com/Thread.asp?c=93&f=1729&t=173610&mc=33 I wonder, would writing and then calling external modules accomplish the same thing as os.spawnv in terms of memory management? See for example: http://docs.python.org/tutorial/modules.html
... View more
07-22-2011
09:29 AM
|
0
|
0
|
812
|
POST
|
I've found that first manually (or programmatically) converting my zone polygons to rasters improves chances of success. Definitely not a reliable solution though....
... View more
07-22-2011
08:48 AM
|
0
|
0
|
812
|
POST
|
After reading J. Evans' post, I'm not convinced this is entirely correct, but here is some code (see attached) that will at least demonstrate one way to deal with moving windows using python. Chris
... View more
07-19-2011
03:56 PM
|
0
|
0
|
122
|
POST
|
Have you checked out and of the void-filled SRTM products? For example: http://srtm.csi.cgiar.org/
... View more
07-14-2011
12:39 PM
|
0
|
0
|
2715
|
POST
|
but if I install Python(x,y) don't I have to install it in a directory namend C:\Python26\ArcGIS10.0\ as this is the default when ArcGIS installed python2.6? Hi Werner, Don't install python in C:\Python26\ArcGIS10.0\. The safest way to start off is probably to completely uninstall arc, then reinstall it without python. Then install python(x,y) in �??C:\Python26�?? and deal with the gdal issue, if necessary. From there, I'll direct you to steps 3 and 4 in my 'Python (x,y) installation instructions:' 3) Create a file called Desktop10.pth, which should contain these lines: C:\Program Files (x86)\ArcGIS\Desktop10.0\bin C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcToolbox\Script 4) Place the file in the python installation directory: �??C:\Python26�?? The Desktop10.pth file will point to the required directories. If there are issues with using a version of numpy other than 1.3, I haven't encountered them, and frankly, the benefits of having libraries like matplotlib and scipy work properly far outweigh the risks when arc is already such an unreliable bit of software. Obviously I can't provide a warranty with this, but it works for me and I haven't looked back. Esri really needs to reevaluate it's python distribution so that it can play nice with the wider community, otherwise, what's the point? I apologize for the rant. Good luck! Chris
... View more
07-12-2011
10:05 AM
|
0
|
0
|
705
|
POST
|
Fair enough. Sorry if I'm sowing mass confusion. Interestingly, I'm running numpy version 1.5.1 and have had no issues. (Yet.)
... View more
07-11-2011
10:51 AM
|
0
|
0
|
705
|
POST
|
No sure if this will help at this point, but here are instructions that I put together to install python(x,y). Stuart's little plotting script works fine for me in IDLE, Spyder, and Arc's Python window. 1) Install ArcGis10 without python or uninstall python 2) Download Python(x,y) from http://www.pythonxy.com/ and install, making sure you select "custom directories" so that python is installed in C:\Python26. If installing on a 64 bit machine, do not include GDAL 1.6 �?? it won�??t work. Instead, go to http://www.lfd.uci.edu/~gohlke/pythonlibs/ and install GDAL-1.8.0.win32-py2.6.exe. 3) Create a file called Desktop10.pth, which should contain these lines: C:\Program Files (x86)\ArcGIS\Desktop10.0\bin C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcToolbox\Script 4) Place the file in the python installation directory: �??C:\Python26�?? 5) Open IDLE and try �??import arcpy�??
... View more
07-11-2011
08:48 AM
|
0
|
0
|
705
|
POST
|
Ah I see. The lines to retrieve the range and sill should have read: xmlPath = "/model[@name = 'Kriging']/model[@name = 'Variogram']/model[@name = 'VariogramModel']/value[@name = 'Range']" rnge = arcpy.GAGetModelParameter_ga("outCgLayer", xmlPath) xmlPath = "/model[@name = 'Kriging']/model[@name = 'Variogram']/model[@name = 'VariogramModel']/value[@name = 'Sill']" sill = arcpy.GAGetModelParameter_ga("outCgLayer", xmlPath) Thanks for your time, Chris
... View more
07-11-2011
08:35 AM
|
0
|
0
|
198
|
POST
|
Hi, I am trying to iterate through some feature classes with z-vaues and determine the variogram parameters for each. For each feature class, I create a temporary geostatistical layer using a previously generated model in xml format, then I try to get the nugget, number of lags, lag size, range and sill from the new layer's xml data. Oddly, I am having no problem getting the first three parameters, but then my code fails to retrieve the range and sill. Any suggestions would be greatly appreciated. Thanks, Chris Here is the code: #the geodstats model was created manually using the geostatistical analyst wizard geoStatsModel = r'C:\temp\Kriging2_modified.xml' #GN1 is a fgdb feature class and 'RASTERVALU' is a field of z values inData = 'GN1 RASTERVALU' #create the new geostats layer arcpy.GACreateGeostatisticalLayer_ga(geoStatsModel, inData, "outCgLayer") #now get the model parameters xmlPath = "/model[@name = 'Kriging']/model[@name = 'Variogram']/value[@name = 'Nugget']" nugget = arcpy.GAGetModelParameter_ga("outCgLayer", xmlPath) print 'Nugget: ',nugget xmlPath = "/model[@name = 'Kriging']/model[@name = 'Variogram']/value[@name = 'NumberOfLags']" lags = arcpy.GAGetModelParameter_ga("outCgLayer", xmlPath) print 'Number of lags: ', lags xmlPath = "/model[@name = 'Kriging']/model[@name = 'Variogram']/value[@name = 'LagSize']" lagSize = arcpy.GAGetModelParameter_ga("outCgLayer", xmlPath) print 'Lag size: ', lagSize ############################################ #code fails here, won't retrieve the range or sill ############################################ xmlPath = "/model[@name = 'Kriging']/model[@name = 'Variogram']/value[@name = 'Range']" rnge = arcpy.GAGetModelParameter_ga("outCgLayer", xmlPath) print 'Range: ', rnge xmlPath = "/model[@name = 'Kriging']/model[@name = 'Variogram']/value[@name = 'Sill']" sill = arcpy.GAGetModelParameter_ga("outCgLayer", xmlPath) print 'Sill: ', sill
... View more
07-08-2011
03:47 PM
|
0
|
2
|
360
|
POST
|
My pleasure. Let me know if you hit a stumbling block.
... View more
07-08-2011
10:26 AM
|
0
|
0
|
200
|
Title | Kudos | Posted |
---|---|---|
1 | 01-20-2012 06:15 AM | |
1 | 07-08-2011 12:53 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|