|
POST
|
what happens if i have to make a add opperation like the one i mentioned earlier e. soil.Ph + vegetation.Ph can i do this on the calculator or do i have to make more steps? I didn't see a direct answer to this in the thread, so here's how you do that in one step using the Raster Calculator tool in ArcMap: ("soil" and "vegetation" are two raster layers, both with a raster table field "ph") Lookup("soil","ph") + Lookup("vegetation","ph") In arcpy scripting, you may have to access the rasters by pathname. Here's how that works:
from arcpy.sa import *
arcpy.env.workspace = "D:/myfolder"
# "soil.img" and "vegetation.img" are in this folder
# the Raster function is used to convert the path strings to a raster object
phsum = Lookup(Raster("soil.img"),"Ph") + Lookup(Raster("vegetation.img"),"ph")
phsum.save("phgrid") # save to Esri grid D:\myfolder\phgrid
... View more
06-19-2013
02:44 PM
|
0
|
0
|
2923
|
|
POST
|
Having the ability to use attributes in Raster Calculator would be really nice, why was it taken away? The Lookup function is the new way to do it. The redesign of the Raster Calculator tool at 10.x was a retooling that allowed a single syntax (arcpy map algebra) to work across ArcGIS. At 9.x, we had SOMA, MOMA, Raster Calculator, the command line, and tool interface. Each of these had a different syntax (for example, SOMA did not support "dot" syntax), and Raster Calculator even had its own unique geoprocessing environment(!). So going forward I think it is an improvement, although there is a learning curve. the merge function was really nice too, why was it disappeared?) The Merge and Mosaic tools were combined. In some situations, I have found Cell Statistics useful to merge datasets together. I need to [mosaic] 11 GRIDs which presumably do not overlap, but might a little around the edges as as artifact of how they were created. Mosaic does not let me use an item either. Two text items have to be used for the desisred attributes in the GRIDs. So I've concatenated the two fields into a new field, then added added a new field for an integer crosswalk of the concatenated fields. I plan to mosaic the GRIDs after adding & calculating the two new fields in all of them, thne using the "lookup" function to create new grids with value = newfield, hten mosaic. What a lot of work. Is there an easier way ? If your raster codes are not unique (ie value 2 means different things for two of your 11 rasters) you do have a sticky processing problem. The best way I can think is to convert your 11 rasters so all cells are unique across the 11 rasters and mosaic them, then join your attributes back in. Step 1. Set up your value in each VAT NEWVAL = [VALUE] + 1000 Step 2. Copy all your raster attribute tables to standalone tables (you could use Copy Rows in a iterator model), and join them all together with the Merge tool. Step 3. Convert your rasters to these values and mosaic them: ras1 = "grid1" + 1000
ras2 = "grid2" + 2000 Mosaic To New Raster to merge ras1-ras11 Step 4. Join Field your new mosaicked raster's RAT to the table created in step 2. An entirely different approach that may work is this. May be easiest in the Python window: 1. Set the extent to cover all 11 rasters 2. For all 11 rasters, over the entire extent, convert nodata to a missing value (say, zero): x1 = Con(IsNull("grid1"),0,"grid1")
x2 = Con(IsNull("grid2"),0,"grid1")
... 3. Combine these together. You'll get a pretty wide RAT with 11 fields that match VALUE in your 11 raster tables included. Combine(x1,x2... x11) 4. Add your text fields to this combined raster. 5. One by one, select for each of your fields ("RAS11" <> 0), add join and calc over your text fields, remove join. Hope this helps!
... View more
06-19-2013
02:28 PM
|
1
|
0
|
6876
|
|
POST
|
I am using a 1 arc second, 30M resolution DEM. Another way to ask my question would be "do I need to manipulate a DEM to convert it to real measures". The metadata (or readme files) that accompanied the raster data should tell you what the z units are. If this is downloaded NED data from the USGS National Map, the z units are in meters. The elevation data from National Map is delivered in geographic coordinates. If you are doing analysis that involves measurement of distances or areas, before you start the analysis you should project the raster to a coordinate system that will support your analysis (for example, UTM). .
... View more
06-18-2013
01:54 PM
|
0
|
0
|
1567
|
|
POST
|
I have tried using the Raster to ASCII tool and a single text file is produced. The tool used the first band of the multiband raster. You can access other bands by navigating into the multi-band raster in the Add Data dialog to select one of the bands. The exact path syntax used to access the individual bands depends on the raster data format.
... View more
06-18-2013
01:50 PM
|
0
|
0
|
1574
|
|
POST
|
Are DEM's accurate elevation measures or are they scaled numbers (not measures in meters) assigned to show relationships? This totally depends on your DEM dataset. For example, sometimes elevation datasets are shared using centimeter values so they can be stored as integer (for better compression) while still preserving .01 meter precision.
... View more
06-18-2013
01:33 PM
|
0
|
0
|
1567
|
|
POST
|
if the snapping isn't 100% accurate my output will not include the sections that are not accurately snapped. My output field has 3 sections in some and 2 in others...etc. Have you tried specifying different search distances with INTERSECT?
... View more
06-18-2013
01:21 PM
|
0
|
0
|
1341
|
|
POST
|
OK. I will contact support. I do have SP1, and I also have virus software installed. I'm not sure what indexing is. I never got this problem with 10.0, so maybe it's a 10.1 thing. Another weird thing, though, is that it works perfectly if I do it manually in ArcMap Are you running from 64 bit Python? If so you may want to try running it in 32 bit (like in ArcMap -- where it works for you). Does anyone have any ideas what could be going on? What is the "forcibly closed" message all about? All geoprocessing tools are set up to work in a client server context (the client is your script). This makes it possible to "easily" package them into a service. So sometimes error messages reference this.
... View more
06-18-2013
01:13 PM
|
0
|
0
|
2566
|
|
POST
|
Jim, In the results window, if you right-click the Messages tree you can copy the message text (easier to read!) - I saw that your path includes a folder name that starts with a number. Avoid using folder names that include special characters (space &, etc) or start with number. - Be sure the scratch and current workspace are set (for best results, use the same location for both).
... View more
06-18-2013
09:35 AM
|
0
|
0
|
2557
|
|
POST
|
Do these watersheds tiny have the same grid code as a larger watershed polygon? If so these are simply diagonally-connected pieces of that watershed and can be combined to the main watershed using the Dissolve tool.
... View more
06-18-2013
09:22 AM
|
0
|
0
|
2216
|
|
POST
|
I am just trying to 'scale' my raster from 0-1 Three thoughts: 1) The Raster object has the properties you want without having to use that tool:
from arcpy.sa import *
rasPath = "RASTER1"
ras = Raster(rasPath)
print ras.minimum
print ras.maximum
2) I think your mapping expression needs some tweaking.
range = ras.maximum - ras.minimum
mappedras = (ras - ras.minimum) / range
mappedras.save("RASTER1_MAP") # save as permanent raster
3) The Slice tool can be very handy for this task depending on whether you need the resolution (it outputs integers so there may be some accuracy issues with this approach).
mappedras = Slice(ras, 1001, "EQUAL_INTERVAL", 0) * .001
... View more
06-11-2013
04:32 PM
|
0
|
0
|
2076
|
|
POST
|
That is really wierd, if it isn't a system path, it seemed to convert the string to a feature layer at validation time. This is really wierd. But I did notice that you did not set the environment workspace, which could be your issue.
arcpy.env.workspace = workspace
arcpy.mapping.MapDocument("RouteLogPoints.mxd")
...
bufferFC = "lrs_buffer"
If that does not work, you can do this:
bufferFC = os.path.join(workspace, "lrs_buffer")
... View more
06-11-2013
04:04 PM
|
0
|
0
|
3050
|
|
POST
|
This is still an issue with 10.0.3..... [post=224254]As mentioned above by Pavan,[/post] this was fixed in 10.0 SP4 and later. You really should update to 10.0 SP5 or 10.1 SP1 if you can. NIM 070461 The Region Group tool may produce unexpected output - the data may have an anomaly whereby there are striped bands across the output. This happens when the input is fairly large.
... View more
06-11-2013
12:01 PM
|
0
|
0
|
1947
|
|
POST
|
James, I'm not very familiar with this service. I honestly think the best way to address your question is to contact them by email. From the the Automated Retrievals FAQ: How do I get help refining my URL query? Please tell us what you want to do by sending an email to [email protected]. Note to blatantly advertise, but everyone should know that a great deal of water information is available in a variety of formats from http://water.usgs.gov. This includes interactive web data retrievals, as well as embeddable web graphs (supports multiple parameters now!), and yes, XML services for your custom applications. One of the coolest ways to get water data, IMHO, (esp. if you a fisherman or river rafter, or live near the water) is the recently enhanced wateralert service. Have a safe weekend out on the water, everyone! Wear your PFD! waterwatch.usgs.gov Curtis
... View more
06-07-2013
12:46 PM
|
0
|
0
|
868
|
|
POST
|
Unfortunately, the lookup tool does not work, I receive following error messages: Syntax error at or near symbol ,. Syntax error in parsing grid expression. Can you share your expression that does not work? I do not see ",." anywhere in the expression I posted first. My guess is you may have some model variables that are misspelled or tools that incorrectly capitalized.
... View more
06-06-2013
09:36 AM
|
0
|
0
|
1715
|
|
POST
|
I'm pretty sure in this context the feature sets are for creating new features - not selecting existing ones, which I thought was your use case. As I said both of these issues (no features selected, coded domains) can be handled with tool validation with a feature layer input. You also may want to validate your feature layer input to make sure 1) it's the feature layer you want and 2) it's a feature layer and not a feature class (which is supported in the dialog).
... View more
06-06-2013
09:34 AM
|
0
|
0
|
2628
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-11-2021 01:26 PM | |
| 5 | 12-10-2021 04:58 PM | |
| 1 | 02-27-2017 09:30 AM | |
| 2 | 12-04-2023 01:05 PM | |
| 1 | 04-12-2016 10:17 AM |
| Online Status |
Offline
|
| Date Last Visited |
06-19-2024
12:10 AM
|