POST
|
1) Are you still searching for workflows? 2) Once you have clustered your fire events, how do you plan on analyzing it? - Zach
... View more
Tuesday
|
0
|
1
|
19
|
POST
|
Strange issue, probably been going under my radar for two years. I export a pdf from a layout, it looks crisp in my PDF Viewer (BlueBeam or Adobe). But when I print, it's aliased everywhere: the labels, annotations, legend, even the linework from lines and polygon symbology. What is going on? It appears to be a Pro thing, as I printed a downloaded map exported from Desktop, and it looks crisp and prints great. HOW IT LOOKS IN PDF VIEWER HOW IT PRINTS (printed then scanned; I understand scanning involves loss of quality, but this fairly close to print) As you can see, the red lines are clearly aliased. I've tried all combinations of checkboxes in ExportToPDF from the GUI, including 1) Embed Fonts 2) Compress Vector Graphics 3) Turning off Halos 4) [there is no Transparency]. 5) Printing at original PDF size too. I also printed some old figures; same deal. Does anyone have any suggestions? thanks, Zach 3.0.2
... View more
Monday
|
0
|
0
|
117
|
POST
|
Seems Python CIM Access is a continuation of potentially productive Python automation in the ArcGIS workflow that will eventually flame out because the API design failed to abstract xml hierarchical file manipulation into classes, methods, and attributes that were generalized coherently. Look no further than these highly ranked Stack Exchange GIS Pros who essentially advise those interested in the FieldMapping classes to...brute force it ( Field Mapping Alternatives ). The last line is my Case In Point. Accessing symbology on layers symbolized by unique values should not involve drilling down 7 times; particularly symbol.symbol import copy
p = arcpy.mp.ArcGISProject('current')
m = p.listMaps('Map')[0]
l = m.listLayers('COS_basin_minor_2024')[0]
cim_lyr = l.getDefinition('V3')
# Change or View Colors
cim_lyr.renderer.groups[0].classes[0].symbol.symbol.symbolLayers[1].color.values
>>> [348, 29, 99, 100] If anybody has advice on taming the CIM from a productivity and reproducibility standpoint, I'd love to hear YOUR successful applications. It seems accessing attributes like symbology, labels, etc. vary based on whether there is a color ramp applied, symbology from field values, and of course no continuity between rasters and vectors. Very reminiscent of the difficulty in manipulating Field Mappings i.e. merging data. More to be Desired, Zach
... View more
a week ago
|
1
|
1
|
147
|
POST
|
I'm not sure about ArcGIS Pro tools, but in QGIS, and more specifically the Geospatial Data Abstraction Library (GDAL), there is an easy way to merge with overlapping rasters. Raster --> Merge. You would need to create a list as a text file with the full path to ALL your 350 tiles. The order in which they're listed determines the priority for merging the overlapping areas. If they are all all in the same directory, we could script that in Python and call in Pro. path/to/raster1.tif path/to/raster2.tif In this case, raster1 pixels would replace raster2 pixels in the merged output. For then clipping the merged raster, that would be in QGIS/GDAL using GDAL_warp but require a Python Script most likely (as opposed to directly in the QGIS GUI). You could presumably find similar functionality in Arc, but...not sure. It may help design a solution if you share this: export your model as a script Zach
... View more
03-05-2024
12:15 PM
|
0
|
0
|
83
|
POST
|
Didn't the right-click. Did it! Thanks for the subsequent post too. I've been doing it all wrong. Never knew about they "check syntax". I did have an issue that my eyes weren't trained to (a string with extra quotation mark). Now time to discover all the validation logic I messed up.
... View more
03-04-2024
10:19 AM
|
1
|
0
|
210
|
POST
|
I've made a handful of Python Script Tools successfully. My current project is a bit trickier. In the past, I'd get the below red exclamation point and traceback my steps manually and find my error in the .pyt file. However, I can't track it down this time and there are no Tracebacks, or obvious ways in the GUI to determine the source of the error. I should note, this script tool was working prior to my recent attempted update, and still works when I manually comment out the new edits. I'm happy to post the script, but I'm primarily in need of a debugging tool or workflow. I should mention, I'm developing in PyCharm which has built-in syntax highlighting, so these errors are not Python-related necessarily. I think they are related to my validation and logic within the toolbox framework, so I need debugging from a tool, log, etc. in Pro. Help is MUCH appreciated. Zach Pro 3.0.2
... View more
03-04-2024
10:06 AM
|
0
|
3
|
228
|
POST
|
240K MB shapefile. It's a large one - HEC-RAS inundation boundary generated from HEC-RAS. This is the US Army Corp's Hydraulic Modelling software (FYI). There is a geometry issue I found using (surprise, surprise) QGIS (and quickly). It's a self-intersection. No matter how long I let the Repair Geometry or Check Geometry tools churn, the tool never finishes. I had the same issue a few months ago, but fixing the geometry issue in QGIS manually, did not fix the layer. I had to perform the Repair Geometry Tool in Pro to fix the shapefile. Does anybody have suggestions or similar experiences? Pro 3.0.2 | Using the ESRI method with the tool thanks, Zach
... View more
02-22-2024
08:19 AM
|
0
|
3
|
263
|
POST
|
Adam - are you using ArcGIS Pro? If so, I may have a solution. let me know...
... View more
01-24-2024
10:11 AM
|
0
|
0
|
195
|
POST
|
Hi, I need maps in PNG format (or TIFF) for final product, but using a PDF as an intermediary is nice because in BlueBeam (PDF software) or Adobe Acrobat we can edit text directly, in the title block, etc. This saves me time for minor tweaks, but I'm wondering if the quality degrades when going PDF to PNG vs. directly to PNG from Pro. thanks, Zach
... View more
01-24-2024
10:06 AM
|
0
|
1
|
455
|
POST
|
Hi Moritz. Not an answer, but a follow up question related to your experience. Do you find that the quality of the PNG degrades when exporting to PDF then to PNG externally. Relative to directly exporting to PNG from ArcGIS Pro. Much appreciated, Zach
... View more
01-24-2024
09:56 AM
|
0
|
0
|
282
|
POST
|
@RhettZufelt has a nice option, but it is not interactive with the webmap open. @JonEmch is referring to popups. What the OP wants and misses from Map Viewer (me too!) is the ability to open the popup from a link directly in the attribute table in the webmap itself. It's time-consuming to interactively navigate through a field collection map with attachments without that previously-available functionality.
... View more
09-14-2023
12:58 PM
|
1
|
0
|
191
|
POST
|
Same boat. [redacted criticism]. Would love to make it 3 days without some software issue in the ESRI universe...
... View more
09-13-2023
08:26 AM
|
0
|
0
|
725
|
POST
|
Hi Luke, I almost tagged you on this post, as you seem to be the Resident Python Toolbox Expert on the forum. That makes...more sense. If you get time (no rush) perhaps you can use my below example as an example to point out anything I did wrong, inefficient, redundant, etc. It's based off of your Python Toolbox sample code chunk on this post - arcpy-parameter-for-arcgis-pro-document . There the guy was accessing layouts from a project via arcpy.mp.ArcGISProject(<project_name>). Mine has one extra wrinkle. I am cascading the variable project_name to map_name to layer_name, ultimately updating the CIM of a layer in the execute method. It works (took awhile). Note that I am truncating the execute codeblock for brevity. But first here is the toolbox look: import pandas as pd
class ToolBox(object):
def __init__(self):
'''
Define the toolbox (name of the toolbox is name of .pyt file).
'''
self.label = "Color Ramp Toolbox"
self.alias = "Color Ramp Toolbox"
self.tools = [color_ramp_from_csv]
class color_ramp_from_csv(object):
'''
classifies color ramp from csv. Note that user must classify color ramp simply with number \
of classes initially prior to running
'''
def __init__(self):
self.label = "format_color_ramp"
self.description = "specify breaks, colors and labels for color ramps of rasters"
self.canRunInBackground = False
def getParameterInfo(self):
'''
Define parameter defitions
'''
param0 = arcpy.Parameter(
displayName="Current Pro-Document",
name="currentProDocument",
datatype="GPBoolean",
parameterType="Optional",
direction="Input")
param1 = arcpy.Parameter(
displayName="Other Pro-Document",
name="otherProDocument",
datatype="DEFile",
parameterType="Optional",
direction="Input")
param1.filter.list = ['aprx']
param2 = arcpy.Parameter(
displayName="map",
name="map",
datatype="GPString",
parameterType="Required",
direction="Input")
param3 = arcpy.Parameter(
displayName="layer",
name="layer",
datatype="GPString",
parameterType="Required",
direction="Input")
parameters = [param0,param1,param2,param3]
return parameters
def isLicensed(self):
'''
set whether tool is licensed to execute.
'''
return True
def updateParameters(self, parameters):
'''
Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parameter
has been changed.
'''
if parameters[1].altered and not parameters[1].hasBeenValidated:
parameters[0].value=False
parameters[2].value=None
parameters[2].filter.list=[]
prodoc = parameters[1].valueAsText
prodoc_selected = True
elif parameters[0].altered and not parameters[0].hasBeenValidated:
parameters[1].value=None
parameters[2].value=None
parameters[2].filter.list=[]
prodoc='current'
prodoc_selected=True
else:
prodoc_selected = False
if prodoc_selected:
project=arcpy.mp.ArcGISProject(prodoc)
map_list = [m.name for m in project.listMaps()]
parameters[2].value=None
parameters[2].filter.list=map_list
parameters[3].value = None
parameters[3].filter.list = []
if parameters[2].altered and not parameters[2].hasBeenValidated:
if parameters[0].value is not None:
prodoc = 'current'
elif parameters[1].value is not None:
prodoc = parameters[1].valueAsText
project = arcpy.mp.ArcGISProject(prodoc)
map_name = parameters[2].valueAsText
map_object = project.listMaps(map_name)[0]
layer_list = [l.name for l in map_object.listLayers()]
parameters[3].filter.list=layer_list
return parameters
def updateMessages(self, parameters):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
return
def execute(self, parameters, messages):
"""The source code of the tool."""
if parameters[0].value is not None:
prodoc = 'current'
elif parameters[1].value is not None:
prodoc = parameters[1].valueAsText
project_name=prodoc
layer_name = parameters[3].valueAsText
map_name = parameters[2].valueAsText
p = arcpy.mp.ArcGISProject(project_name)
m = p.listMaps(map_name)[0]
l = m.listLayers(layer_name)[0] As I said, it functions well but perhaps I missed or misused some conditions in my if statements. I understand that altered property is re-assigned every time a parameter is changed and that hasBeenValidated relates to non-internal ArcGIS validation related to updateParameters method. However I still don't understand WHEN hasBeenValidated is checked. ex) Drop down, select parameter1, altered is assigned but nothing is validated? So when does validation occur? In regards to the value and valueAsText confusion, it seems that there are loads of examples of people using it INSTEAD OF hasBeenValidated or altered. For instance the OP in the post I referenced above, does this (line 44): def updateParameters(self, parameters):
if parameters[0].value:
p0Val = parameters[0].valueAsText Couldn't it be def updateParameters(self, parameters):
if parameters[0].altered:
p0Val = parameters[0].valueAsText ? Thanks for sharing your knowledge... Zach
... View more
09-11-2023
04:29 PM
|
0
|
0
|
468
|
POST
|
1) I've read the docs ( customize tool behavior ) 2) I've received excellent feedback in a related post ( related post ) 3) And followed similar workflow examples ( Arcpy paramaters example ) My observation is that people use `param.valueAsText for some reason as validation that a parameter has been entered. Others mix and match param.altered for a similiar purpose. While others use hasBeenValidated. Reposting this example from the ESRI docs - 1) above: def updateParameters(self, parameters):
# Set the default distance threshold to 1/100 of the larger of the width
# or height of the extent of the input features. Do not set if there is no
# input dataset yet, or the user has set a specific distance (Altered is true).
#
if parameters[0].valueAsText:
if not parameters[6].altered:
extent = arcpy.Describe(parameters[0]).extent
if extent.width > extent.height:
parameters[6].value = extent.width / 100
else:
parameters[6].value = extent.height / 100
return Why not do this: def updateParameters(self, parameters):
if parameters[0].altered:
if not parameters[6].altered:
#continue My questions in relation to this example are: 1. What is the difference between altered and hasBeenValidated and can a paramaters be UNaltered and validated and altered and UNvalidated. 2. When does validation occur? 3. Is valueAsText/value just a syntactically awkward way of checking if a paramater has been set? (I understand we can assign new values with this property) 3. when to use value vs. valueAsText - i.e. if param[0].<value or valueAsText:
# do something My guess is that valueAsText/value is way overused and due to sparse documentation people made their Python Toolboxes work by misusing these properties. Hence my attempt to clarify my understanding. Thanks, Zach
... View more
09-10-2023
11:04 AM
|
0
|
2
|
568
|
POST
|
Not a sexy post, but something bad has corrupted something in a project. This isn't necessarily the issue, it may be the symptom of some larger issue with a project. Having debilitating slowness and dysfunctionality with a project. Basic everything involves 30 seconds of churning. Turn layer on, turn labels on, opening, closing tabs. Troubleshooting steps: 1) Cleared cache for project 2) Turned off Maplex 3) Removed large FCs and the large raster 4) Exported as layout file (.pagx) and started new project, imported. Even for #4, no resolution. Same slowness, error pops up. I close it, it emerges again multiple times. Note that I opened another unrelated project, and no issues. So it's not systemic or a reinstall situation. I wonder if something is corrupted in the project geodatabase or an associated file. Yet when I remove all FCs from that gdb in a map, the issue persists. But that's all I can think of. Troubleshooting Step 4 has me baffled because I'm importing a lean layout with only 4 FCs that are all pretty small. Any ideas? Zach 3.0.2 | Windows 11
... View more
09-08-2023
07:48 AM
|
0
|
1
|
277
|
Title | Kudos | Posted |
---|---|---|
1 | a week ago | |
1 | 02-16-2023 10:34 AM | |
1 | 03-04-2024 10:19 AM | |
1 | 02-21-2022 02:03 PM | |
1 | 09-14-2023 12:58 PM |
Online Status |
Offline
|
Date Last Visited |
yesterday
|