<?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 Kriging using ArcPy for a bunch of ponit shapefiles in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/kriging-using-arcpy-for-a-bunch-of-ponit/m-p/1178170#M64656</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to perform spatial interpolation for a few set of points. I have 17 shapefiles and I need to do kriging for each of them. I tried to do it using the following code. The code is working and it saves the raster files but it looks like it has a problem because when I try to open the output using Arcmap, it gives me an error. I also have used numpy to read the raster output and it was just one number. Would you please help me with that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;from arcpy import env&lt;BR /&gt;from arcpy.sa import *&lt;BR /&gt;import os&lt;/P&gt;&lt;P&gt;# Specify your environment&lt;BR /&gt;arcpy.env.workspace = r"C:\Users\...."&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;filess = 'C:/Users/Desktop/python code/points'&lt;/P&gt;&lt;P&gt;point_file_list = [ ]&lt;BR /&gt;for file in os.listdir(filess):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if ".shp" in file:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; point_file_list.append(file)&lt;/P&gt;&lt;P&gt;path_list = [ ]&lt;BR /&gt;for points in point_file_list:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; inFeatures = os.path.join(filess,points)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; field = 'dro'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; cellSize = 12500&lt;BR /&gt;&amp;nbsp; &amp;nbsp; outRaster = os.path.join("C:/Users/Desktop/python code/rasters")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; lagSize = 2000&lt;BR /&gt;&amp;nbsp; &amp;nbsp; majorRange = 2.6&lt;BR /&gt;&amp;nbsp; &amp;nbsp; partialSill = 542&lt;BR /&gt;&amp;nbsp; &amp;nbsp; nugget = 0&lt;BR /&gt;&amp;nbsp; &amp;nbsp; kModelOrdinary = KrigingModelOrdinary("CIRCULAR", lagSize, majorRange, partialSill, nugget)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; kRadius = RadiusFixed(20000, 1)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; outKriging = Kriging(inFeatures, field, kModelOrdinary, cellSize, kRadius)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; path_list.append(outRaster)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; tifname = points[-10:]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; kriging_OUT= os.path.join(outRaster, 'r{0}.tif'.format(tifname))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; outKriging.save(kriging_OUT)&lt;/P&gt;</description>
    <pubDate>Sat, 28 May 2022 14:59:42 GMT</pubDate>
    <dc:creator>Ehsanfrmd</dc:creator>
    <dc:date>2022-05-28T14:59:42Z</dc:date>
    <item>
      <title>Kriging using ArcPy for a bunch of ponit shapefiles</title>
      <link>https://community.esri.com/t5/python-questions/kriging-using-arcpy-for-a-bunch-of-ponit/m-p/1178170#M64656</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to perform spatial interpolation for a few set of points. I have 17 shapefiles and I need to do kriging for each of them. I tried to do it using the following code. The code is working and it saves the raster files but it looks like it has a problem because when I try to open the output using Arcmap, it gives me an error. I also have used numpy to read the raster output and it was just one number. Would you please help me with that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;from arcpy import env&lt;BR /&gt;from arcpy.sa import *&lt;BR /&gt;import os&lt;/P&gt;&lt;P&gt;# Specify your environment&lt;BR /&gt;arcpy.env.workspace = r"C:\Users\...."&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;filess = 'C:/Users/Desktop/python code/points'&lt;/P&gt;&lt;P&gt;point_file_list = [ ]&lt;BR /&gt;for file in os.listdir(filess):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if ".shp" in file:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; point_file_list.append(file)&lt;/P&gt;&lt;P&gt;path_list = [ ]&lt;BR /&gt;for points in point_file_list:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; inFeatures = os.path.join(filess,points)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; field = 'dro'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; cellSize = 12500&lt;BR /&gt;&amp;nbsp; &amp;nbsp; outRaster = os.path.join("C:/Users/Desktop/python code/rasters")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; lagSize = 2000&lt;BR /&gt;&amp;nbsp; &amp;nbsp; majorRange = 2.6&lt;BR /&gt;&amp;nbsp; &amp;nbsp; partialSill = 542&lt;BR /&gt;&amp;nbsp; &amp;nbsp; nugget = 0&lt;BR /&gt;&amp;nbsp; &amp;nbsp; kModelOrdinary = KrigingModelOrdinary("CIRCULAR", lagSize, majorRange, partialSill, nugget)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; kRadius = RadiusFixed(20000, 1)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; outKriging = Kriging(inFeatures, field, kModelOrdinary, cellSize, kRadius)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; path_list.append(outRaster)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; tifname = points[-10:]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; kriging_OUT= os.path.join(outRaster, 'r{0}.tif'.format(tifname))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; outKriging.save(kriging_OUT)&lt;/P&gt;</description>
      <pubDate>Sat, 28 May 2022 14:59:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/kriging-using-arcpy-for-a-bunch-of-ponit/m-p/1178170#M64656</guid>
      <dc:creator>Ehsanfrmd</dc:creator>
      <dc:date>2022-05-28T14:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Kriging using ArcPy for a bunch of ponit shapefiles</title>
      <link>https://community.esri.com/t5/python-questions/kriging-using-arcpy-for-a-bunch-of-ponit/m-p/1178187#M64657</link>
      <description>&lt;P&gt;The error?&lt;/P&gt;</description>
      <pubDate>Sat, 28 May 2022 23:01:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/kriging-using-arcpy-for-a-bunch-of-ponit/m-p/1178187#M64657</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-05-28T23:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Kriging using ArcPy for a bunch of ponit shapefiles</title>
      <link>https://community.esri.com/t5/python-questions/kriging-using-arcpy-for-a-bunch-of-ponit/m-p/1178201#M64658</link>
      <description>&lt;P&gt;Here is the error.&lt;/P&gt;</description>
      <pubDate>Sun, 29 May 2022 14:26:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/kriging-using-arcpy-for-a-bunch-of-ponit/m-p/1178201#M64658</guid>
      <dc:creator>Ehsanfrmd</dc:creator>
      <dc:date>2022-05-29T14:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Kriging using ArcPy for a bunch of ponit shapefiles</title>
      <link>https://community.esri.com/t5/python-questions/kriging-using-arcpy-for-a-bunch-of-ponit/m-p/1178204#M64659</link>
      <description>&lt;P&gt;You should be using data with a projected coordinate system and all the data you are trying to krige should have the same coordinate system.&amp;nbsp; The error suggests that you have a mix of data coordinates.&amp;nbsp; Also. set the analysis extent and cell size within the script for each shapefile that you are using, or you will have no control over the output.&lt;/P&gt;</description>
      <pubDate>Sun, 29 May 2022 16:34:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/kriging-using-arcpy-for-a-bunch-of-ponit/m-p/1178204#M64659</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-05-29T16:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: Kriging using ArcPy for a bunch of ponit shapefiles</title>
      <link>https://community.esri.com/t5/python-questions/kriging-using-arcpy-for-a-bunch-of-ponit/m-p/1178205#M64660</link>
      <description>&lt;P&gt;But I am using the same latitudes and longitudes for all of my data. Also, I am importing the&amp;nbsp;&amp;nbsp;latitudes and longitudes from a csv file. They are just numbers and there is no coordinates.&lt;/P&gt;</description>
      <pubDate>Sun, 29 May 2022 16:44:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/kriging-using-arcpy-for-a-bunch-of-ponit/m-p/1178205#M64660</guid>
      <dc:creator>Ehsanfrmd</dc:creator>
      <dc:date>2022-05-29T16:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Kriging using ArcPy for a bunch of ponit shapefiles</title>
      <link>https://community.esri.com/t5/python-questions/kriging-using-arcpy-for-a-bunch-of-ponit/m-p/1178357#M64664</link>
      <description>&lt;P&gt;lat/long in decimal degrees are the coordinates.&amp;nbsp; you should be using projected data&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 17:06:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/kriging-using-arcpy-for-a-bunch-of-ponit/m-p/1178357#M64664</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-05-30T17:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Kriging using ArcPy for a bunch of ponit shapefiles</title>
      <link>https://community.esri.com/t5/python-questions/kriging-using-arcpy-for-a-bunch-of-ponit/m-p/1178624#M64670</link>
      <description>&lt;P&gt;Thank you very much&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 15:47:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/kriging-using-arcpy-for-a-bunch-of-ponit/m-p/1178624#M64670</guid>
      <dc:creator>Ehsanfrmd</dc:creator>
      <dc:date>2022-05-31T15:47:03Z</dc:date>
    </item>
  </channel>
</rss>

