|
POST
|
you need to specify a workspace for the grid to go to
import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "c:/putYourFolderNameHereAsInTheExample")
outSlope = Slope("Elev","DEGREE", 0.3043)
outSlope.save("c:/putYourFolderNameHereAsInTheExample/SlpDeg")
... View more
03-24-2011
03:48 AM
|
0
|
0
|
881
|
|
POST
|
If you are using version 10 of ArcMap, see the code examples here http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z000000v2000000.htm
... View more
03-24-2011
02:37 AM
|
0
|
0
|
881
|
|
POST
|
I don't think it is out yet...so use the workaround in the interim
... View more
03-17-2011
11:33 AM
|
0
|
0
|
1051
|
|
POST
|
Ryan Thanks, I think some of us still miss the simplicity of SA knowing an extent (whether it was right or wrong)...aka Avenue's 0.AsGrid
... View more
03-17-2011
11:32 AM
|
0
|
0
|
3862
|
|
POST
|
without examining the details of your situation in detail, you should be aware that problems have been discovered when using arcpy's geometry objects when no spatial reference is specified. a protracted discussion is noted in: http://forums.arcgis.com/threads/9763-Errors-in-arcpy-s-Polygon-class there is a NIM number which you can track the error on NIM059845 which indicates that it is resolved as of version 10 SP2 and in 10.1 http://resources.arcgis.com/content/nimbus-bug?bugID=TklNMDU5ODQ1
... View more
03-16-2011
09:18 PM
|
0
|
0
|
1051
|
|
POST
|
Which is why it is always a good idea to use the online help, since it is updated http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000002p000000.htm when little bugs like this are found
... View more
03-16-2011
12:44 PM
|
0
|
0
|
1557
|
|
POST
|
better still, request that the math module functionality be available within the interface so you could generate code in the raster calculator such as import math "SomeGrid" * math.cos(somenumber) kind of like field calculator syntax
... View more
03-11-2011
06:11 AM
|
0
|
0
|
3862
|
|
POST
|
From the the help for the function http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z000000n8000000.htm to quote: In order to use a number as an input for this parameter, the cell size and extent must first be set in the environment. which is in keeping with the intent of the tool/function and I suspect that all inputs for all expressions are checked for cell size and extent to ensure that the outputs meet the environment settings, hence, Cos(0) will fail since it has no extent or cell size and I would not want it to assume one. This is not a bug, it is a wakeup to the user to delve into the problem further or use a numeric value for Cos rather than the tool/function.
... View more
03-11-2011
05:47 AM
|
0
|
0
|
3862
|
|
POST
|
one degree is 111 km at the equator, do not interpolate to fill the gap, the results will be meaningless
... View more
03-10-2011
08:55 AM
|
0
|
0
|
1455
|
|
POST
|
did you try the cell statistics tool in arctoolbox? ignore the nodata cells and choose minimum http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z0000007q000000.htm I think it will work, although there are other methods one could use particularly if you need to use the raster calculator.
... View more
03-09-2011
09:46 AM
|
0
|
0
|
774
|
|
POST
|
you should be able to make a kernel file with your weights as inputs, see http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z000000r7000000.htm towards the bottom, they give an example of a kernel file which can be used with the focal mean. This can be accessed through focal statistics in arctoolbox but I think you will have to preprocess before using map algebra
... View more
03-09-2011
03:18 AM
|
0
|
0
|
1438
|
|
POST
|
it must be a shapefile on disk...not in a GDB start arcmap, add the shapefile add the toolbox to Arctoolbox (not in ArcCatalog) Run the tool, select the Layer (not the file on disk, aka don't select the folder icon but the black drop down arrow) If that doesn't work, then you will have to send me screen grabs of your workflow to Dan_Patterson AT carleton.ca (it seems that they have removed direct contact to individuals from the forums and/or scripts site) In short, something about your workflow bothers me and it usually that people are running it from ArcCatalog or have their stuff in a geodatabase
... View more
03-08-2011
12:47 PM
|
0
|
0
|
3528
|
|
POST
|
the u stands for unicode (just ignore it)
>>> silverware = ["forks", "knives", "spoons"]
>>> for utensil in silverware:
... print utensil
...
forks
knives
spoons
as for the "name" thing, your simple example above has no name property whereas a field has a name property as well as several others (eg type, precision, scale if appropriate etc etc)
... View more
03-08-2011
10:30 AM
|
0
|
0
|
1004
|
|
POST
|
1 select and run the tool from within arcmap and not arccatalog 2 select the layer within the TOC and not from disk if that doesn't work, zip the shapefile and email it to me at my contact email Dan
... View more
03-08-2011
10:26 AM
|
0
|
0
|
3528
|
|
POST
|
perhaps it is case-sensitive as is everything Pythonic arcpy.ListDatasets('feature') might be arcpy.ListDatasets('Feature')
... View more
03-07-2011
01:45 PM
|
0
|
0
|
1486
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-03-2017 11:39 AM | |
| 1 | 08-05-2019 05:21 PM | |
| 1 | 09-02-2016 08:05 AM | |
| 1 | 01-15-2018 01:10 PM | |
| 1 | 09-17-2018 12:48 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:22 AM
|