<?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: Create a new layer of mosaic dataset with definition query in ArcMap.  in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/create-a-new-layer-of-mosaic-dataset-with/m-p/389852#M30818</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Benas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried multiple syntax but no avail. I've been able to apply definition queries to feature classes using your code, but not a MD.&amp;nbsp;&lt;/P&gt;&lt;P&gt;wrt the raster catalog footprints, it seems this is correct for a mosaic dataset (I think the MD is a repackaged raster catalog rolled in glitter)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look forward to someone solving this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Mar 2020 17:57:45 GMT</pubDate>
    <dc:creator>DavidPike</dc:creator>
    <dc:date>2020-03-31T17:57:45Z</dc:date>
    <item>
      <title>Create a new layer of mosaic dataset with definition query in ArcMap.</title>
      <link>https://community.esri.com/t5/python-questions/create-a-new-layer-of-mosaic-dataset-with/m-p/389847#M30813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello GISesrs,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you are keeping safe in current events.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im trying to Save new mosaic dataset with new definition query. But it seems that the script below saves new mosaic dataset, but without a query. Any advise would be appreciated.&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;arcpy
mxd = arcpy.mapping.MapDocument(\Historic_Maps.mxd&lt;SPAN style="color: #a5c261;"&gt;")
&lt;/SPAN&gt;df = arcpy.mapping.ListDataFrames(mxd&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"Layers"&lt;/SPAN&gt;)[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;]
field = &lt;SPAN style="color: #a5c261;"&gt;'Date'
&lt;/SPAN&gt;values = &lt;SPAN style="color: #a5c261;"&gt;"'1950'"
&lt;/SPAN&gt;query=&lt;SPAN style="color: #8888c6;"&gt;str&lt;/SPAN&gt;(field) +&lt;SPAN style="color: #a5c261;"&gt;" "&lt;/SPAN&gt;+ &lt;SPAN style="color: #a5c261;"&gt;"=" &lt;/SPAN&gt;+ &lt;SPAN style="color: #8888c6;"&gt;str&lt;/SPAN&gt;(values)

&lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;lyr &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;arcpy.mapping.ListLayers(mxd&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"*"&lt;/SPAN&gt;):
     &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;lyr.name == &lt;SPAN style="color: #a5c261;"&gt;"Sacle_1250"&lt;/SPAN&gt;:
        lyr.definitionQuery = query
        arcpy.mapping.AddLayer(df&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;lyr&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"BOTTOM"&lt;/SPAN&gt;)

arcpy.RefreshActiveView()
arcpy.RefreshTOC()
mxd.saveACopy (\my_mxd3.mxd&lt;SPAN style="color: #a5c261;"&gt;")
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;mxd

&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:52:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-new-layer-of-mosaic-dataset-with/m-p/389847#M30813</guid>
      <dc:creator>BenasPekarskis1</dc:creator>
      <dc:date>2021-12-11T17:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new layer of mosaic dataset with definition query in ArcMap.</title>
      <link>https://community.esri.com/t5/python-questions/create-a-new-layer-of-mosaic-dataset-with/m-p/389848#M30814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;field &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Date"&lt;/SPAN&gt;
values &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"1950"&lt;/SPAN&gt;
query &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'"'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; field &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" = "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; values &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'"'&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is it Sacle_1250 or Scale_1250 maybe?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:52:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-new-layer-of-mosaic-dataset-with/m-p/389848#M30814</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-12-11T17:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new layer of mosaic dataset with definition query in ArcMap.</title>
      <link>https://community.esri.com/t5/python-questions/create-a-new-layer-of-mosaic-dataset-with/m-p/389849#M30815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks David.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The typo happened while copying the code into Geonet.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried your suggested query. unfortunately it doesnt do the trick.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mosaic datsets have three component: Boundary, Footprint and Image.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Definition queries are set in Footprint.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The naming of footprint is a mystery for me as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/486976_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;For instance I have some possible options in&amp;nbsp;&lt;/P&gt;&lt;PRE style="color: #a9b7c6; background-color: #2b2b2b; border-width: 0px 0px 0px 2px; border-style: initial initial initial solid; border-color: initial initial initial #cccccc; font-size: 9.8pt; margin: 10px 0px; padding: 0px 0px 0px 20px;"&gt;&lt;SPAN style="color: #cc7832; border: 0px; font-weight: inherit; font-size: 13.0667px;"&gt;if &lt;/SPAN&gt;lyr.name == &lt;SPAN style="color: #a5c261; border: 0px; font-weight: inherit; font-size: 13.0667px;"&gt;"Sacle_1250"&lt;/SPAN&gt;:&lt;/PRE&gt;&lt;P&gt;I have tried &lt;STRONG&gt;Scale_1250\Footprint&lt;/STRONG&gt;, I have tried &lt;STRONG&gt;Scale_1250\AMD_Scale_1250_CAT&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nothing seems to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 14:50:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-new-layer-of-mosaic-dataset-with/m-p/389849#M30815</guid>
      <dc:creator>BenasPekarskis1</dc:creator>
      <dc:date>2020-03-31T14:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new layer of mosaic dataset with definition query in ArcMap.</title>
      <link>https://community.esri.com/t5/python-questions/create-a-new-layer-of-mosaic-dataset-with/m-p/389850#M30816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll try it on a dummy mosaic and get the syntax right for you.&lt;/P&gt;&lt;P&gt;The data type on your screenshot is FGdb Raster Catalog not Mosaic Dataset?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 14:57:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-new-layer-of-mosaic-dataset-with/m-p/389850#M30816</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2020-03-31T14:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new layer of mosaic dataset with definition query in ArcMap.</title>
      <link>https://community.esri.com/t5/python-questions/create-a-new-layer-of-mosaic-dataset-with/m-p/389851#M30817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what confusing me.&amp;nbsp; &amp;nbsp;When I view properties it is Mosaic dataset. I also created a new from scratch as a mosaic dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/486978_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;But when I view properties of Footprint, it says its Raster catalog:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/486979_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 15:15:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-new-layer-of-mosaic-dataset-with/m-p/389851#M30817</guid>
      <dc:creator>BenasPekarskis1</dc:creator>
      <dc:date>2020-03-31T15:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new layer of mosaic dataset with definition query in ArcMap.</title>
      <link>https://community.esri.com/t5/python-questions/create-a-new-layer-of-mosaic-dataset-with/m-p/389852#M30818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Benas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried multiple syntax but no avail. I've been able to apply definition queries to feature classes using your code, but not a MD.&amp;nbsp;&lt;/P&gt;&lt;P&gt;wrt the raster catalog footprints, it seems this is correct for a mosaic dataset (I think the MD is a repackaged raster catalog rolled in glitter)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look forward to someone solving this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 17:57:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-new-layer-of-mosaic-dataset-with/m-p/389852#M30818</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2020-03-31T17:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new layer of mosaic dataset with definition query in ArcMap.</title>
      <link>https://community.esri.com/t5/python-questions/create-a-new-layer-of-mosaic-dataset-with/m-p/389853#M30819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks David,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it might be related to this bug-&amp;nbsp;&lt;A class="link-titled" href="https://support.esri.com/en/bugs/nimbus/TklNMDY3MTcz" title="https://support.esri.com/en/bugs/nimbus/TklNMDY3MTcz"&gt;NIM067173: A definition query applied to a Mosaic Dataset is no..&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 18:02:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-new-layer-of-mosaic-dataset-with/m-p/389853#M30819</guid>
      <dc:creator>BenasPekarskis1</dc:creator>
      <dc:date>2020-03-31T18:02:40Z</dc:date>
    </item>
  </channel>
</rss>

