<?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 access Mosaic dataset raster via Python API in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/access-mosaic-dataset-raster-via-python-api/m-p/1284603#M8644</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to work on some raster via Python API. even if the documentation and the videos are very explicative I didn`t find anything on this subject.&lt;/P&gt;&lt;P&gt;As far as I know a Mosaic dataset is a special type of&amp;nbsp; `layer` where each attribute in the attribute table points to a specific raster stored somewhere.&amp;nbsp;&lt;/P&gt;&lt;P&gt;now let`s say that I want to do some processing on some rasters in the mosaic. for example a minus operation on two rasters stored in the mosaic.&lt;/P&gt;&lt;P&gt;how do I access a single raster into the mosaic? this is the procedure that I am using.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;try:
    gis = GIS("https://Myportal", username="usr", password="pwd")
    
except Exception as e:
     print("An exception occurred: ", e)
        
        
#accessing my mosaic dataset item
lyr1 = gis.content.get('7d562782877aec8fc3')
#accessing my mosaic layer
lyr1 = lyr1.layers[0]
#filtering my mosaic layer to isolate only one raster inside it
filtered_lyr1 = lyr1.filter_by(where="objectid = 10")
filtered_lyr2 = lyr1.filter_by(where="objectid = 9")
#applying processing functions to the layers 
processedLyr = apply(filtered_lyr1 , 'DBX_Bathy_Hillshade')
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 May 2023 07:26:52 GMT</pubDate>
    <dc:creator>federicomoroni</dc:creator>
    <dc:date>2023-05-02T07:26:52Z</dc:date>
    <item>
      <title>access Mosaic dataset raster via Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/access-mosaic-dataset-raster-via-python-api/m-p/1284603#M8644</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to work on some raster via Python API. even if the documentation and the videos are very explicative I didn`t find anything on this subject.&lt;/P&gt;&lt;P&gt;As far as I know a Mosaic dataset is a special type of&amp;nbsp; `layer` where each attribute in the attribute table points to a specific raster stored somewhere.&amp;nbsp;&lt;/P&gt;&lt;P&gt;now let`s say that I want to do some processing on some rasters in the mosaic. for example a minus operation on two rasters stored in the mosaic.&lt;/P&gt;&lt;P&gt;how do I access a single raster into the mosaic? this is the procedure that I am using.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;try:
    gis = GIS("https://Myportal", username="usr", password="pwd")
    
except Exception as e:
     print("An exception occurred: ", e)
        
        
#accessing my mosaic dataset item
lyr1 = gis.content.get('7d562782877aec8fc3')
#accessing my mosaic layer
lyr1 = lyr1.layers[0]
#filtering my mosaic layer to isolate only one raster inside it
filtered_lyr1 = lyr1.filter_by(where="objectid = 10")
filtered_lyr2 = lyr1.filter_by(where="objectid = 9")
#applying processing functions to the layers 
processedLyr = apply(filtered_lyr1 , 'DBX_Bathy_Hillshade')
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 07:26:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/access-mosaic-dataset-raster-via-python-api/m-p/1284603#M8644</guid>
      <dc:creator>federicomoroni</dc:creator>
      <dc:date>2023-05-02T07:26:52Z</dc:date>
    </item>
  </channel>
</rss>

