|
POST
|
You can get the length of a string with the COUNT function, then you can use that length to pick which branch to take.
... View more
01-17-2023
04:44 PM
|
0
|
0
|
2250
|
|
POST
|
If I'm understanding your question correctly: merge both district layers together, then spatially join the precincts to the combined districts to determine which one it lands in. If the precinct can span multiple districts then the Intersect tool combined with a check for the largest intersecting area could prove more useful.
... View more
01-17-2023
04:41 PM
|
0
|
0
|
416
|
|
POST
|
Ah that makes more sense. In that case you can probably just make the "ma" variable the name of each new feature layer, that way you can change selection sets and such without clobbering the other layers.
... View more
01-13-2023
02:36 PM
|
0
|
0
|
3222
|
|
POST
|
For what it's worth, here's what the selectors look like after I ran the CSS through a formatter: .sassy-theme .esri-widget .sassy-theme .esri-widget--button, .sassy-theme .esri-menu, .sassy-theme .esri-popup, .sassy-theme .esri-popup__main-container{
background-color: rgb(27, 27, 9);
}
.sassy-theme .esri-widget.esri-search, .sassy-theme .esri-search .esri-widget--button , .sassy-theme .esri-widget .esri-menu {
background-color: rgb(198, 198, 63);
color: rgb(121, 5, 50);
font-size:larger;
font-family: 'Montserrat';
}
.sassy-theme .esri-attribution .sassy-theme .esri-attribution a .sassy-theme .esri-popup .esri-attribution .sassy-theme .esri-popup .esri-popup__pointer-direction, .sassy-theme .esri-popup .esri-popup__button, .sassy-theme .esri-button, .sassy-theme .esri-input, .sassy-theme .esri-widget a The formatter flagged the last line as an error, maybe the extra definitions are conflicting with something? If it's not that, crack open your dev tools and look at the cascade order on those text elements. You might have to select a more specific element, maybe something related to tables.
... View more
01-13-2023
01:54 PM
|
0
|
1
|
1302
|
|
POST
|
I have a feeling that conflating a layer with its underlying data is causing issues here. You're attempting to wipe data with the path "memory/veg_layer" and then creating a feature layer from another data source with the layer name "memory/veg_layer". It looks like you already have the data in your "inrev_data_by_model_area[ma]" object so if you should probably create the feature layer outside the loop and reuse it each go around. Or create a new feature layer each loop with a different name, something like: for i, thing in enumerate(things):
lyr = arcpy.management.MakeFeaturelayer(inrev_data_by_model_area[ma], f"layer_{i}")[0]
# Do stuff with lyr??? Lastly, check your environment settings. If overwriting data is disabled it can lad to issues like this. A common pattern is to store the value of arcpy.env.overwriteOutput, set it to true, run the code that overwrites data, then set the env variable back to the previous state to avoid overwriting the user's preferences unnecessarily.
... View more
01-13-2023
01:33 PM
|
1
|
2
|
3246
|
|
POST
|
The "strftime" method on Python datetime objects is the go-to way to get a stable text version of that data. Here's an example for Calculate Field: !Created_Date!.strftime("%Y-%m-%d %H:%M:%S") For a full list of format codes check out https://strftime.org. If you want true live updates you'll probably want to look into Attribute Rules, here's an example for Arcade: Text($feature["Created_date"], "Y-MM-DD HH:mm:ss") The reference for this is https://developers.arcgis.com/arcade/function-reference/text_functions/#text. There's disagreements in how the format codes work between the reference and the sample code so play around with the various opstions.
... View more
01-13-2023
12:00 PM
|
1
|
0
|
983
|
|
POST
|
As per the good word, if you grab a shapefile with this tool the output will also have the .shp suffix. You're better off with Feature Class To Feature Class and Table to Table instead as this gives you control over the output name.
... View more
01-13-2023
11:22 AM
|
0
|
1
|
1610
|
|
POST
|
Here's the link to the documentation: https://www.esri.com/en-us/arcgis/products/arcgis-dashboards/resources. Try building some basic dashboards with the info you find here and come back here if you have a specific question the docs couldn't help you with. Don't forget that you need ArcGIS Online or ArcGIS Enterprise access and relevant data to get started. Have fun!
... View more
01-13-2023
11:15 AM
|
1
|
0
|
747
|
|
POST
|
If you store your temporal data adjusted to UTC then you can either convert it to the user's current time (some applications will do this automatically, otherwise you can use a conversion function, such as Arcade's "ToLocal"). If you need to store the data in the local time zone of capture, you can create a second field, then combine the UTC time with a spatial join to time zone polygons and apply the appropriate offset. Don't try to be clever with hardcoded offsets, time zones are subject to change at any time so you'll need a copy of the time zone boundaries relevant to your date range. For live data going forward you can use the World Time Zones service from the Living Atlas, for historical data you'll have to track down historical zones. Handling time zones outside of your current locale is one of the toughest computer problems out there so good luck!
... View more
01-12-2023
03:27 PM
|
0
|
2
|
1577
|
|
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
|
2263
|
|
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
|
1810
|
|
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
|
791
|
|
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
|
1262
|
|
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
|
1435
|
|
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
|
1859
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 13 hours ago | |
| 1 | a week ago | |
| 1 | Thursday | |
| 1 | a week ago | |
| 1 | a week ago |
| Online Status |
Offline
|
| Date Last Visited |
13 hours ago
|