|
POST
|
Yes. But you need to understand scope. At it's simplest, functions (and variables) are objects and objects are only "visible" at (or below) the scope in which they are created. So by creating a function inside the local scope of a method (e.g. __init__ or execute), you can only use that function inside the method you defined it in. E.g. class Tool(object):
def __init__(self):
def func_in_init():
return "init"
def execute(self):
def func_in_exec():
return "exec"
print(func_in_exec()) # this will work
print(func_in_init()) # this will raise NameError
If you want to use a function anywhere, define it globally, if you want to use it anywhere in your Tool class and not outside the class, make it a method.
... View more
08-11-2023
03:32 PM
|
0
|
0
|
1544
|
|
POST
|
You can also use the string.lstrip (left strip) method. This will remove the given character from the start of a string, leaving the string untouched if it doesn't start with that character. layers = [l.lstrip("T") for l in act_map.listLayers()]
... View more
08-06-2023
05:37 AM
|
2
|
0
|
1730
|
|
POST
|
Do you have a getParameterInfo method defined? def getParameterInfo(self):
"""Define parameter definitions"""
params = None
return params
... View more
08-02-2023
02:24 PM
|
0
|
0
|
1301
|
|
POST
|
Really the only way you might get the pixel values actually changing is if the output coordinate system is different and the raster gets resampled when it is reprojected.
... View more
07-27-2023
04:49 PM
|
0
|
1
|
5517
|
|
POST
|
@JohnBranum wrote: In all my tests, what appears to happen is that the clipping process reevaluates the clipped raster, reassigning values from min to max, which will change those values if, for example, the removed portions were higher and/or lower values than what remains. I think what you are referring to there is what happens to the symbology which is just a visual representation. It doesn't change the underlying values though.
... View more
07-27-2023
04:36 PM
|
1
|
0
|
5517
|
|
POST
|
You can manually check by subtracting one from the other. You'll get all zero values where they overlap.
... View more
07-27-2023
03:11 PM
|
1
|
0
|
5519
|
|
POST
|
Also, as your raster cells appear rotated in the screenshots, it looks like you are trying to run the clip in a different projection than the raster is in which is probably why it's taking so long. Change your map /tool environments spatial reference system to match that of the original raster.
... View more
07-26-2023
12:36 AM
|
2
|
0
|
5534
|
|
POST
|
Can't reproduce. Extract by Mask maintains cell values, For example - using Identify to show cell values at the same point in both original large raster and the extracted raster: Of course your extent, n. rows/columns and min/max cell statistics will change, because you clipped/extracted out a smaller area. But the actual cell values remain the same. The rasters/cells may even look different in the map but the values themselves have not changed. This is simply because the symbology will have changed (as the statistics are different). You can make them look the same by changing the symbology.
... View more
07-25-2023
09:06 PM
|
0
|
4
|
5539
|
|
POST
|
You could create your own shortcut that calls C:\Program Files\ArcGIS\Pro\bin\Python\Scripts\proenv.bat and set the shortcut start in directory to whatever you want.
... View more
07-22-2023
07:35 PM
|
0
|
0
|
2808
|
|
POST
|
Or adding <install>bin\Python\Scripts (e.g. C:\Program Files\ArcGIS\Pro\bin\Python\Scripts) to the PATH user environment variable. using <install>bin\Python\Scripts\conda config --remove channels conda-forge
... View more
07-21-2023
02:43 AM
|
0
|
0
|
2302
|
|
POST
|
NVIDIA discrete graphics card? Again not a proper solution, just a possible workaround - try temporarily switching Pro (in Windows graphics settings) to use the integrated graphics (if you're using an Intel or AMD CPU with iGPU).
... View more
07-16-2023
08:42 PM
|
0
|
0
|
2081
|
|
POST
|
Suggest you contact Esri Support (or your local distributor). https://www.esri.com/en-us/my-esri-login
... View more
07-14-2023
02:44 AM
|
2
|
0
|
1270
|
|
POST
|
It's probably related to the graphics driver. Very annoying and I don't have an answer, just a workaround - sharing the screen that Pro is on instead of the Pro window itself works for me in Teams.
... View more
07-13-2023
04:08 PM
|
3
|
0
|
2113
|
|
POST
|
You could use PDAL. Installation instructions in the Quickstart pdal translate input.laz output.las
... View more
07-04-2023
02:31 AM
|
0
|
0
|
3630
|
|
POST
|
That won't work. Python Toolboxes aren't scripts. They are libraries and as such don't really get run, they get imported, the Tool class is instantiated and the tools execute method is called. You are missing all the required Tool methods (execute, getParameterInfo, isLicensed etc...) I think what you need is a simple script, either standalone or attached to a regular toolbox.
... View more
06-27-2023
02:41 PM
|
1
|
1
|
2034
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-24-2022 03:08 PM | |
| 1 | 07-30-2025 03:00 PM | |
| 1 | 06-10-2025 08:06 PM | |
| 5 | 05-20-2025 07:56 PM | |
| 1 | 05-04-2025 10:34 PM |