<?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 Help with creating geostat layer in python in ArcGIS GeoStatistical Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-geostatistical-analyst-questions/help-with-creating-geostat-layer-in-python/m-p/80248#M202</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:21:09 GMT</pubDate>
    <dc:creator>BenSciance</dc:creator>
    <dc:date>2014-04-24T15:21:09Z</dc:date>
    <item>
      <title>Help with creating geostat layer in python</title>
      <link>https://community.esri.com/t5/arcgis-geostatistical-analyst-questions/help-with-creating-geostat-layer-in-python/m-p/80248#M202</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:21:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geostatistical-analyst-questions/help-with-creating-geostat-layer-in-python/m-p/80248#M202</guid>
      <dc:creator>BenSciance</dc:creator>
      <dc:date>2014-04-24T15:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help with creating geostat layer in python</title>
      <link>https://community.esri.com/t5/arcgis-geostatistical-analyst-questions/help-with-creating-geostat-layer-in-python/m-p/80249#M203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ben&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The geostatistical layer that you create is an in memory layer. Therefore&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outlyr=lyrpath+"/"+fc+"_GA.lyr" should not have a path and an extension. Just a name, viz., 'mylyr'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could, for debugging, persist this in memory layer using arcpy.SaveToLayerFile_management('mylyr', r'c:\temp\galyr.lyr')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and then drag this .lyr into ArcMap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 16:22:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geostatistical-analyst-questions/help-with-creating-geostat-layer-in-python/m-p/80249#M203</guid>
      <dc:creator>SteveLynch</dc:creator>
      <dc:date>2014-04-24T16:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Help with creating geostat layer in python</title>
      <link>https://community.esri.com/t5/arcgis-geostatistical-analyst-questions/help-with-creating-geostat-layer-in-python/m-p/80250#M204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Interesting....Thanks for the info.&amp;nbsp; Must have missed that when I was reading up on all things geostatistical analyst.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll give it a go.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 16:36:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geostatistical-analyst-questions/help-with-creating-geostat-layer-in-python/m-p/80250#M204</guid>
      <dc:creator>BenSciance</dc:creator>
      <dc:date>2014-04-24T16:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: Help with creating geostat layer in python</title>
      <link>https://community.esri.com/t5/arcgis-geostatistical-analyst-questions/help-with-creating-geostat-layer-in-python/m-p/80251#M205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ben&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Some additional comments regarding your script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- EBK is a geoprocessing tool and therefore you don't need to 'create' it via the CreateGeostatisticalLayer tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- if you are creating raster output you can use the environmental MASK which will speed up execution a lot&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- it appears that your data are in GCS (geographic coordinate system), not a good idea, rather project the data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2014 13:45:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geostatistical-analyst-questions/help-with-creating-geostat-layer-in-python/m-p/80251#M205</guid>
      <dc:creator>SteveLynch</dc:creator>
      <dc:date>2014-04-25T13:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: Help with creating geostat layer in python</title>
      <link>https://community.esri.com/t5/arcgis-geostatistical-analyst-questions/help-with-creating-geostat-layer-in-python/m-p/80252#M206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the info Steve.&amp;nbsp; I'll definitely keep this is mind.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ben&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2014 21:45:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geostatistical-analyst-questions/help-with-creating-geostat-layer-in-python/m-p/80252#M206</guid>
      <dc:creator>BenSciance</dc:creator>
      <dc:date>2014-05-26T21:45:30Z</dc:date>
    </item>
  </channel>
</rss>

