|
POST
|
Is there anyway to access the editor toolbar function with python or arcpy. No, you can't - you also cannot use the ArcObjects code the editor toolbar accesses either without using .NET development languages like C# or VB.NET. Instead, you need to implement your task using standard (or your own) geoprocessing tools, for example Merge_management.
... View more
06-06-2012
10:43 AM
|
0
|
0
|
1247
|
|
POST
|
A few things to keep in mind: Although Spatial Analyst tools now do direct read/write of many formats, grid (folder workspace) is usually still the best choice. The workspace and scratchWorkspace should be set to the same folder for best performance. Grid format is limited to 13-characters, alphanumeric + "_", starting with a letter. Workspace, feature class, table, and field names should never begin with a number.
... View more
06-05-2012
10:12 PM
|
0
|
0
|
1875
|
|
POST
|
Just to point out there is no one answer to your question, and how Map Algebra is used is often a choice of style... I prefer using the "not" operator. You can also use the output of IsNull explicitly, as it returns 1/0 (true/false) values. I'm a big fan of the Con tool because it is so flexible, especially when combined with IsNull. (In the expression below, if you leave off the third argument, any cell evaluating to False returns NoData in the output.) So, these expressions are all equivalent: SetNull(not IsNull("B"), "A")
SetNull(IsNull("B") == 0,"A")
Con(IsNull("B"),"A")
... View more
06-05-2012
09:48 PM
|
0
|
0
|
1816
|
|
POST
|
There are tools to tabulate zone areas for you (of course on projected rasters, as square degrees aren't really that useful as the actual area on the ground would vary from cell to cell throughout the grid). The tools are: Zonal Geometry Zonal Geometry As Table
... View more
06-05-2012
09:35 PM
|
0
|
0
|
1626
|
|
POST
|
In general I've found them inconvenient because they don't exist anywhere that I can look at them while debugging or just tracing my algorithm's results Glad that helped. Au contraire, raster layer data do 'exist' - Raster layers are like feature layers - they aren't datasets, they are instead objects that point to a dataset source. For this reason the output of tools that create data are datasets, not layers. When I set up models and tools I almost use layer input so you the tool can see a picklist of layers in the map. Saves a lot of browsing! The troublesome "~" characters were part of the 8.3-version of your long path -- any path with long names in it is likely to be converted to an "8.3" format behind the scenes by Windows OS routines - and SOMA does not play well with those raw 8.3 pathnames. It looks like you've just been very prudent so you haven't invoked 8.3 names for the last four years where you were using raster tools (no mixed case, no spaces, short names, etc). The only way I know to check is using "dir /x" at the command line. But not today: E:\work\test1>dir /x
Directory of E:\work\test1
06/05/2012 03:42 PM <DIR> .
06/05/2012 03:42 PM <DIR> ..
06/05/2012 03:39 PM <DIR> testa1
06/05/2012 03:40 PM <DIR> TESTBV~1 testbverylongname
06/05/2012 03:42 PM <DIR> TMP_RI~1 tmp_rios_preproc2
0 File(s) 0 bytes
4 Dir(s) 92,880,891,904 bytes free Isn't Windows great?
... View more
06-05-2012
01:36 PM
|
0
|
0
|
1794
|
|
POST
|
tried fussing with inputting filename backslashes as either "\" or "\\", didn't help. You must either use escaped back slashes ("\\") or use raw strings r"G:\mypath". Something to try: Because of issues with long paths and the old map algebra intepreter, using raster layers in single-output map algebra expressions is generally a lot safer than passing grid paths directly. In 10.0 this being handled for you because you pass tools like Con raster objects, not rasters. I think the "~" characters in the 8.3-ized path are causing problems for you. Using raster layers protects the map algebra interpreter from pathnames that can break the syntax, and has other benefits. For example, selected rows (if any) in raster tables are honored, and even better, the raster data are "pre-validated" -- ie pre-checked that they exist etc -- so the tool can start doing its work faster. lyrFAC = "lyrFAC" lyrFDIR = "lyrFDIR" gp.MakeRasterLayer(flow_acc,lyrFAC) gp.MakeRasterLayer(flow_dir,lyrFDIR) expr = "con(%s <= %s, %s)" % (lyrFAC,1100,lyrFDIR) gp.SingleOutputMapAlgebra_sa(expr,flowdir_channels)
... View more
06-05-2012
10:56 AM
|
0
|
0
|
1794
|
|
POST
|
In Spatial analyst click on Raster Calculator ->click Int(your raster)->click Evaluate->use your raster calculator result to convert to polygon with Raster to Polygon tool. If you're just integerizing it, you can simply use the Int tool. (IMHO, it's a lot easier to find tools by searching for them by name or keyword instead of searching through toolboxes...) The raster calculator tool, is of course much more flexible - for example, you can scale and round your values if that is necessary to preserve the values using an expression like this: Int(("myraster" * 100.00) + 0.5)
... View more
06-04-2012
08:34 AM
|
0
|
0
|
1749
|