|
POST
|
A few people have posted suggestions, here's one that works with any number of fields and any value: def setIfFound(value, *checks):
return value if value in checks else None
... View more
10-13-2022
01:08 PM
|
2
|
1
|
1725
|
|
POST
|
Creating a spatial layer by joining features to a parent table has been a long-running deficiency in ArcGIS. The classic method to work around this is to create Query Layer or database view but this only works for EGDBs and a few other products and I assume your Survey123 data is all hosted which rules this out. The other workaround is to write a Python script that loads both tables, joins them and then outputs features to a third shadow table that you use for analysis. This prohibits real-time analysis and requires tool maintenance but it works! If there's been platform advancements to handle this use case then I haven't heard of any but that doesn't mean they aren't out there, worst case scenario you file or bump an Idea post and hope for the best.
... View more
09-29-2022
05:10 PM
|
0
|
1
|
1024
|
|
IDEA
|
Please add the ability to use an arcade expression for every map series field: name, page number, spatial reference etc. This would decrease the iteration time for map series where I'd have to copy out a layer to a geodatabase just to add and calculate map series specific fields.
... View more
09-29-2022
03:30 PM
|
12
|
7
|
2453
|
|
POST
|
I assume you're trying to clean up address data, which doesn't have a generic solution. If it's the same error over and over you can use string methods such as .index, .split, .join, slicing etc. to fix the error, here's an example that'll work for your example string: def fixAddr(x):
sNum, sData = x.split()
sDir = sData[0]
sName = sData[1:-2]
sType = sData[-2:]
return f"{sNum} {sDir} {sName} {sType}" If you want a generic method, the only technique I can think of is to run your address string through a geocoder and then pull out the component parts from the returned address. This is much more complex than just basic field calculation but it's the most bulletproof method I've found. Good luck!
... View more
09-21-2022
01:41 PM
|
0
|
0
|
1036
|
|
POST
|
Labels are locked to the feature they describe. If you want freely placeable text, you have a few options: Create a separate set of point features to hold the labels and then add them to the map with a blank symbol. These label points will work in virtually any part of an ArcGIS system but you're limited on how fancy the placement and text formatting can get Create an annotation feature class. These feature are explicitly designed to handle text and can store complex formatting rules. The catch is they don't play well with web services so unless you acquire a custom extension for annotation layers they're basically stuck in the desktop. Both maps and layouts have a layer for general graphics, such as text and images. These graphics technically aren't geospatial data and there's limits to data interoperability but if you just need a quick label for your PDF they'll do just fine.
... View more
09-21-2022
01:34 PM
|
0
|
0
|
1565
|
|
POST
|
The Pro geoprocessing system has this neat feature buried in the docs where you can create standard Python packages that contain script tools, then install those packages to your current environment with the accompanying toolbox infrastructure. More info here. The docs use a Python toolbox in their examples but there's mentions of supporting standard toolboxes as well, most notably in the introduction to the page I linked. However, when I build a package with a standard toolbox and then install it, attempting to run the tool in Pro 3.0.1 results in this error: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\JDangermont\AppData\Local\ESRI\conda\envs\testing\Lib\site-packages\foo\esri\arcpy\SampleToolbox.py", line 20, in SampleTool
raise e
File "C:\Users\JDangermont\AppData\Local\ESRI\conda\envs\testing\Lib\site-packages\foo\esri\arcpy\SampleToolbox.py", line 17, in SampleTool
retval = convertArcObjectToPythonObject(gp.SampleTool_SampleToolbox(*gp_fixargs((), True)))
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 510, in __getattr__
val = getattr(self._gp, attr)
AttributeError: Object: Tool or environment <SampleTool_SampleToolbox> not found This could be some weird misconfiguration or environment problem on my end so I've attached a little package that you can download, build, and add to your testing environment. You can build the package using the standard instructions, install it with pip, relaunch Pro and then run arcpy.SamplePythonToolbox.SampleTool() and arcpy.SampleToolbox.SampleTool() from the Python window. If the first tool succeeds but the second tool fails then it's safe to say atbx files aren't actually compatible with this packaging system. If so I hope someone from esri can dig into this as it's most likely just an issue with the autogenerated wrapper code.
... View more
09-21-2022
11:52 AM
|
0
|
0
|
438
|
|
POST
|
My general rule for writing script tools is to structure them like this: def main(param0, param1, param2):
return doSomethingWith(param0) + doOtherThingWith(param1 + param2)
if __name__ == "__main__":
param0 = arcpy.GetParameterAsText(0)
param1 = arcpy.GetParameterAsText(1)
param2 = arcpy.GetParameterAsText(2)
param3 = main(param0, param1, param2)
arcpy.SetParameterAstext(3, param3) This has two big benefits. First, you ensure all the parameters are yanked out of the aether and loaded into proper variables before you run your task. Second, you now have a main function that isn't strictly dependent on parameter state, which means you can write tests for it or call the function from other scripts without going through importing a toolbox.
... View more
09-21-2022
11:13 AM
|
1
|
0
|
2384
|
|
POST
|
If you're willing to dive into arcpy cursors and geometry objects you should be able to find a way to load in lines, generate points at set intervals along said line and then load those points into a feature class. There might be a stock geoprocessing or editing tool we're both missing but if you like solving little programming challenges this seems worth digging into.
... View more
09-15-2022
04:14 PM
|
0
|
0
|
1842
|
|
POST
|
It looks like the only exit point that can return a null value is the final return for the address itself. You can coerce a null address to your string like so: var address = closestFeatureWithDistance['feature']['Address']
return Iif(IsEmpty(address), "Not Detected", address) I think the issue is you're checking if the entire "closestFeatureWithDistance" object is null on line 33 rather than just the Address attribute.
... View more
09-15-2022
10:47 AM
|
1
|
1
|
945
|
|
POST
|
Attribute Rules sound like the clear answer here, you can get started at this link. If your datasets need to remain accessible in ArcMap then this is off the table, 2 things you can try are: Using the new Field Maps arcade functionality to calculate the attributes client-side (link). This'll only work if your only point of entry to the data is through Field Maps. Create database triggers in your RDBMS if available. This is a very fragile process as anything that changes the underlying table structure (such as enabling versioning) will break your triggers and you may have to write some complex SQL to keep the tables in line, but this'll work across the board.
... View more
09-15-2022
10:41 AM
|
0
|
1
|
4801
|
|
POST
|
Try and reduce your workflow down to something that's easy to replicate and try to make it happen again. If you can reliably delete records just by using the join commands then you need to take this to your support contact as this could be a major regression in Pro, or at least signs that something in your environment is acting up.
... View more
09-15-2022
10:18 AM
|
1
|
0
|
2335
|
|
IDEA
|
Quoting the latest docs: For layers in the feature service that can store attachments, the Create or Update operation allows editors of the feature service to add an attachment to a feature. The Update operation further enables editors to update or delete an attachment that is associated with a feature. If only the Delete operation is enabled, editors can delete attachments. I can't think of a single scenario where the user would be forbidden from deleting a feature, but should be able to delete that feature's attachments. Please align the attachment permissions with the feature permissions so that users must have delete permissions to delete attachments.
... View more
09-02-2022
08:44 AM
|
9
|
3
|
1468
|
|
POST
|
One thing you can try first is to add "?f=json" to the end of your URL, this should return the resource's JSON definition. I've encountered a lot of ArcGIS Server sites that forbid HTML viewing but are fine with JSON, you might be in the same boat.
... View more
08-25-2022
05:04 PM
|
0
|
0
|
741
|
|
POST
|
If you're rendering the map in Pro, you can go to the Map's properties and fiddle with the Clip Layers section. This'll create a clip mask that you can apply to layers, including the output of the Heat Map symbology. Here's an example of what this looks like from a layout I made: If you don't have Pro or you have the heat map as a raster then you'll need a tool that can clip rasters, not sure what the workflow is there.
... View more
08-25-2022
05:01 PM
|
0
|
0
|
1037
|
|
POST
|
Has anyone found a working setup for script tool debugging with Pro 3.0 and VS2022? I'm following the steps from the usual guide which worked fine with Pro 2.9 and VS2019 but nothing seems to be working right now. I was able to get an exception caught at one point but I haven't been able to replicate it after a dozen attempts. I don't have VS2019 on hand so I can't test if it's just an issue with VS2022 but I'd hope the version of Pro built on the latest .NET release would also support the current Visual Studio.
... View more
08-05-2022
03:18 PM
|
1
|
1
|
1211
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a week ago | |
| 1 | Thursday | |
| 1 | Wednesday | |
| 1 | Wednesday | |
| 1 | 12-04-2025 08:21 AM |
| Online Status |
Offline
|
| Date Last Visited |
Monday
|