Greetings,
I am using the ArcGIS API for Python and I am struggling with passing parameters to the gis.content.search function.
- If I type in command parameters and run the snippet temp_list = gis.content.search(query="Boundaries AND owner:MontanaStateLibrary) a list of content is returned.
- However if I build a string, st = 'query=' + '"' + 'Boundaries AND owner:MontanaStateLibrary' + '"', and do something like this: temp_list = gis.content.search(st) an empty list is returned.
- In troubleshooting I have copied the printed string, st, from the interactive window and pasted the text into the gis.content.search() command which results in a list of content.
- As of right now the following code is just a brain dump. I am using 2 lists to build the parameter string.
try:
query_list = ['Boundaries', 'ConservationEasements', 'Geographic Names', 'Hydrography', 'LandCover', 'Mapping Control', 'MontanaMask', 'Montana Managed Areas', 'Montana NAIP', 'NAIP', 'Parcel', 'PLSSS', 'PublicLands', 'Roads', 'Structures', 'Watershed', 'Wetlands']
item_type_list = list()
st = 'item_type =' + '"' + 'Feature Layer' + '"'
item_type_list.append(st)
st = 'item_type =' + '"' + 'Imagery Layer'# + '"'
item_type_list.append(st)
st = 'item_type =' + '"' + 'Map Image Layer'# + '"'
item_type_list.append(st)
for q in query_list:
st = 'query=' + '"' + q + ' AND owner:MontanaStateLibrary' + '"' #+ ', '
temp_list = gis.content.search(st)
Am I missing something obvious?
arcgis-api-python