|
POST
|
Good question! One of my biggest complaints about Pro (the lack of context-menu options, not XY Event Layer specifically) If you need the tool frequently, you could customize the ribbon or add the tool to the Quick Access Toolbar.
... View more
07-07-2022
03:28 PM
|
1
|
0
|
1258
|
|
POST
|
I might be missing the details of what you want to do, but it sounds like after selecting a layer you could either call the Calculate Field tool or run through rows with an Update Cursor. And you have posted your question in the ArcGIS Pro forum. You might delete the post and re-post your question in ArcMap Questions - Esri Community
... View more
07-07-2022
03:17 PM
|
2
|
0
|
502
|
|
POST
|
Ah! census geographic identifiers, not globe models, right? I set up a table with the following fields and datatypes and then wrote an 11 character census tract to geoid_string, 48201223100 Running the field calculation int(!geoid_string!) on each of the fields resulted in: I am guessing you are trying to calculate on a long integer field? Try setting it to double and using the calculation above. Read more about the limits on datatypes here: ArcGIS field data types—ArcGIS Pro | Documentation
... View more
07-07-2022
03:02 PM
|
0
|
0
|
1254
|
|
POST
|
Probably the easiest way to create a spatialReference object is to pull it from another item, such as a map or layer, as you have done in your example, but you can also create one from a .prj file, the name, or factory code and you don't need to use loadFromString. From the documentation: sr = arcpy.SpatialReference("Hawaii Albers Equal Area Conic") You would only need loadFromString if you only had the WKT string.
... View more
06-28-2022
11:13 AM
|
0
|
0
|
2312
|
|
POST
|
Get a handle on the map object and there is a spatialReference property you can read and write to Map—ArcGIS Pro | Documentation I was able to determine this was available at least as late as v2.6, but older than that, I don't know
... View more
06-22-2022
11:14 AM
|
0
|
2
|
2376
|
|
POST
|
Thanks, Dan. Yeah, I don't really know how to use that information. One module that I know is causing problems, in that it was not available for someone with 2.6, is lxml, which is not listed on either of those lists at all, so I don't know what to make of that. I looked around for some .yaml files for previous versions but only found one for 2.1. Guess I will just have to rely on reports from users.
... View more
06-13-2022
12:50 PM
|
0
|
0
|
943
|
|
POST
|
Is there a place where the packages included in the conda distribution for each version of ArcGIS Pro are listed? I nearly always have the latest version of Pro and as I write tools against that I want to be able to provide documentation about the packages that won't be available at previous versions.
... View more
06-10-2022
10:16 AM
|
1
|
2
|
999
|
|
POST
|
I would like to measure the volumes of some features in the ESRI Terrain image service, which seems like it should be possible with the 3D mensuration tool 'Volume' on the Imagery tab, given what I have read about it. But the tools are disabled whether I set Elevation (in the Mensuration Options dialog) as the image service or a locally saved clip from it. What am I missing?
... View more
10-25-2021
01:17 PM
|
1
|
5
|
2400
|
|
POST
|
Thanks, Johannes. I presume you mean to put the try/except block in the Notebook? That would work, but it's not the behavior I am trying to produce for the case where another user picking up my tools provides the wrong parameters in a Notebook. They would have to write that block themselves and call the docstring. The problem I think I am coming up against in doing my own validation is that if I mark a parameter as being required, regardless of what I put in updateMessages, the internal validation still has to warn the user that a required parameter was not provided. I can't circumvent that. Maybe it would be possible to use a try/except block in def execute but I have not found any evidence that anything inside of def execute gets run if the internal validation fails. It looks to me like it simply does not get called. Not to mention that that would require sending an empty parameter list to my tool script, have that fail, and then come back to the except statement. Not very efficient. I have also tried exiting and quitting in def updateMessages if my parameter list is empty, but I still get an ExecuteError.
... View more
10-12-2021
03:45 PM
|
0
|
0
|
1036
|
|
POST
|
I am working with custom tools in a Python Toolbox inside an ArcGIS Notebook. When a user provides either no parameters or the wrong parameters for a tool, I would like to display my own docstring; the same one that would be displayed in the terminal if the tool was being called from the command line (I import my tool from an external script file), INSTEAD of the ExecuteError messages that get displayed. I have worked out a process to get my docstring printed, and that does, at least, appear above the ExecuteError message block, but I can't get rid of the other messages. True, I want this mostly for aesthetic reasons, but also, the line numbers listed in the traceback are confusing because they don't all actually indicate the lines of code in my script that are throwing the error. Right now, I can display the docstring if I check for valid parameters in def updateMessages, but def execute still gets called. So, one solution would be if I could jump out of the python toolbox code before def execute is run. The other thing might be somehow removing the ExecuteError messages from the messages object ? My Notebook cells, when no parameters are provided, look like this: You can see my docstring, starting with "Usage:", is then followed by the ugly and less readable ExecuteError message block. And the relevant part of the .pyt looks like this: def updateMessages(self, parameters):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
parameter_values = [parameter.valueAsText for parameter in parameters]
if parameters[0].valueAsText is None:
import tool1
importlib.reload(tool1)
print(tool1.main.__doc__)
return
def execute(self, parameters, messages):
"""The source code of the tool."""
import tool1
importlib.reload(tool1)
parameter_values = [parameter.valueAsText for parameter in parameters]
if parameter_values[0] == 'broccoli':
print(tool1.main.__doc__)
else:
tool1.main(parameter_values)
return Also, I need a solution that doesn't bork the functionality of the tool when opened in the Geoprocessing pane, that is, with the parameter form. For instance, I could make all of my parameters optional, which would pass internal validation and then allow me to do my own validation inside def execute (my if statement near the bottom of my code is an example of how this might be done), but that messes with the functionality of the form.
... View more
10-07-2021
11:08 AM
|
0
|
2
|
1093
|
|
POST
|
When I export metadata to the FGDC standard using the Export Metadata tool in ArcGIS Pro 2.5.0, the spatial reference information section, aka the spref element, is missing. The information is shown when I view the item description, but it doesn't get exported. I have tried this with multiple feature classes from different file gdbs. For context, the Export Metadata tool in ArcMap will export the section correctly from the same data sources. I have tried upgrading the file geodatabases and synchronizing the metadata and nothing works. Am I missing a step? Can't find any discussion of this anywhere.
... View more
08-20-2020
02:30 PM
|
1
|
5
|
2194
|
|
POST
|
Yeah, lesson learned. I hadn't worked with environments through Pro before; I just knew you could manage them at the prompt, so that's where I went first. I didn't even know about the Package Manager until I got this version.
... View more
06-25-2020
02:01 PM
|
0
|
0
|
2758
|
|
POST
|
For crying out loud...it's very similar to the numpy problem that others have been reporting since v 2.2 Problem: Unable to create environments or install packages after upgrading to ArcGIS Pro 2.2 (I couldn't follow the solution there because there were no other folders in \pkgs other than cache, even if I had permissions to delete them) I finally learned about and looked at %localappdata%\ESRI\conda\conda_debug.log: DEBUG:__main__:conda.cli.main called with ('C:\\ArcGIS\\Pro\\bin\\Python\\Scripts\\conda.exe', 'proswap', '-p', 'C:\\ArcGIS\\Pro\\bin\\Python\\envs\\myclone', '--json')
Setting environment CONDA_ROOT to C:\ArcGIS\Pro\bin\Python
Setting environment CONDA_PREFIX to C:\Users\ethoms\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone
Setting environment CONDARC to C:\ArcGIS\Pro\bin\Python\.condarc
proswap: Writing C:\Users\ethoms\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone as C:\Users\ethoms\AppData\Local\ESRI\conda\envs\proenv.txt
proswap: by prefix environment
proswap: The environment C:\ArcGIS\Pro\bin\Python\envs\myclone doesn't contain NumPy, which is required for ArcGIS Pro. Listing the packages in the environments I see that all environments have numpy-base, but only when selecting arcgispro-py3 in the PM does this get interpreted, apparently, as numpy. For all others, an entry like above is generated. It's beyond my time and energy to investigate why. My workaround is to install numpy from the conda CLI. After doing that I can switch to a cloned environment in the PM and everything looks good. Yes, it means that the environment has numpy and numpy-base with the exact same version number, but I don't understand how these differ.
... View more
06-25-2020
10:51 AM
|
0
|
4
|
2758
|
|
POST
|
Dan, I appreciate the help. I think I will have to call in support. I can activate the default environment from the command line, and be in that directory, but I still cannot get Pro there. It simply will not forget that myclone environment and I can't get it to switch to anything else. As a regular user, this is annoying because you can, after all, install and fiddle with Anaconda without admin rights and it seems like any caching that Pro might be doing to remember the last environment it was connected to should be in the user profile, which could be simply deleted. Oh well. This give me more reason to go to 2.5.1
... View more
06-24-2020
05:32 PM
|
0
|
1
|
2758
|
|
POST
|
Dan, I have (arcgispro-py3) C:\ArcGIS\Pro\bin\Python\envs\myclone>conda env list
# conda environments:
#
arcgispro-py3 * C:\ArcGIS\Pro\bin\Python\envs\arcgispro-py3
myclone C:\ArcGIS\Pro\bin\Python\envs\myclone
root C:\ArcGIS\Pro\bin\Python
... View more
06-24-2020
04:32 PM
|
1
|
1
|
13461
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-29-2025 09:49 AM | |
| 1 | 10-25-2021 01:17 PM | |
| 3 | 05-10-2023 09:21 AM | |
| 1 | 04-06-2023 02:09 PM | |
| 1 | 07-07-2022 03:28 PM |
| Online Status |
Offline
|
| Date Last Visited |
03-26-2025
11:00 AM
|