|
POST
|
You can try something like this: from os import path
def getFiles():
def fname(x): return path.splitext(path.basename(x))[0]
gisFiles = arcpy.ListFeatureClasses() + arcpy.ListTables() + arcpy.ListRasters() # And so on so forth.
gisBaseNames = {fname(g) for g in gisFiles}
otherFiles = [f for f in arcpy.ListFiles() if fname(f) not in gisBaseNames]
return sorted(gisFiles + otherFiles) The catch is if you have, say, "mydata.shp" and "mydata.xlsx" in the same folder you'll lose the xlsx file. The fix for that is to build up a list of known special GIS extensions and split those files out, but that's a bit harder to write up so this should be a starting point at least.
... View more
01-12-2023
03:17 PM
|
0
|
0
|
2924
|
|
POST
|
Rigging up a Web Tool/Geoprocessing Service with the Remove Attachments tool should work. I'd use it in a script tool that constructs the match table from scratch for each run, then feeds the results into the main GP tool. You mentioned the workflow is to just wipe all but the most recent attachment which makes things much easier: make the input a polygon feature set, use the feature set to select the appropriate features in the features table, then use that with the attachments table to accomplish your goal. To the user all they do is draw a polygon and run the tool, very simple and easy to explain.
... View more
01-09-2023
03:31 PM
|
0
|
0
|
2062
|
|
POST
|
My naïve guess is Find Identical grabs the XY tolerance for the input features and uses that as a delta while Geometry.equals doesn't. I've never run into this as I also use the numpy method in conjunction with the feature's tolerance (or just a quick abs(a.X - b.X) < tolerance style check) but it really should be documented.
... View more
11-24-2022
04:29 PM
|
0
|
0
|
1128
|
|
POST
|
In theory, you can take the JSON object definitions the AGOL app generates in your web map files using AGOL Assistant (or a similar tool) and copy-paste them into your Enterprise map. Assuming the AGOL map and the Enterprise map are otherwise identical this should work fine as the Field Maps app will blindly read the incoming JSON and set the expression definitions. In practice, this is at best extremely fragile as there's no guarantee any further updates to the map using the Enterprise tools will preserve these copied objects or leave them in the correct place. At worst you'll create subtle issues that manifest as corrupted data with no easy way to track down the root issue. Be prepared to extensively test your workflows and monitor all changes to the maps for potential issues. Caveat emptor and all that.
... View more
11-24-2022
04:09 PM
|
0
|
1
|
1712
|
|
POST
|
To my knowledge the Geocoder doesn't return a unique key per address or address range, so your best bet is to cache the results in a table somewhere and test against said table to determine what needs another run. Annoying, but if your duplicate addresses have the same format every time they repeat then you can save a ton of credits and time easily.
... View more
11-10-2022
02:07 PM
|
0
|
4
|
2080
|
|
POST
|
Replace your call to the "SaveToLayerFile" function with "m.addLayer(graphics)". The former is implicitly adding the new layer to the active map while Pro is open but that's not how GP tools work outside of Pro, so you need to explicitly add the layer through the Map object's method. If that doesn't work, try extracting the specific graphics layer result with "graphics = graphics[0]" first, sometimes full result objects act a bit odd.
... View more
10-27-2022
03:05 PM
|
1
|
2
|
3115
|
|
POST
|
There's a few places where this could've gone wrong: Do your changes remain if you retrieve the map's data in the assistant after saving? (This is the "View an Item's JSON" option) When you look in the "operationalLayers" section of the JSON does the layer have an itemId as well as a url property? If there's both you may have to update the itemId as well, or remove it if the service is now coming from outside your Portal's catalog, or add if if the service is now coming from the catalog. You mentioned "WFS", was the previous service also a WFS or was it an ArcGIS Feature Service? If the service types changed you might have to make further additions to the JSON definition for that layer, I haven't used OGC services in my org so I'm not sure if the structure is different. If you get the url for that layer from the JSON and then add a new layer from that url, does it point to the correct data?
... View more
10-26-2022
01:26 PM
|
1
|
0
|
1550
|
|
POST
|
You can add any GP Tool or script tool to a model provided it has the appropriate inputs and outputs. When in doubt, just drag something onto the model canvas and see if it works out (using your test data of course).
... View more
10-17-2022
01:38 PM
|
0
|
0
|
1694
|
|
POST
|
It looks like the second "find the closest thing" loop is incomplete, you need to sort your list and return the first result like you did above.
... View more
10-17-2022
01:36 PM
|
0
|
0
|
728
|
|
POST
|
Validation Rules are your best bet here, this won't catch errors in process but you can have someone make their edits in a temporary version and then QA it before posting back. You should also double-check that these fields are non-null down to the database level, that way you avoid one source of error (although that won't stop empty strings and such)
... View more
10-17-2022
01:29 PM
|
0
|
0
|
4713
|
|
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
|
2279
|
|
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
|
1350
|
|
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
|
13
|
7
|
3775
|
|
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
|
1438
|
|
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
|
2120
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-24-2023 11:47 AM | |
| 2 | 04-09-2026 11:36 AM | |
| 1 | 09-08-2023 10:07 AM | |
| 3 | 03-26-2026 08:11 AM | |
| 2 | 03-12-2026 01:41 PM |
| Online Status |
Offline
|
| Date Last Visited |
Monday
|