<?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: Help with creating geostat layer in python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/help-with-creating-geostat-layer-in-python/m-p/488120#M38118</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I believe your script doesn't work because the third parameter to &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/index.html#//003000000015000000" rel="nofollow" target="_blank"&gt;GACreateGeostatisticalLayer_ga&lt;/A&gt;&lt;SPAN&gt; is not supposed to be a layer file, but a name of a layer that will be created in Python's memory.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try changing the following rows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;#outlyr=lyrpath+"/"+fc+"_GA.lyr" outlyr = 'galayer'&amp;nbsp; #arcpy.GACreateGeostatisticalLayer_ga(modelxml,infc,outlyr) outlyr = arcpy.GACreateGeostatisticalLayer_ga(modelxml,infc,outlyr).getOutput(0)&amp;nbsp; # and add the following right above your 'except' statement # to delete the in-memory layer object before the next iteration arcpy.Delete_management(outlyr) del outlyr&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Filip.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Apr 2014 18:13:42 GMT</pubDate>
    <dc:creator>FilipKrál</dc:creator>
    <dc:date>2014-04-25T18:13:42Z</dc:date>
    <item>
      <title>Help with creating geostat layer in python</title>
      <link>https://community.esri.com/t5/python-questions/help-with-creating-geostat-layer-in-python/m-p/488119#M38117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to loop through feature classes and create a geostatistical layer and then convert the geo layer to points.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've attempted to debug this problem myself, but would appreciate extra eyes on my code in case someone else can spot an error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a resource that I've referenced trying to fix my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://forums.arcgis.com/threads/92508-Need-Help-Automation-of-Kriging-using-Model-builder-or-python-Reg" rel="nofollow" target="_blank"&gt;http://forums.arcgis.com/threads/92508-Need-Help-Automation-of-Kriging-using-Model-builder-or-python-Reg&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy from arcpy import env from arcpy.sa import* from arcpy.ga import*&amp;nbsp;&amp;nbsp; arcpy.env.workspace = "C:\Users\mbs7038\Documents\New_Landsat_Imagery\For_Area_Calc\Gauges_For_AccuracyAssessment\S_Gauges\S_Gauges.gdb" arcpy.env.overwriteOutput=True&amp;nbsp; lyrpath = "C:\Users\mbs7038\Documents\New_Landsat_Imagery\For_Area_Calc\Gauges_For_AccuracyAssessment\S_Gauges\GA_lyrs"&amp;nbsp; ptpath="C:\Users\mbs7038\Documents\New_Landsat_Imagery\For_Area_Calc\Gauges_For_AccuracyAssessment\S_Gauges\GA_Krig.gdb"&amp;nbsp;&amp;nbsp; # Check out the ArcGIS Geostatistical Analyst extension license arcpy.CheckOutExtension("GeoStats")&amp;nbsp;&amp;nbsp; #modelTemplate="C:\Users\mbs7038\Documents\New_Landsat_Imagery\For_Area_Calc\Gauges_For_AccuracyAssessment\S_Gauges\GA_Model.lyr"&amp;nbsp; modelxml=("C:\Users\mbs7038\Documents\New_Landsat_Imagery\For_Area_Calc\Gauges_For_AccuracyAssessment\S_Gauges\EmpiricalBayesianKriging.xml")&amp;nbsp;&amp;nbsp; print 'listing feature classes' fcs=arcpy.ListFeatureClasses("a734184")&amp;nbsp; for fc in fcs: &amp;nbsp;&amp;nbsp;&amp;nbsp; print fc &amp;nbsp;&amp;nbsp;&amp;nbsp; try: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'listing fields' &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fields = arcpy.ListFields(fc,"Wlevel") &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for field in fields: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print ("{0} is a type of {1} with a length of {2}".format(field.name, field.type, field.length))&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zfield="Wlevel"&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outlyr=lyrpath+"/"+fc+"_GA.lyr" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outpts=ptpath+"/"+fc+"_GA_pt" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #cellsize=0.0008333333333&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print'creating geostatistical layer' &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infc=fc + " Wlevel" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.GACreateGeostatisticalLayer_ga(modelxml,infc,outlyr)&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'converting GA layer to grid' &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.GALayerToPoints_ga(outlyr,fc,zfield,outpts)&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; except: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetMessages()&amp;nbsp; print 'script complete'&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I receive these error messages: a734184_GA.lyr does not exist or is not supported&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've checked my output folder that I've defined to store the new geostat layers, and there is nothing there, even though I received no error messages when running the CreateGeostatisticalLayer tool......&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp; listing feature classes a734184 listing fields Wlevel is a type of Double with a length of 8 creating geostatistical layer converting GA layer to grid Executing: GALayerToPoints C:\Users\mbs7038\Documents\New_Landsat_Imagery\For_Area_Calc\Gauges_For_AccuracyAssessment\S_Gauges\GA_lyrs/a734184_GA.lyr C:\Users\mbs7038\Documents\New_Landsat_Imagery\For_Area_Calc\Gauges_For_AccuracyAssessment\S_Gauges\S_Gauges.gdb\a734184 Wlevel C:\Users\mbs7038\Documents\New_Landsat_Imagery\For_Area_Calc\Gauges_For_AccuracyAssessment\S_Gauges\GA_Krig.gdb\a734184_GA_pt ALL Start Time: Thu Apr 24 12:12:05 2014 Failed to execute. Parameters are not valid. ERROR 000732: Input geostatistical layer: Dataset C:\Users\mbs7038\Documents\New_Landsat_Imagery\For_Area_Calc\Gauges_For_AccuracyAssessment\S_Gauges\GA_lyrs/a734184_GA.lyr does not exist or is not supported Failed to execute (GALayerToPoints). Failed at Thu Apr 24 12:12:05 2014 (Elapsed Time: 0.00 seconds) script complete &amp;gt;&amp;gt;&amp;gt; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 15:24:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-creating-geostat-layer-in-python/m-p/488119#M38117</guid>
      <dc:creator>BenSciance</dc:creator>
      <dc:date>2014-04-24T15:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help with creating geostat layer in python</title>
      <link>https://community.esri.com/t5/python-questions/help-with-creating-geostat-layer-in-python/m-p/488120#M38118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I believe your script doesn't work because the third parameter to &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/index.html#//003000000015000000" rel="nofollow" target="_blank"&gt;GACreateGeostatisticalLayer_ga&lt;/A&gt;&lt;SPAN&gt; is not supposed to be a layer file, but a name of a layer that will be created in Python's memory.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try changing the following rows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;#outlyr=lyrpath+"/"+fc+"_GA.lyr" outlyr = 'galayer'&amp;nbsp; #arcpy.GACreateGeostatisticalLayer_ga(modelxml,infc,outlyr) outlyr = arcpy.GACreateGeostatisticalLayer_ga(modelxml,infc,outlyr).getOutput(0)&amp;nbsp; # and add the following right above your 'except' statement # to delete the in-memory layer object before the next iteration arcpy.Delete_management(outlyr) del outlyr&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Filip.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2014 18:13:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-creating-geostat-layer-in-python/m-p/488120#M38118</guid>
      <dc:creator>FilipKrál</dc:creator>
      <dc:date>2014-04-25T18:13:42Z</dc:date>
    </item>
  </channel>
</rss>

