<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Using ArcGIS API for Python, is there a way to determine if a Feature Service has an OIL layer? in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/using-arcgis-api-for-python-is-there-a-way-to/m-p/1661624#M66845</link>
    <description>&lt;P&gt;In my ArcGIS API for Python script I need to search for Feature Services, but need to exclude some of these from my query (or if necessary, ignore them in the results of the query) based on a few criteria.&amp;nbsp; I've been able to exclude views as:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;agol_feature_services = gis.content.search(&lt;SPAN&gt;query&lt;/SPAN&gt;=&lt;SPAN&gt;f"NOT typekeywords:View Service"&lt;/SPAN&gt;, &lt;SPAN&gt;max_items&lt;/SPAN&gt;=&lt;SPAN&gt;10000&lt;/SPAN&gt;, &lt;SPAN&gt;item_type&lt;/SPAN&gt;=&lt;SPAN&gt;"Feature Service"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;However, I also need to exclude Oriented Imagery Layers (OILs).&amp;nbsp; Is there any way to query a Feature Service item to determine if it is for an OIL?&lt;/P&gt;&lt;P&gt;If I can't include this in the query (as above), can I do it later when I loop through the query results like below?&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;for &lt;/SPAN&gt;fs_item &lt;SPAN&gt;in agol_feature_services&lt;/SPAN&gt;:&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Oct 2025 01:47:14 GMT</pubDate>
    <dc:creator>GISDataTasPorts</dc:creator>
    <dc:date>2025-10-29T01:47:14Z</dc:date>
    <item>
      <title>Using ArcGIS API for Python, is there a way to determine if a Feature Service has an OIL layer?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/using-arcgis-api-for-python-is-there-a-way-to/m-p/1661624#M66845</link>
      <description>&lt;P&gt;In my ArcGIS API for Python script I need to search for Feature Services, but need to exclude some of these from my query (or if necessary, ignore them in the results of the query) based on a few criteria.&amp;nbsp; I've been able to exclude views as:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;agol_feature_services = gis.content.search(&lt;SPAN&gt;query&lt;/SPAN&gt;=&lt;SPAN&gt;f"NOT typekeywords:View Service"&lt;/SPAN&gt;, &lt;SPAN&gt;max_items&lt;/SPAN&gt;=&lt;SPAN&gt;10000&lt;/SPAN&gt;, &lt;SPAN&gt;item_type&lt;/SPAN&gt;=&lt;SPAN&gt;"Feature Service"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;However, I also need to exclude Oriented Imagery Layers (OILs).&amp;nbsp; Is there any way to query a Feature Service item to determine if it is for an OIL?&lt;/P&gt;&lt;P&gt;If I can't include this in the query (as above), can I do it later when I loop through the query results like below?&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;for &lt;/SPAN&gt;fs_item &lt;SPAN&gt;in agol_feature_services&lt;/SPAN&gt;:&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 01:47:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/using-arcgis-api-for-python-is-there-a-way-to/m-p/1661624#M66845</guid>
      <dc:creator>GISDataTasPorts</dc:creator>
      <dc:date>2025-10-29T01:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcGIS API for Python, is there a way to determine if a Feature Service has an OIL layer?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/using-arcgis-api-for-python-is-there-a-way-to/m-p/1661775#M66849</link>
      <description>&lt;P&gt;Using a public layer as an example, you can find that the sub-layer inside a given collection (item) is typed with '&lt;SPAN&gt;Oriented Imagery Layer'. Using this you can write a function that would handle collecting only items from your search that do not have layers of this type. That would look something like:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def remove_oil(items: list) -&amp;gt; list:
    result = []

    for item in items:
        types = []
        for layer in item.layers:
            types.extend([layer.properties.type])
            
            
            print(f"{layer.properties.name} contains {types}")
            
        if 'Oriented Imagery Layer' not in types:
            result.append(item)
            
    return result
&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 29 Oct 2025 11:42:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/using-arcgis-api-for-python-is-there-a-way-to/m-p/1661775#M66849</guid>
      <dc:creator>AustinAverill</dc:creator>
      <dc:date>2025-10-29T11:42:47Z</dc:date>
    </item>
  </channel>
</rss>

