|
DOC
|
@StuartMoore yes, there is an Environment Variable set to True in this script to preserver GlobalIDs:
... View more
10-23-2024
05:43 AM
|
0
|
0
|
17396
|
|
DOC
|
@Jay_Gregory the best way to find out would be to publish a sample service and test your script. I incorporated the upsert option so the feature service is not truncated. This is helpful if the Append operation fails, you are not left with an empty feature service.
... View more
10-22-2024
12:39 PM
|
0
|
0
|
17416
|
|
POST
|
Hi @Jay_Gregory, I've recommended the following script to several users who have had success. Just today I updated it to include upsert functionality.
... View more
10-17-2024
11:17 AM
|
1
|
1
|
2011
|
|
POST
|
Hi @RobinRutten_ams, which AGOL Assistant are you using? I recommend the new one as it allows you to view the Item Resources:
I wrote some migration tools that copy a Story Map from Org to another that may be helpful. You can take a look at the Copy Story Maps.py script to see how to update the Item Resources, and also how to publish the Story Map.
... View more
10-16-2024
06:44 AM
|
1
|
0
|
1268
|
|
POST
|
Hi @AFackler_NAPSG,
Try the following:
from arcgis.gis import GIS
# Variables
agolAdmin = 'jskinner_rats'
agolPassword = '*******'
agolUser = 'fielduser'
# Connect to AGOL
print('Connecting to AGOL')
gis = GIS('https://www.arcgis.com', agolAdmin, agolPassword)
print("Assign Locating Sharing license")
user_license = gis.admin.license.get('ArcGIS Location Sharing')
ent = 'locsharing'
user_license.assign(username=agolUser, entitlements=ent)
... View more
10-14-2024
05:54 AM
|
1
|
1
|
1184
|
|
POST
|
Hi @cweirpatrickco, do you have any AGOL imagery basemaps (i.e. World Topographic Map, World Hillshade) added to the Pro map you are trying to package? If so, these will need to be removed to run the tool successfully.
... View more
10-14-2024
03:57 AM
|
0
|
1
|
1381
|
|
DOC
|
@neomapper can you share the AGOL service to a Group and invite my AGOL account (jskinner_rats)? I can take a look.
... View more
10-07-2024
06:37 AM
|
0
|
0
|
17526
|
|
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
|
22224
|
|
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
|
1484
|
|
POST
|
@AprilWheeler ,
Make sure you are using the following URL when adding the ArcGIS Server connection:
... View more
10-07-2024
06:04 AM
|
1
|
0
|
1754
|
|
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
|
22288
|
|
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
|
1680
|
|
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:
After script:
... View more
10-03-2024
06:23 AM
|
4
|
0
|
1027
|
|
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
|
1426
|
|
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
|
1107
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | Wednesday | |
| 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 |
Thursday
|