<?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 Re: Raster Functions, update specific rasters. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/raster-functions-update-specific-rasters-loop/m-p/442960#M34668</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Any help is appreciated. Might there be a better/easier way to create/update �??Raster Functions�?� on specific raster images? I haven�??t found any real examples doing this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Apr 2013 18:27:37 GMT</pubDate>
    <dc:creator>TonyGegner</dc:creator>
    <dc:date>2013-04-24T18:27:37Z</dc:date>
    <item>
      <title>Raster Functions, update specific rasters. (Loop)</title>
      <link>https://community.esri.com/t5/python-questions/raster-functions-update-specific-rasters-loop/m-p/442959#M34667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey all!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying a script that updates Raster Functions on specific rasters in the mosaic dataset. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is that this code doesn't work when its in a loop.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need the loop to make different querys depending on the raster that needs to be updated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The first loop works great. OBJECTID=1 gets updated with correct settings.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Executing: EditRasterFunction Templayer EDIT_MOSAIC_DATASET_ITEM REPLACE W:\XMLTEMPLATE\4250_50_ii12.xml # Start Time: Wed Apr 24 17:08:09 2013 Working on AMD_image_CAT\Raster.OBJECTID = 1 Succeeded at Wed Apr 24 17:08:11 2013 (Elapsed Time: 2,00 seconds)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On the second loop (OBJECTID=2) it crashes on arcpy.MakeMosaicLayer_management().&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;ERROR 000622: Failed to execute (Make Mosaic Layer). Parameters are not valid. ERROR 000628: Cannot set input into parameter in_mosaic_dataset.&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do i need to clear the Templayer somehow? Or what im i doing wrong?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# variables for test.. TEMPLATE = "URLToTemplate.xml" env.workspace = "C:\awsomeimages.gdb" MOSAIC_DATASET = "image"&amp;nbsp; try:&amp;nbsp; QUERY = "OBJECTID="+str(OBJECTID)&amp;nbsp; TEMPLAYER = "Templayer"&amp;nbsp; arcpy.MakeMosaicLayer_management( MOSAIC_DATASET,TEMPLAYER,QUERY )&amp;nbsp; arcpy.EditRasterFunction_management( TEMPLAYER,"EDIT_MOSAIC_DATASET_ITEM","REPLACE",TEMPLATE ) except:&amp;nbsp; print arcpy.GetMessages()&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 14:23:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-functions-update-specific-rasters-loop/m-p/442959#M34667</guid>
      <dc:creator>TonyGegner</dc:creator>
      <dc:date>2013-04-24T14:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Functions, update specific rasters.</title>
      <link>https://community.esri.com/t5/python-questions/raster-functions-update-specific-rasters-loop/m-p/442960#M34668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Any help is appreciated. Might there be a better/easier way to create/update �??Raster Functions�?� on specific raster images? I haven�??t found any real examples doing this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 18:27:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-functions-update-specific-rasters-loop/m-p/442960#M34668</guid>
      <dc:creator>TonyGegner</dc:creator>
      <dc:date>2013-04-24T18:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Functions, update specific rasters. (Loop)</title>
      <link>https://community.esri.com/t5/python-questions/raster-functions-update-specific-rasters-loop/m-p/442961#M34669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I managed to solve it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since i create a TEMPLAYER MakeMosaicLayer_management() to work with.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to specify this TEMPLAYER on the next loop as MOSAIC_DATASET.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also every other function in my script need to work with the new TEMPLAYER variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Otherwise it crashes.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2013 11:03:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-functions-update-specific-rasters-loop/m-p/442961#M34669</guid>
      <dc:creator>TonyGegner</dc:creator>
      <dc:date>2013-04-25T11:03:10Z</dc:date>
    </item>
  </channel>
</rss>

