|
DOC
|
@cog_GIS_Admin here is helpful document on how use Windows Task Scheduler with python scripts:
https://community.esri.com/t5/python-documents/schedule-a-python-script-using-windows-task/ta-p/915861
... View more
10-07-2024
06:35 AM
|
0
|
0
|
25893
|
|
POST
|
Hi @TimHayes3,
Either URL will work. Each layer is added with an index value when published to a service. If you have 3 layers in your service, by default, the index would be sequential for each layer (i.e. FeatureServer/0, FeatureServer/1, FeatureServer/2).
The first URL will add all layers within your service. The second URL is calling an individual layer in the service by specify /0. If your service only has one layer, then both are synonymous.
... View more
10-07-2024
06:23 AM
|
0
|
0
|
1558
|
|
POST
|
@AprilWheeler ,
Make sure you are using the following URL when adding the ArcGIS Server connection:
JakeSkinner_0-1728306255677.png
... View more
10-07-2024
06:04 AM
|
1
|
0
|
1837
|
|
DOC
|
@cog_GIS_Admin check the casing of your username, this is case sensitive. For example, if your AGOL login is cog_GIS_Admin, and you specify cog_gis_admin, it will not authenticate.....even though cog_gis_admin will work in a web browser.
... View more
10-05-2024
09:29 AM
|
0
|
0
|
25957
|
|
POST
|
Hi @RemyShipman, you might be able to do this a little easier with search and update cursors. Below is an example:
import arcpy
from arcgis import GIS
# Variables
portalURL = 'https://portal.esri.com/portal'
username = 'portaladmin'
password = '**********'
itemID = '7dd52c5ef86b44efaaac764294abf163'
# Connect to Portal
print("Connecting to Portal")
gis = GIS(portalURL, username, password)
arcpy.SignInToPortal(portalURL, username, password)
# Reference services
print("Referencing services")
treeinventory = gis.content.get(itemID)
treeLyr = treeinventory.layers[0]
treeTbl = treeinventory.tables[0]
# Create dictionary of schedule
print("Creating dictionary of schedule")
schedDict = {}
with arcpy.da.SearchCursor(treeTbl.url, ['tree_id', 'pruningschedule']) as cursor:
for row in cursor:
schedDict[row[0]] = row[1]
del cursor
# Updating tree lyr
print("Updating tree")
with arcpy.da.UpdateCursor(treeLyr.url, ['tree_id', 'prunesched']) as cursor:
for row in cursor:
try:
row[1] = schedDict[row[0]]
cursor.updateRow(row)
except KeyError:
pass
del cursor
print("Finished")
... View more
10-03-2024
07:50 AM
|
2
|
0
|
1754
|
|
POST
|
Hi @Shane_EU, the following should work:
aprx = arcpy.mp.ArcGISProject("CURRENT")
mp = aprx.listMaps("Map")[0]
lyr_to_move = mp.listLayers("Airports")[0]
group_layer = mp.listLayers("SubGroup")[0]
# Use this to move a layer into a group layer
mp.addLayerToGroup(group_layer, lyr_to_move, "AUTO_ARRANGE")
# Remove layer from map
mp.removeLayer(lyr_to_move)
Before script:
JakeSkinner_0-1727961755364.png
After script:
JakeSkinner_1-1727961779266.png
... View more
10-03-2024
06:23 AM
|
4
|
0
|
1054
|
|
POST
|
Hi @ChrisCyphers,
Below is an example on how you could do this:
import arcpy
# Variable
table = r'c:\TEMP\PYTHON\Test.gdb\addresses'
# Get Max Val
print("Get Max Val")
vals = [row[0].split("WMN0")[-1] for row in arcpy.da.SearchCursor(table, ["WAMID"], "WAMID IS NOT NULL")]
maxVal = int(max(vals))
# Update field
print("Update field")
with arcpy.da.UpdateCursor(table, ["WAMID"], "WAMID IS NULL") as cursor:
for row in cursor:
newVal = maxVal + 1
row[0] = "WMN0" + str(newVal)
cursor.updateRow(row)
maxVal = newVal
del cursor
print("Finished")
... View more
10-03-2024
06:09 AM
|
3
|
1
|
1490
|
|
POST
|
Hi @ColeNelson,
I recently having the same issue using arcpy.na, however, you can do this using arcpy.nax. Here is a great sample that shows how to export polygons from a service area:
https://pro.arcgis.com/en/pro-app/latest/arcpy/network-analyst/servicearea.htm#C_GUID-A2ABB768-1B6A-45D3-A1EA-F2A32BFCB921
# Export the results to a feature class
if result.solveSucceeded:
result.export(arcpy.nax.ServiceAreaOutputDataType.Polygons, output_polygons)
... View more
10-02-2024
05:55 AM
|
0
|
0
|
1149
|
|
DOC
|
@Iron_Mark
You can post your script, or I would recommend trying the one in this document to see if you get the same error.
... View more
09-26-2024
06:05 AM
|
0
|
0
|
18267
|
|
POST
|
@AndrewReynoldsDevon I would add a print statement to see which feature class it's failing on:
# Loop through each dataset and rename it
for dataset in datasets:
print(f"Renaming {dataset}")
new_name = f"{dataset}_OLD"
arcpy.management.Rename(dataset, new_name)
... View more
09-26-2024
06:00 AM
|
1
|
0
|
879
|
|
DOC
|
@Iron_Mark were you using the script in this document? filegdb is definitely supported.
... View more
09-26-2024
05:45 AM
|
0
|
0
|
14520
|
|
POST
|
Hi @AD_NLD I believe you want to keep you workspace parameter as an optional Input. If the geodatabase exists, you can select it, if it does not exist the code can create it based on the path entered by the user. Which leads to a question, do you want the user to specify the entire path to the geodatabase if it does not exist? i.e. C:\temp\data\parcels.gdb
... View more
09-25-2024
12:56 PM
|
0
|
1
|
3641
|
|
POST
|
@MK13 have you considered using the Near Me widget. I think this will give you the functionality you're looking for.
https://doc.arcgis.com/en/experience-builder/latest/configure-widgets/near-me-widget.htm
... View more
09-24-2024
08:29 AM
|
0
|
1
|
2383
|
|
POST
|
@Map12 does the following work:
from arcgis.gis import server
# Stand-alone ArcGIS Server instance specify PSA account
# Federated ArcGIS Server instance specify Portal Admin account
agsServer = server.Server(url="https://ags.esri.com/server", username='siteadmin', password='siteadmin')
print(agsServer.content.folders)
... View more
09-24-2024
07:31 AM
|
0
|
1
|
3968
|
|
POST
|
@MK13 this article may be of some help:
https://support.esri.com/en-us/knowledge-base/how-to-display-attributes-of-intersecting-features-in-a-000028227
... View more
09-24-2024
07:17 AM
|
1
|
1
|
2393
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-08-2026 12:27 PM | |
| 4 | 05-07-2020 05:14 PM | |
| 1 | 03-25-2026 04:16 AM | |
| 1 | 03-16-2026 01:00 PM | |
| 1 | 12-22-2025 10:39 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|