POST
|
Hi David, Have you figured out how to access the properties of a sublayer of a service? For instance, I'm iterating through a map that has the entire service. When my script hits this layer, it does not iterate through the sublayer of the services. It simply prints the name of the main service. Any insight would be greatly appreciated.
... View more
05-04-2022
12:29 PM
|
0
|
0
|
2427
|
POST
|
Thanks Michele. I'm considering your python option. Unfortunately copy features does not accept tables as an input.
... View more
05-27-2020
02:22 PM
|
1
|
2
|
1360
|
POST
|
Running into the same problem with the table to table tool. Any updates?
... View more
05-27-2020
02:00 PM
|
0
|
5
|
1360
|
POST
|
I am trying to obtain the name of a service while iterating through a web map. As I itterate through the web map, I run into instances where the entire service has been added. Therefore, I itterate through the the layer['layers'] to obtain the attributes for the "sub services. However, I'm running into cases where the "sub services" do not have all the properites in which I'm looking for. Therefore, am trying to access the service properties directly from the server utilizing the arcgis.gis.server module. It is quite easy to construct a URL, however, I am having trouble accessing the properties. I have yet to find a "get" function, that simply allows me to plug in the ArcGIS Rest URL; rather than having to enter all of the server information . I guess my question is, Is there a "get" function that will allow me to return all the properties of a service including name, capabilites, etc? Managing your GIS servers | ArcGIS for Developers import arcgis.gis from arcgis.mapping import WebMap from arcgis.gis.server import Server import os gis=arcgis.gis.GIS(hportal URL,"UN","PW") user = gis.users.get('UN) print ("Logged Into Portal") #Web map print ("Defyning Web Map") #webmapid = input("Enter Map ID: ") webmapid = "#####" usermapid = gis.content.get(str(webmapid)) wm = WebMap(usermapid) for layer in wm.layers: print (layer['title']) ExcelData['Title'].append(layer['title']) ExcelData['id'].append(layer['id']) if layer['layerType'] == 'ArcGISMapServiceLayer' and layer['url'].endswith("MapServer"😞 for i in range(len(layer['layers'])): arcgis.gis.server.Service(layer['url'],'Map Service') #does not work print (layer['title'] + " /// " + layer['layers']['name']) #instance where I want to return the name
... View more
03-12-2020
10:28 AM
|
0
|
0
|
450
|
POST
|
I need to delete all the Users from a particular Group on my Portal. I initially attempted a group first approach but realized that there wasn't an efficient way to access the users via the group. Therefore, I took a user approach. The logic for identifying the users group and deleting the users is working however, I have yet to find a way to iterate through all of the portal users. The search either times out or returns the errors below. I know it has something to do with the query but I have yet to find adequate search query documentation for the Python API. Search—ArcGIS REST API: Users, groups, and content | ArcGIS for Developers Search reference—ArcGIS REST API: Users, groups, and content | ArcGIS for Developers Can someone please point me in the direction of the correct user search syntax or assist with troubleshooting this issue? Thanks.
... View more
02-26-2020
08:48 AM
|
0
|
3
|
5838
|
POST
|
Thanks Antii. I added the wm.update() which essentially saved the webmap, which updated the service URLs.
... View more
01-17-2020
07:20 AM
|
0
|
0
|
3277
|
POST
|
Due to a server migration, I need to update all the service URLs to the new server. The script runs, however, I do not see the update for the layers in the web map. I took a look at this post and attempted to implement but still no update. Could someone please assist. Posted code below import arcgis.gis from arcgis.mapping import WebMap import os if __name__ == "__main__": gis =arcgis.gis.GIS(orgportalURL,UN,Passowrd) user = gis.users.get(UN) print ("Successfully Logged in as " + user['username']) webMapID = "036292a6eb7b4bdFakeWEBMAP" print ("Gaining attributes for web map: " + str(webMapID)) Webmap = gis.content.get(str(webMapID)) wm = WebMap(Webmap) loop = 0 for layer in wm.layers: upd = layer gisenturl = 'https://fakeportalname/fakeserver/rest/services/Environmental' gisviewurl = 'https://anotherfakeportalname/anotherfakeserver/rest/services/Environmental' if gisenturl in layer['url']: wm.layers[loop]['url'] = layer['url'].replace(gisenturl,gisviewurl) gis.update_properties(wm.layers[0]) print ("Service Updated for " + layer['title']) loop += 1
... View more
01-16-2020
05:20 PM
|
0
|
5
|
3742
|
Title | Kudos | Posted |
---|---|---|
1 | 05-27-2020 02:22 PM |
Online Status |
Offline
|
Date Last Visited |
09-15-2022
06:20 PM
|