Select to view content in your preferred language

add a Thumbnail to a wms item

744
1
02-02-2021 08:17 AM
Sabina
by
Occasional Contributor

 I want create  thumbnails for  WMS items in ArcGIS online using python. 

I use "layer.create_thumbnail".  If I try on a feature layer the result is right, but on  wms items the thumbnail isn't made, and I don't catch any error.
You can see the code.

Some Help?

Thanks

gis = arcgis.GIS(url='https://www.arcgis.com', username='xxxxxxx', password='xxxxx', verify_cert=False)
test_layer = gis.content.search( item_type='Feature Layer', outside_org=False, query ='owner: sbruschi@esriitalia.it AND title : scuole')
print (test_layer)
for layer in test_layer:
pippo = layer.create_thumbnail(update=True)
print (pippo)

test_layer = gis.content.search( item_type='WMS', outside_org=False, query ='owner: sbruschi@esriitalia.it AND title : Argentina_26 - Service Station')
print (test_layer)
for layer in test_layer:
pippo = layer.create_thumbnail(update=True)
print (pippo)

 

Tags (2)
1 Reply
nita14
by
Frequent Contributor

Dear Sabina,

According to the docs. The method works only for feature services:

"Creates a Thumbnail for a feature service portal item "

https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html?highlight=create_thumbnail#ar...

BR,

Adam