|
IDEA
|
It's a strange limitation/bug. A half workaround would be to multiply by 1/N e.g. if you want to divide by 2, instead multiply by 0.5. I say "half workaround" as obviously if you want to divide by a field value instead of a number, then this won't work.
... View more
12-06-2022
12:14 PM
|
0
|
0
|
1039
|
|
IDEA
|
@HannesZiegler thankyou. This will make the lives of powershell conda users much easier.
... View more
11-30-2022
07:41 PM
|
0
|
0
|
6577
|
|
POST
|
Firstly, don't use the old legacy arcpy.SearchCursor, use the newer, faster arcpy.da.SearchCursor. See Data access using cursors: Legacy: The data access module (arcpy.da) was added in ArcGIS 10.1. The original cursors are still supported; however, the new arcpy.da cursors include significantly faster performance. In most cases, the help documentation describes the use of the arcpy.da cursors. For more information about the classic cursor model, see the InsertCursor, SearchCursor, and UpdateCursor topics. Second, you need to access the value from the row, not the row itself: Data access cursor example: with arcpy.da.SearchCursor(DeltaTable, [QTField], "FME_Status IS NULL") as cursor:
QTSet = [row[0] for row in cursor] Or row.getValue(QTField) if you really must use a legacy cursor...
... View more
11-29-2022
04:47 PM
|
1
|
0
|
2787
|
|
IDEA
|
Workaround: pixel_types = { "U1": "1_BIT", "U2": "2_BIT", "U4": "4_BIT", "S8": "8_BIT_SIGNED", "U8": "8_BIT_UNSIGNED", "S16": "16_BIT_UNSIGNED", "U16": "16_BIT_SIGNED", "S32": "32_BIT_UNSIGNED", "U32": "32_BIT_SIGNED", "F32": "32_BIT_FLOAT", "F64": "64_BIT" } pixel_type = pixel_types[arcpy.Describe("raster").PixelType] # or pixel_type = pixel_types[arcpy.da.Describe("raster")["PixelType"]]
... View more
11-23-2022
12:30 PM
|
0
|
0
|
1398
|
|
IDEA
|
Are you using Pro on a physical machine, a VM, or either a physical/VM through RDP? Physical What version of Pro are you using & encountering this problem with? Currently 2.8.x but all 2.x versions I can remember did this Is this machine being used in a multi-monitor setup? If so: Yes How many monitors? 2 Does focus shift when Pro opens on your Main monitor (it should open there by default) and you're working within an application on a secondary/tertiary monitor; when Pro opens on your Main monitor and you're working within an application also on the Main monitor; or both? Focus is stolen from apps on main monitor. I don't tend to actively use 2nd monitor for anything other than Pro secondary panes (catalog, TOC, toolbox etc) or if comparing documents so haven't noticed Pro focus shift from apps on 2nd monitor. Does this issue only occur while Pro is launching in Full Screen mode, in Windowed mode, or both modes? Occurs when launching full screen. I always launch full screen, so don't know about windowed. Does this issue only occur while you're launching Pro standalone (i.e. searching for ArcGIS Pro in Start & launching it/double-clicking on the 'ArcGIS Pro' shortcut on your Desktop or Task Bar), when you're launching Pro via Opening a Project/aprx file, or both? I always launch Pro from a pinned taskbar icon, either as a new window or by right-clicking and selecting a recent project Do you have any custom configurations or admin settings that load while ArcGIS Pro is launching? If so, do any of these configurations modify the Home page that displays after Pro launches? No Do you have any custom Add-Ins installed? Yes, still focus shifts with it removed. Are there any observations you've made that don't fall into any of the questions above? If so, please include them. PC is a laptop with 4K screen plugged into dock running 2x 1080 monitors. 4K laptop screen is off when docked.
... View more
11-18-2022
02:50 PM
|
0
|
0
|
3074
|
|
POST
|
It should already have a projection defined. And that projection should be a northern hemisphere UTM zone, regardless of whether the scene is in the northern or southern hemisphere. https://www.usgs.gov/faqs/why-do-landsat-scenes-southern-hemisphere-display-negative-utm-values
... View more
11-17-2022
12:49 PM
|
0
|
0
|
3080
|
|
POST
|
Here's a version (of just the Scripts, the rest of the tool you need from here) that works in ArcMap 10.8. Note the model doesn't work in ArcGIS Pro as it doesn't iterate.
... View more
11-13-2022
02:08 PM
|
0
|
0
|
1586
|
|
POST
|
You can replace gp.SingleOutputMapAlgebra_sa(InExpression, PointPattern) with arcpy.gp.SingleOutputMapAlgebra_sa(InExpression, PointPattern) but you also have to change all the other gp.etc... to the appropriate arcpy. or arcpy.env or arcpy.management etc... and there's a lot of correcting case required as the arcgisscripting gp object wasn't case sensitive but arcpy is. e.g. gp.CellSize or gp.cellsize needs to become arcpy.env.cellSize
... View more
11-11-2022
12:52 AM
|
0
|
0
|
1596
|
|
POST
|
Three problems: scratchWorkspace=r"\\mynetworklocation\xArcGISProTasks\WorkRoadSegments.gdb\", workspace=r"\\mynetworklocation\xArcGISProTasks\WorkRoadSegments.gdb\" Python raw strings r"\\some\string" can't end in a single backslash, i.e. r"\\some\string\" Why can't Python's raw string literals end with a single backslash? 3. Your spatial reference is invalid as it is wrapped in double quotes and contains embedded double quotes. Either do what @DanPatterson suggests, using the factory code (2926) to create a SpatialReference object (which I recommend), or wrap the spatial reference string in single quotes. And next time, include the full error message, please don't just say "a syntax error". You're removing valuable information that can help others help you.
... View more
11-01-2022
07:17 PM
|
0
|
0
|
2452
|
|
POST
|
You're telling arcpy to give you the parameter as text i.e. a str object when you use GetParameterAsText. You need a Raster object. Try using either: #GetParameter
SuitabilityRaster = arcpy.GetParameter(1) or # arcpy.Raster
SuitabilityRaster = arcpy.Raster(arcpy.GetParameterAsText(1)) You'll also need to set the workspace: arcpy.env.workspace = arcpy.GetParameter(0) And possibly for convert inRaster to a Raster object as arcpy.ListRasters() returns strings for inRaster in rasters:
# you may need to convert inRaster to a Raster object
# as arcpy.ListRasters() returns strings
SuitabilityRaster = SuitabilityRaster + arcpy.Raster(inRaster) So you'll end up with something like: workspace = arcpy.GetParameterAsText(0)
SuitabilityRaster = arcpy.Raster(arcpy.GetParameterAsText(1))
rasters = arcpy.ListRasters()
for inRaster in rasters:
SuitabilityRaster = SuitabilityRaster + arcpy.Raster(inRaster)
SuitabilityRaster.write(workspace + "SuitabilityScoringGrid_Raster")
... View more
10-30-2022
02:05 PM
|
0
|
0
|
1572
|
|
POST
|
Apart from the blank template method, this is not possible using arcpy. This is an intentional design decision: Must work with existing map documents or layer files The arcpy.mapping module was designed so that it can be used to modify existing elements within already existing map documents (.mxd) or layer files (.lyr). <...snip...> You must carefully author a map document or layer file using ArcMap ahead of time with all the appropriate elements and then use arcpy.mapping to manipulate its contents However, it was possible with python by accessing ArcObjects. For more details, see this answer on GIS StackExchange. This was written quite a long time ago, I don't know if it still works.
... View more
10-27-2022
09:57 PM
|
0
|
0
|
859
|
|
POST
|
If you're generating the polygon values using some formula, you can apply that formula to the raster directly (if you have a spatial analyst license). Alternatively, convert the raster to points not polygons or tick the label points when creating your fishnet, populate the points with your values instead of the polys then convert the points to raster, it'll be quicker. Since you already have the polys, another option is convert your polys to point and then convert those to raster.
... View more
10-27-2022
09:43 PM
|
0
|
1
|
1466
|
|
POST
|
No. But you can just convert your polygon to a new raster with those values. Don't forget to set cell size, extent and snap raster environments appropriately.
... View more
10-27-2022
07:12 PM
|
0
|
0
|
1477
|
|
POST
|
Yes, I think @BarryNorthey is right, there's no .tif in that folder. In your Windows File Explorer, click on the View tab and check "File name extensions" in the Show/hide group. It looks to me like known file extensions aren't being shown and you only have files with the following extensions in that folder .tfw .tif.aux.xml .tif.ovr .tif.xml
... View more
10-26-2022
09:27 PM
|
0
|
0
|
8793
|
| 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 |