|
POST
|
I don't get the same results as you. When I follow your steps exactly, LL is not unused for outras1. It lines up in exactly the same place as outras. I'm using AGD 10.0, service pack 4. Also, I'm not sure what you're trying to show by changing the extent. That won't change where the rasters line up. By default, the extent window is set to the maximum of your inputs ('CreateRandom1' in this case). Setting the extent to 'CreateRandom1.extent' doesn't change anything at all, since that is the input with the maximum extent.
... View more
04-16-2012
12:02 PM
|
0
|
0
|
696
|
|
POST
|
The first place to start is to do some exploratory data analysis. Look for clustering or spatial autocorrelation in both the perceived and real data. Do the patterns look similar? The data you are describing sound almost ideal for Geographically Weighted Regression (GWR). There are myriad resources available online to help you get through that, with many walk-through examples using ArcGIS. Forget about interpolation completely. It's not right for this problem.
... View more
04-09-2012
11:10 AM
|
0
|
0
|
425
|
|
POST
|
It should be "gp.ResetProgressor()", and I don't know that calling it in a Finally clause is really necessary. The script is finished at that point. Other than that, everything looks normal to me. What's the problem you're having?
... View more
04-09-2012
07:11 AM
|
0
|
0
|
367
|
|
POST
|
You're probably better off working the arrays as array objects instead of strings, especially if you're eventually going to convert them to a raster. I've never seen a raster with text for values.
... View more
04-03-2012
04:41 AM
|
0
|
0
|
532
|
|
POST
|
Most likely you need to add the 'R_HOME' environment variable. Go to: Control Panel-->System-->Advanced-->Environment Variables. Under 'System Variables' click New. Variable name: R_HOME Variable value: C:\Program Files\R\R-2.14.1 Highlight the 'Path' variable and click Edit. Make sure that 'C:\Program Files\R\R-2.14.1\bin\i386' is somewhere in that long list of pathways. The unittest still bombs out, but I was able to import robjects which lets me run R commands from Python. However, note that Rpy2 is not well supported on Windows and so you will probably run into other problems down the road, which is why I gave up. If you're really set on being in both an ArcGIS and R environment simultaneously, you're probably better off going the opposite direction: use RPyGeo (an R library) to run ArcGIS geoprocessing tools. Good luck!
... View more
03-13-2012
01:30 PM
|
0
|
0
|
5999
|
|
POST
|
I have a feeling this is going to save me a ton of time some day. Well done.
... View more
03-13-2012
06:55 AM
|
0
|
0
|
1425
|
|
POST
|
Add two sets of parentheses, one around each of your conditions. So: # your way; gave me a raster full of 1s
demRingTmp = arcpy.sa.Con(flowDirTmp > 0 & arcpy.sa.IsNull(arcpy.sa.FocalStatistics(flowDirTmp, arcpy.sa.NbrRectangle(3, 3, "CELL"), "MAXIMUM", "NODATA")), 1)
# my way; gave me a solid 'ring' around the data
from arcpy import sa
demRingTmp = sa.Con((flowDirTemp > 0) & (sa.IsNull(sa.FocalStatistics(flowDirTemp, sa.NbrRectangle(3, 3, 'CELL'), 'MAXIMUM', 'NODATA'))), 1) In my experience, compound conditional statements in numpy (i.e., using 'numpy.where') require the same treatment. Hope that helps.
... View more
03-08-2012
04:27 AM
|
0
|
0
|
880
|
|
POST
|
Off the top of my head, cast your inputs as Raster objects to make things a little more compact. To wit: flowAccGrd = arcpy.Raster("C:\\example\\flowaccgrd") ... streamLinkTmp = arcpy.sa.StreamLink(arcpy.sa.Con(flowAccGrd > 500, 1), flowDirGrd) ... Seems like that should do it. I don't think you even need SetNull, since the output of the Con statement will necessarily be constrained to values > 500.
... View more
03-07-2012
04:55 AM
|
1
|
0
|
880
|
|
POST
|
Mike- We'll here you go. A GUI builder for Tkinter: http://tk-happy.sourceforge.net/ I disagree with Stacy that Tkinter is confusing to learn. I actually found it very straightforward, and that's partially due to the fact that your options are pretty limited. It's a very simple module. But if you're just starting out, simpler might be better, as it is for me right now. I've found a ton of documentation online and it's all worked out for me so far. I agree with Stacy, though, that GUI builders hide too much to give you a complete understanding of what's going on. It really doesn't take much more work to just hard code the layout of the GUI elements yourself. And in the long run, it's certain to make you a better programmer. And yes, wxPython and PyQt give you a lot more to work with, in terms of both functionality and aesthetics. It's just a matter of what's most appropriate for you.
... View more
03-04-2012
07:50 AM
|
0
|
0
|
674
|
|
POST
|
Thanks Curtis. Caps on the T. Of course! 🙂 I've pretty much taught myself everything I know about programming, but there's s till a lot I don't know. You said that Tkinter comes with python. I'm assuming you just mean the module and not the gui? The gui is what I'm having troubles with. When I try to interact with it in any way, I get the error above. (i.e. I click on the button for the 'Code Window' and that error pops up and it won't take me to the code window....or when I create a button, and try to go code it, same error....) It's probably something to do with how it's interacting with my PC, I just have no idea what that might be. I didn't even know that IDE existed. It looks like the project has been stagnant for some time (sort of like the only true Python-based GIS, Thuban). Even on my 32-bit XP machine it was super buggy. You might have to go old school and do everything command line(!). It's not very hard to pick up and there is a ton of documentation and examples online.
... View more
03-02-2012
11:04 AM
|
0
|
0
|
674
|
|
POST
|
Here's another way... import types
import arcpy as ap
rows = ap.SearchCursor(myTable, sql_statement)
row = rows.next()
if type(row) != types.NoneType:
# do a bunch of work
... View more
02-08-2012
01:08 PM
|
0
|
0
|
2618
|
|
POST
|
It took some getting used to, but the new map algebra can make things pretty clean. My two cents (with Python style guide enforced!):
import arcpy as ap
from arcpy import sa
ap.CheckOutExtention('Spatial')
ap.env.overWriteOutput = True
raster1 = ap.Raster("D:\\ACC\\version01_lc2.img")
outraster4 = "D:\\ACC\\version01_lc_res04.img"
var1 = [311, 401]
var2 = 23
var3 = 27
tempRas = sa.Con(raster1 < var1[0] | raster1 > var1[1], var2, var3)
tempRas.save(outraster4)
... View more
01-18-2012
12:30 PM
|
0
|
0
|
852
|
|
POST
|
Can't you just use the Near tool? http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00080000001q000000.htm
... View more
01-13-2012
09:21 AM
|
0
|
0
|
534
|
|
POST
|
The term you should Google first is "categorical data analysis". Take a look at "contingency table analysis" and the "Kruskal-Wallis" test. In this case I doubt very highly that correlation statistics will be very useful or defensible.
... View more
01-13-2012
09:14 AM
|
0
|
0
|
367
|
| 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
|