|
POST
|
To get this to work, use the Calculate Value tool. If your names are consistent as you say, either of these expressions would work. r"%Name%"[-5:] # last 5 characters
r"%Name%"[13:] # characters 14-end and connect the output of the Calculate Value as a precondition to the tool where you will be using the output variable (with % around it, for example %Value%). %Value% is entered in the tool dialog where you had %Name% entered before. Hope this helps. UPDATE: probably a good idea to connect the variable Name to your Calculate Value tool in the model as a precondition to make sure you have the current value of %Name% used. Also documents the model nicely. I often rename the Calculate Value tool to something like Calculate Value end of Name to make it obvious what's going on in the model.
... View more
07-20-2021
01:49 PM
|
1
|
0
|
2717
|
|
POST
|
A situation I've seen is students download a zipfile but do not extract it and open it (inside the zip) in Windows since the OS lets you navigate into a zipfile. To access in ArcGIS you need all the pieces so be sure and extract the zipfile before you try to open it in arcgis.
... View more
07-19-2021
03:46 PM
|
0
|
0
|
2391
|
|
POST
|
But you CAN edit your question! But it is good etiquette to add info in an UPDATE block to preserve the context of the responses to the thread. Not time wasted, you have learned a lot about Spatial Analyst and rasters today!
... View more
07-19-2021
03:39 PM
|
1
|
0
|
8245
|
|
POST
|
Remember, you can only do statistics on number codes not text codes, that is the root of your issue. When I look at your raster I think the easiest approach is to use the Lookup tool with your raster as input, and specify the text field HYDROLGRP_DCD. This output raster from the Lookup tool will have a unique Value field (an integer) and your text field in it. Run your Zonal Stats As Table on this using the Value field. Then you'll have the majority soil code (as the Value integer). To add the soil text code to the zonal stats table, use the Join Field tool with your zonal output as the input table, input field Value, the raster table (with Value and HYDROLGRP_DCD) as the join table, join field MAJORITY. This will add your soil codes into your zonal stats results.
... View more
07-19-2021
03:35 PM
|
1
|
0
|
8248
|
|
POST
|
Jayanta, the difference is now the input zone values are text, not integer (see my previous post). The land use codes were integers (Value field), the soil type values are in a text field in the raster table.
... View more
07-19-2021
02:57 PM
|
1
|
0
|
8254
|
|
POST
|
Here's an example using the gis module: How can I export a Feature Layer in AGOL to Shapefile, using API for Python? https://community.esri.com/t5/arcgis-api-for-python-questions/how-can-i-export-a-feature-layer-in-agol-to/td-p/781687
... View more
07-19-2021
01:22 PM
|
1
|
0
|
3263
|
|
POST
|
> I did do this for another raster but there was only one value and it was categorical - landuse type. If you want to do it that way, the solution is to use the Reclassify tool to convert your soil types into integer codes (1,2,3,4..) (like your land use codes were), do your zonal statistics as table to find majority value, and then map the results (1,2,3,4..) back to soil codes using an expression or lookup table. I know this seems unwieldy but is because ArcGIS rasters do not store text, they store integer or float numbers, so to do calculations on categorical data the values must be integer, not text codes like "A/B".
... View more
07-19-2021
12:21 PM
|
2
|
2
|
21244
|
|
POST
|
You can find this out using a calculate field expression to find out which field matches the maximum value row by row. You would do this with a python code block with the Calculate Field tool, or dump the table and do it in excel and do it there. If the row by row max of the fields is equal to the column you want, that's the answer, so you can use if statements to identify which is the plurality. And maybe another to tag whether it is the majority. Again, what are you trying to accomplish with this? Note there are also some nice SSURGO raster layers in ArcGIS Online that have derived soil properties that can be averaged to get a value not susceptible to the plurality/majority problem. For example see Drainage Class.
... View more
07-19-2021
12:16 PM
|
0
|
4
|
12992
|
|
POST
|
One more thing this hydro groups are categories and if your interest is to look at well risk, this may be best handled for this analysis by converting the cell values to a vulnerability score (say 1-10) and doing an average instead of picking the majority. Just a thought.
... View more
07-19-2021
11:47 AM
|
0
|
6
|
13005
|
|
POST
|
Rasters are stored and manipulated as numbers not text. So to get the value in the table you probably need to do a join (Join Field is probably the easiest way to do this) to copy the hydro group value over to the table from the input raster table (Value being the join field). Another thing to look out for is that the majority is not necessarily a plurality, that is if a buffer has enough hydro groups, you may want to use the Tabulate Area tool instead so you can see those special cases and deal with them. This will involve a little more database work on the output, but I think it is probably worth it.
... View more
07-19-2021
11:46 AM
|
0
|
7
|
13005
|
|
POST
|
I did build a tool to Weed Points (NACT) so you can do them in groups. But, I looked in the help and at ArcGIS Pro version 2.8 (but not ArcMap 10.8, unfortunately), Zonal Statistics As Table handles overlapping polygons. How wonderful! I re-read your question. If the value is in another field in the raster table besides Value, you can create a new raster of the table value you want using the Lookup tool.
... View more
07-19-2021
10:44 AM
|
0
|
0
|
13022
|
|
POST
|
Your buffers overlap. To get correct results you need to run the Zonal Statistics (or Tabulate Area would be better so you can see more detail) tool for each circle one at a time; you could do this using modelbuilder or python iteration. There are some development efforts to avoid the overlap problem but since this is a small number I would just do the buffers one by one. Moving this to the Spatial Analyst space where lots of smart people may have more suggestions.
... View more
07-19-2021
10:35 AM
|
1
|
0
|
13030
|
|
POST
|
Unless you are covering such a large part of the earth so that using geodesic distance is absolutely necessary, I suggest projecting your data into an equidistant projection and working in projected space.
... View more
07-19-2021
10:32 AM
|
1
|
0
|
1992
|
|
POST
|
The Iterate Rasters iterator tool can loop through a wildcard match (Lep_jav_*.tif, for example) of rasters in a folder (and subfolders). You would do the iteration in a submodel and pass the multi output result to a driver model that creates the mosaic. David is correct that Python is more flexible with things like this, but ModelBuilder has some very powerful iteration capabilities, and if you know a little python you can make it even more powerful by using Python snippets in the Calculate Value tool to do things like manipulate file and path names. A quick tour of advanced techniques in ModelBuilder (ArcMap) Examples of using iterators in ModelBuilder (Pro) UPDATE: I could not resist figuring this out. I managed to do this with four models, a couple including a little bit of python (Calculate Value tool) to for example create the list if unique Genus_species pairs from the list of rasters and write it to to an in_memory table for later use (by the main Run All model). This model runs in Pro 2.8 (should work with all 2.x). UPDATE: I got some advice from my favorite ModelBuilder expert at Esri that in general iterators should be the first thing in the model, with nothing in front of it. This model did work, but probably this setup is not best practice.
... View more
07-19-2021
10:14 AM
|
2
|
3
|
5545
|
|
POST
|
You ran 7z from the windows command prompt. Have you tried seeing if the PATH variable is set correctly within the arcgispro-py3 environment? This looks like part of a tutorial of some kind so my guess is you missed a step in the tutorial to set up this path within the arcgis-py3 environment.
... View more
07-17-2021
10:17 PM
|
0
|
0
|
2641
|
| 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
|