|
POST
|
Just a week ago Christoph Gohlke built a completely static NetCDF4 module specifically for use with ArcGIS 10.1, and in my testing it has worked flawlessly. Check out the link to netCDF4-1.0.5dev-ArcGIS-10.1.win32-py2.7.exe on Christoph's amazing Python libraries for Windows page: http://www.lfd.uci.edu/~gohlke/pythonlibs/#netcdf4 That's a good point. That netCDF4 installer does work for me on a 64-bit Windows 7 machine, but not on my 32-bit Windows XP computers.
... View more
03-20-2013
09:20 AM
|
0
|
0
|
2143
|
|
POST
|
Hey, thank you for the response. I am running AGD 10.1, which uses python 2.7. It looks like the latest windows installer is for python 2.6. I believe I tried this one and was having compatibility issues with ArcGIS 10.1. Do you know any window installers for python 2.7? Thanks again. I submitted an installer for Python 2.7 to the ScientificPython author. He usually posts those to the webpage in ~24 hours. If you need it before he posts it, send me a message with your email.
... View more
03-20-2013
05:00 AM
|
0
|
0
|
2143
|
|
POST
|
The conflict between netCDF4 and ArcGIS has a long and illustrious history. Example here. Your problem sounds different from the one I had a few years ago, though. So small chance it's a problem with your code. Beyond that, there are at least two alternative netCDF readers that do work with ArcGIS: ScientificPython - I've been submitting Windows installers for this project. Right now the latest one is compatible with AGD 10.0. scipy.io.netcdf - This will bomb on really, really big files. ScientificPython won't. There are others, and they all use very similar APIs. Unfortunately, none of them offer the cool bells-and-whistles that netCDF4 offers. Hope that helps.
... View more
03-19-2013
01:28 PM
|
0
|
0
|
2143
|
|
POST
|
I use Pyscripter a lot and I've adjusted the colors to a low-contrast scheme (see first page of PDF). But when I right-click a Python Toolbox (*.pyt) and try to edit, the script comes up as white (see second page of PDF) and is 100% immutable. No matter what settings I mess with, I'm forced to edit the file with a white background. Even more concerning, Pyscripter doesn't seem to recognize it as a script. There's no autoindentation or introspection, though I can add new text. I've got Pyscripter set as the editor in ArcGIS, and I've told Windows to open the *.pyt extention with Pyscripter. Am I missing something completely obvious? ArcGIS 10.1 SP1 Windows XP 32-bit EDIT: Found the solution. Go to Tools-->Options-->IDE Options and add '*.pyt' to the "Open Dialog Cython filter", "File Explorer filter", and "Open Dialog Python filter".
... View more
03-04-2013
11:22 AM
|
1
|
0
|
794
|
|
POST
|
Python is pretty good about recognizing and handling path names. Here's how I handle tasks like yours:
>>>from os import path
>>>text = r'C:\TEMP\Durham.shp'
>>>path.dirname(text)
'C:\\TEMP'
>>>path.basename(text)
'Durham.shp'
>>>newfolderName = path.basename(text)[-4:]
>>>newfolderName
'Durham'
>>>newPath = path.join('C:\\newLocation', newfolderName)
>>>newPath
'C:\\newLocation\\Durham'
... View more
01-18-2013
08:02 AM
|
0
|
0
|
3403
|
|
POST
|
When performing IDW through the GA toolbar, you can simply click the "Optimize Power value" button. Any chance this is done for you when you leave this parameter blank in a script? If not, is there a way to get the optimized value?
... View more
01-15-2013
09:20 AM
|
0
|
6
|
4996
|
|
POST
|
Yes, you would want to compare the RMSE between EBK and IDW. A large root-mean-square-standardized usually indicates the model is unstable. The most common reason for this is because the Gaussian semivariogram is very unstable if the nugget is very small, compared to the sill. Note that Stable with parameter=2 and K-Bessel with parameter=10 both correspond to the Gaussian semivariogram (it's a special case of both). EDIT: Oh, I understand what you were asking. It doesn't make much sense to compare RMS and average standard error from different models, but it is useful to compare them within the same model because if the difference between them is large, it indicates that the model may have problems. Thanks Eric. I think I've got enough of an understanding to move forward with my project.
... View more
01-14-2013
05:18 AM
|
0
|
0
|
672
|
|
POST
|
There's a typo in that pdf that I just noticed. For average standard error, the formula is missing a square. You can find the correct formulas here: http://resources.arcgis.com/en/help/main/10.1/index.html#//00300000000z000000 "Average Standard Error" is the only formula that is different than you might expect. It might be better called "Root-Mean-Variance." We used this formula instead of a simple average because this formula is more directly comparable to the RMS. Okay, I can see how they are similar. But would there be any reason to compare the "Average Standard Error" of a EBK model to RMSE of an IDW model, for example? It seems like looking at RMSE for both is a more defensible comparison. Also, are there some common/likely reasons for seeing a RMS Standardized Prediction Error that is very large?
... View more
01-10-2013
11:35 AM
|
0
|
0
|
672
|
|
POST
|
I'm running a Python script that calls Tabulate Area a few thousand times. After receiving the "Fatal ERROR (INFDEF)" error a few times, I poked around and found that all of the temporary raster (e.g., 't_t908', 't_t_909', etc.) are sitting in the scratch working directory, still with ArcGIS locks and this is causing my problem. Some other important bits of information: This script ran fine with 10.1. The only change (that I know of) was the installation of sp1. I've tried many different scratch workspaces. Even if the temp files are in a FGDB, the script eventually bombs out. I'd love to hear some ideas. Any fixes besides going away from GRID format for good?
... View more
12-06-2012
06:24 AM
|
0
|
2
|
3369
|
|
POST
|
or better yet... exampleDict = dict([(r.KEY, (r.VALUE1, r.VALUE2)) for r in arcpy.SearchCursor(myTbl)]) I've always liked this little piece of code, but a couple of things have always bothered me. The dictionary that results gives you the attributes of your 'KEY' as a series of values (r.VALUE1, r.VALUE2), but you lose the attribute name. Working with big datasets with many 'VALUE's could be difficult. Also, it requires that you go in and enter each field name you wanted included in the output dictionary. Again, with big datasets this may be problem. This little ditty uses nested list comprehension to solve those problems: # for this example, use the Census 2000 state shapefile
myShp = 'R:\\data\\Census\\2000\\Shape\\ST.shp'
myDict = dict([((r.ST_ABBREV, f.name), r.getValue(f.name)) for f in ap.ListFields(myShp) for r in ap.SearchCursor(myShp)])
>>> myDict[('WY', 'STATE_NAME')]
>>> 'Wyoming'
>>> myDict[('MD', 'ID')]
>>> '24' #this is the FIPS code for Maryland Even though calling this a 'one-liner' is a bit of stretch (it's 123 characters), this lets me access the entire shapefile attribute table, in this case, as a dictionary using a two-item tuple as the key. And, I don't need to know the names or number of fields in advance. All I have to do is provide the name of the field I want to serve as the key, which is ST_ABBREV in this case.
... View more
11-26-2012
06:20 AM
|
0
|
0
|
1403
|
|
POST
|
I vote for none. A quick check of the python package index shows almost 25,000 Python modules available. Where would the line be drawn. What I would like to see is for ESRI to install Python using the standard Python installation directories, then install ArcPy as just another package under the site-packages directory. That way all the off the shelf Python stuff works just fine. I'm still on 10 so maybe 10.1 fixes this issue. Well I think the line would be drawn based on feedback received in threads like this one. Python is becoming the standard for scientific software, and I'm sure that out of 25,000 modules a handfull are broad enough so as to be almost universally useful to the GIS user community. I agree that the non-standard Python installation ESRI uses is annoying. But this is standard practice for other scientific/GIS applications that need a Python installation (e.g., Quantum GIS does the same thing). The workaround to this is just install Python, numpy, matplotlib, etc. first so the ArcGIS installer will use those installations instead of putting in its own. The arcpy software is still not put into the 'site-packages' folder like other modules, but at least your Python installation will look normal in every other way.
... View more
10-12-2012
04:46 AM
|
0
|
0
|
1512
|
|
POST
|
Would there be any interest in Pandas? It would be nice to interact with and manipulate tabular information without actually changing the source table, or to populate tables (before writing them to a geodatabase) without being restricted by InsertRow. Data analysis/processing can be especially nasty in Python/arcpy when creating field values that depend on the values in other rows. I often find myself switching to R (a statistical programming environment... Pandas gives Python an R-like functionality) for the ease of working with tabular data that can be accessed by row/column indices or by row/column names. Kerry Alley GIS technician VT Agency of Transportation This is a fantastic idea! Pandas would be a great addition.
... View more
10-11-2012
11:35 AM
|
0
|
0
|
1745
|
|
POST
|
Hi Duncan I have created attribute indices, unfortunately ArcGIS joins are very slow. I found the following post that suggested that python dictionaries outperform ArcGIS joins. http://forums.arcgis.com/threads/55099-Update-cursor-with-joined-tables-work-around-w-dictionaries?p=238702#post238702 Regards Check this post out for starters: http://forums.arcgis.com/threads/52511-Cool-cursor-dictionary-constructor-one-liner?p=179517#poststop If I recall, the method in that post only works for shapefiles with one attribute. I agree with Duncan that 7.5 million features is unlikely to fit into memory all at once. I modified the one-liner from the above thread so that I could produce a fully-factorial dictionary that had all records and all attributes, and the performance was terrible. And that was for a shapefile with ~3000 polygons.
... View more
10-10-2012
12:12 PM
|
0
|
0
|
3456
|
|
POST
|
First, you'll need to attach your script in order for someone to help. Second, make sure that when you type 'python' into the cmd window, you get a Python prompt.
... View more
10-10-2012
11:22 AM
|
0
|
0
|
343
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-25-2012 05:22 AM | |
| 1 | 02-09-2018 01:19 PM | |
| 1 | 09-20-2011 11:59 AM | |
| 1 | 03-27-2013 09:08 AM | |
| 3 | 02-09-2018 06:34 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|