POST
|
Thank you @JakeSkinner . I ended up using arcpy, looping through a list of layers in a map to complete the overwrite. import arcpy
wrkspc = 'C:\\somePath'
myMap = 'someMap'
aprx = arcpy.mp.ArcGISProject(r"someProject.aprx")
m = aprx.listMaps(myMap)[0]
for lyr in m.listLayers():
sddraft = wrkspc + lyr.name + '.sddraft'
sd = wrkspc + lyr.name + '.sd'
arcpy.mp.CreateWebLayerSDDraft(lyr, sddraft, lyr.name,
'MY_HOSTED_SERVICES', 'FEATURE_ACCESS',
overwrite_existing_service=True)
arcpy.StageService_server(sddraft, sd)
arcpy.UploadServiceDefinition_server(sd, 'My Hosted Services') This will publish/overwrite a separate feature service for every layer in a map. I like it because of its brevity and the ability to promote symbology changes and queries from the map. I'll give the truncate method a shot. It seems compelling. Thanks!
... View more
03-31-2021
08:11 AM
|
0
|
0
|
3054
|
POST
|
@JakeSkinner , I have a similar script I'm building for overwriting a feature layer. I like the suggestion you have shared, but I wonder if this could be simplified much further by using the overwrite method shown here: https://developers.arcgis.com/python/sample-notebooks/overwriting-feature-layers/ I also wonder if it's possible to use a layer from a map in ArcGIS Pro as the input for the overwrite. Any suggestions going this route would be helpful.
... View more
03-24-2021
11:44 AM
|
0
|
2
|
3101
|
POST
|
The problem was isolated to a definition query applied to the feature class in ArcGIS Pro. The definition query is valid and should not yield an empty feature service. As a workaround, I removed the definition query and adjusted the view in Portal.
... View more
07-27-2020
10:57 AM
|
0
|
0
|
559
|
POST
|
I attempted to overwrite a web layer in Portal for ArcGIS via ArcGIS Pro. The web layer I attempted to overwrite has a view. From within ArcGIS Pro, the overwrite appeared to be a success, but the result is not as expected. Workflow: Overwrite web layer (hosted feature service) Result: The hosted feature service contains no data, but the corresponding feature service view contains the updates. Considerations: 1. The feature class used to overwrite the feature service was identical with respect to a very minor symbology change, a definition query, and more features. 2. I replicated this same workflow (same scenario) with a completely different feature service and found the same result. Details: ArcGIS Pro 2.3 Portal for ArcGIS 10.7 (unconfirmed) This seems like a bug.
... View more
07-24-2020
12:29 PM
|
0
|
1
|
631
|
POST
|
This problem with the generate attachment match table tool persists at ArcGIS Pro 2.3.1. The tool behaves as if a match is positive where the first few characters are identical. For example, a set of attachments (Document_1.pdf, Document_1A.pdf, Document_1B.pdf, Document_1C.pdf), would result in 3 false positive matches for the key, Document_1. Hopefully this will be addressed, as this type of error renders the tool useless. One correction is mentioned here. Another correction would be to: 1. Add a field (MatchKey) to the resulting match table. 2. Calculate the file name of the attachment (less the extension). 3. Join the field in your feature class you originally used as your key to the MatchKey field. 4. Use the join to sort and delete the false positives (or select and export the true matches).
... View more
04-23-2020
08:01 AM
|
0
|
0
|
291
|
POST
|
It seems like a band-aid, but you could add a conditional (if x like %demolition%) to not replace the same string more than once. Or, better yet, use conditionals to test if the replace function should run on a given value (if x == 'demo').
... View more
11-27-2019
01:20 PM
|
0
|
1
|
599
|
Online Status |
Offline
|
Date Last Visited |
03-25-2024
01:23 PM
|