|
POST
|
There is an iterator that selects groups off a layer for every unique combination of fields. You could use this on a layer input to the iterator, followed by the Copy Features tool to copy each group to a new output. The help on the tool has some examples. I'd also read the model builder help on iterators, there are good examples there too. Iterate Feature Selection—Tools | ArcGIS Desktop
... View more
09-07-2019
07:23 PM
|
1
|
0
|
2517
|
|
POST
|
The bug says it was fixed before 10.0 was released, so I not convinced this is it. Are you piping Collect Values directly into Intersect? This is not correct as the entire model iterates and you only want to run the Intersect once. Collect values should have its output marked as a parameter (in an "sub-model" that has the iterator) and the output piped to the Intersect tool in the external model that calls the sub-model.
... View more
08-21-2019
10:51 AM
|
0
|
0
|
3648
|
|
POST
|
Laurene, Angela, this is most certainly true. The checkbox is always there even if you don't have BGGP installed. If the BGGP isn't installed, the background processing runs in 32 bit using the same Python stack as ArcMap uses. So I think Angela's FME issue may be something unrelated to BGGP. That said, even if BGGP isn't installed, I often disable background processing unless I need it, especially if I am running into problems running a tool, disabling it sometimes helps.
... View more
08-16-2019
08:16 AM
|
2
|
1
|
4488
|
|
POST
|
Some of the best implementations I have seen are to do development as a script tool using the normal structure (as a function, with a __main__ module at the bottom gathering parameters and calling it). This allows both connecting the python script to a tbx as a normal script tool, and also adding it to a .pyt, importing the script tool functions and then calling them in the execute method with parameters AsText. A big plus of this too is the python script tools get precompiled to .pyc the first time the pyt is loaded. The fact that you are calling these whitebox tools as command line (ie most of the code is not in the .pyt or even imported to it) is I why (I am speculating) the 400 tools load so fast.
... View more
08-11-2019
02:43 PM
|
0
|
0
|
2397
|
|
POST
|
If you take a DEM and run Fill followed by the Flow Direction tool, you can use the flow direction raster with the Cost Path to trace downstream. From the Cost Path help: Cost Path can be used to determine the flow path based on D8 flow direction. To use Cost Path in this way, use a D8 flow direction raster as input for the Input cost backlink raster. You also need to supply an Input cost distance raster; the Input cost distance raster is not used to determine the path. Whether you use a constant raster or a digital elevation model (DEM), your path will be the same; only an attribute value on your path will vary. See the Flow Direction tool for more information on D8 flow direction rasters. That said, you may want to look into a model the USGS has had going for years called LAHARZ. (Originally developed with ArcInfo Workstation back in the late 90s!) Schilling, S.P., 2014, Laharz_py—GIS tools for automated mapping of lahar inundation hazard zones: U.S. Geological Survey Open-File Report 2014-1073, 78 p., https://dx.doi.org/10.3133/ofr20141073.
... View more
08-10-2019
07:03 PM
|
0
|
0
|
3495
|
|
POST
|
Did you specify the excel file as an output parameter to the model? I recommend doing that. Also, open the model in edit mode and make sure the excel sheet model element is not marked as "intermediate". Intermediate data are deleted when a model is run as a tool.
... View more
08-10-2019
06:55 PM
|
3
|
1
|
1431
|
|
POST
|
The short answer is, no. The XML files are in the same folder as the .pyt, just as other metadata files are in the same container as a dataset. My feeling is that 100 tools would be way too many in a single toolbox. You may run into performance issues just loading the thing!
... View more
08-10-2019
06:40 PM
|
1
|
0
|
2397
|
|
IDEA
|
I like the idea of a new parameter (NODATA, RANDOM, FIRST, LAST) with NODATA as the default so existing scripts are not broken. I think we have neighborhood covered with existing map algebra workflows.
... View more
08-09-2019
01:39 PM
|
1
|
1
|
2344
|
|
POST
|
Mosaic To New Raster makes an entirely new raster dataset, and projecting on the fly to create the output even if it worked would not give you enough control of the required resampling in my opinion. You are best off projecting all the inputs to the same coordinate system, using transformations if required (say, NAD83 to WGS84), and specifying an output cell size and registration point. Then Mosaic them together, or, perhaps better, creating a geodatabase mosaic dataset which doesn't require the time consuming mosaicking process. However, the website you linked has very old DEMs (c. 2000). I highly recommend you instead obtain elevation data from the more current dataset published by the USGS at The National Map, which is available nationwide (excluding Alaska) seamlessly at 1/3 arc second (about 10m) resolution in geographic coordinates. These elevation datasets are much more current and higher quality (many based on lidar, not contours!) and are all in the same projection, so you can more easily combine them. The National Map elevation data are also in bigger tiles (1x1 degree) which will mean less work too! For best results, I think you want to project the 1x1 degree tiles using the Project Raster tool to a common projection (specifying cell size and common registration point) and create a geodatabase mosaic dataset. It's usually very difficult to deal with a single raster file as large as you are planning. Another thing to consider, you may be able to obtain this information from the Living Atlas without having to do any of this elevation data processing yourself. (Wow!) Introducing Esri’s World Elevation Services ArcGIS Pro even includes a ready to use tool that will calculate elevation slope and aspect from these services for you! (Wow, again!) Summarize Elevation—Help | ArcGIS Desktop Hope this helps.
... View more
08-07-2019
08:53 PM
|
0
|
1
|
3341
|
|
BLOG
|
IDLE is easy and fast and is always there with Python distributions. It isn't fancy, but it does get the job done. Old Unix hands will nod in agreement when it is praised as "the vi of Python IDEs". The default installed Python shortcut in your start menu IDLE (Python GUI) opens one of the ArcGIS Pythons you have available (ArcMap 2.7 x32 or x64). As there can be as many as three (those two plus ArcGIS Pro's main Conda Python environment), you may want to test Python code using others. Here is how to do create desktop shortcuts to open IDLE with these other ArcGIS Python installations. These instructions assume you have both ArcMap and Pro installed. Step 1. Create a shortcut on the desktop for IDLE Do a Windows search for IDLE (type IDLE in the search box) Right click IDLE (Python GUI). This is the default shortcut installed with ArcMap. Select "Open File Location" The folder that opens contains the ArcMap Python shortcuts. Step 2. Create an IDLE shortcut for ArcGIS Pro's Python environment Open the file explorer and navigate to: <Install Folder>\bin\Python\envs\arcgispro-py3\Lib\idlelib Right click the file idle.bat Send to > Desktop (create shortcut) On the desktop find idle.bat - shortcut right click > Rename to a more useful name like IDLE Pro If you want open the shortcut's properties and assign an icon to make it easy to identify. I imported the icon from the file <Install Folder>\bin\Python\envs\arcgispro-py3\Lib\idlelib\icons\idle.ico Step 3. Create an IDLE shortcut for ArcMap's x32 Python environment (optional) If you have ArcMap x64 background geoprocessing installed, the IDLE (Python GUI) start menu item uses its Python (Python 2.7 x64) n. However, you may want to create an IDLE shortcut to access the Python 2.7 x32 that corresponds to ArcMap's native 32-bit Python environment ("foreground"). (If you don't have the x64 background processing installed, the default shortcut IDLE (Python GUI) will already open Python 2.7 x32.) You would want this shortcut to run scripts that only run in x32 geoprocessing, for example scripts that use the metadata GP tools or read personal (.mdb) geodatabases. On the desktop, copy and paste IDLE (Python GUI), this will create IDLE (Python GUI) - Copy Rename IDLE (Python GUI) - Copy to IDLE ArcMap32 Right click IDLE ArcMap32> Properties Modify Target string to remove x64 from the path: from: C:\Python27\ArcGISx6410.6\pythonw.exe "C:\Python27\ArcGISx6410.6\Lib\idlelib\idle.pyw" to: C:\Python27\ArcGIS10.6\pythonw.exe "C:\Python27\ArcGIS10.6\Lib\idlelib\idle.pyw" References Writing Python scripts—Help | ArcGIS Desktop Background Geoprocessing (64-bit)—Help | ArcGIS Desktop Python in ArcGIS Pro—ArcPy Get Started | ArcGIS Desktop Localized and silent install options—ArcGIS Pro | ArcGIS Desktop (INSTALLDIR)
... View more
08-07-2019
08:36 PM
|
2
|
3
|
9203
|
|
POST
|
Good plan! You didn't mention you were expanding into NoData areas. If that's the case Euclidean Allocation is definitely what you needed. Either that or Nibble which uses a mask to select areas to be filled.
... View more
08-07-2019
08:23 PM
|
0
|
0
|
4393
|
|
POST
|
I can answer #2 and the question after it I think: I learned a new trick at EsriUC from Shitij Mehta this year which is to pass the output named variable ( %Output Workspace%\%Output Name% ) to the Collect Values tool and tag the output of that as a parameter. This hides the variables from the dialog when the model is run for a tool, and will add the output to the map, as it is tagged as a derived parameter by ModelBuilder. Worth a try anyway. As for #1, does the unique values field exactly match the one on your data set? I ask because the dialog you are referring to prompts you to choose the field to use for symbology, and specifying an output symbology for a model element does not give you that option.
... View more
08-07-2019
08:17 PM
|
1
|
1
|
3733
|
|
POST
|
Just note that the 'Calculate Value' tool uses some pretty funny syntax - for strings you have to enclose them in "" in addition to the in-line variables %. This output path also has backslashes so in Calculate Value you must use the expression: r"%Output feature class%" and run time this is seen by Calculate Value as the following python expression. Not so funny when you realize that the model variable gets inserted and and then interpreted as a Python expression! Note the \n string in the pathname we are protecting from being seen as a newline within the path with the "r" prefix!! r"C:\MyData\nifty\output_features" I think your issue here is you this is a use case where you have to set dependencies in the tool validation python code block. This is subtle and I have seen Esri's tools not get it right! Customizing script tool behavior—Help | ArcGIS for Desktop SEE: Updating the description of output data using the Schema object, setting dependencies Using Calculate Value to assign data types to model variables is a very useful trick in ModelBuilder when you are hung up on parameter validation. I have used this when Esri's own tool validation is not working the way I need it to (example: Create Fishnet). But in this case I only think it will work if the dataset exists. Tricky stuff.
... View more
08-07-2019
07:05 AM
|
0
|
0
|
5298
|
|
POST
|
But I am wondering wouldn't the "join from a table" do the same thing? Lookup is the way to access fields in raster attribute tables that are not value. In 9.x the syntax for this was 'raster.field' (eg 'raster.COUNT') this is now in map algebra expressed as Lookup(raster, "COUNT") If you have a active join from the raster table to another table, you can use that in the Lookup expression with the fully qualified field name in the joined table: Lookup(raster, "othertable.field") Again in map algebra expressions must resolve to a numeric value -- you can't use map algebra to combine raster table text fields. The best you can do to combine text fields from multiple raster inputs is do a Combine, add a new text field to the Combine output raster table, add a join back to the inputs using Add Join and run Calculate Field to populate the new field from calculations using the fully-qualified related field names.
... View more
08-07-2019
06:54 AM
|
2
|
1
|
2175
|
|
POST
|
I appreciate Esri's commitment to do the best they can to keep a single script working unmodified in both environments. If there is a way to allow some existing ArcMap script to run in Pro unmodified, they should do it. If I recall correctly, they had to design this new memory workspace because of the multi-threaded nature of ArcGIS Pro. So I like the fact that in_memory is still around in Pro even though it has limited functionality. Personally I have stayed away from putting rasters in in_memory in ArcMap because they can get large and I don't want to cause users of my tool to hang under-resourced machines, but we all have different use cases. I have used it mostly for things like working with small zero or one record feature classes and tables; these scripts will run unmodified in Pro and I think that is a very good thing.
... View more
08-07-2019
06:45 AM
|
2
|
0
|
1948
|
| 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
|