<?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 fishnet in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/help-with-fishnet/m-p/546286#M18127</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am new on arcgis. Here is short description what i am doing. I am trying to get data from night lights that is taken from satellites.&lt;/P&gt;&lt;P&gt;I am trying to get city level data for turkey. I can get it by selecting each city by one by one.&lt;/P&gt;&lt;P&gt;Here is the steps i am doing. Select-clip-create fishnet-convert from raster to polygon-clip(again) and get zonal statistic as table. I can do these city by city.&lt;/P&gt;&lt;P&gt;However i want to do it by using python. I can do it by using model builder. I can export the python script.&lt;/P&gt;&lt;P&gt;But when i want to change the values for another city, this time create fish net step in python is not getting XY coordinate values automatically.&lt;/P&gt;&lt;P&gt;Because when i do it one by one, it gets values automatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the command that i created and run from model builder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# ---------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;# deneme.py&lt;/P&gt;&lt;P&gt;# Created on: 2014-10-05 12:47:05.00000&lt;/P&gt;&lt;P&gt;#&amp;nbsp;&amp;nbsp; (generated by ArcGIS/ModelBuilder)&lt;/P&gt;&lt;P&gt;# Description: &lt;/P&gt;&lt;P&gt;# ---------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Import arcpy module&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Check out any necessary licenses&lt;/P&gt;&lt;P&gt;arcpy.CheckOutExtension("spatial")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Local variables:&lt;/P&gt;&lt;P&gt;Turkiye = "Turkiye\\Turkiye"&lt;/P&gt;&lt;P&gt;turkiye_lights2012 = "turkiye_lights2012"&lt;/P&gt;&lt;P&gt;turkiye_lights2012_Clip21__2_ = "turkiye_lights2012_Clip21"&lt;/P&gt;&lt;P&gt;turkiye_lights2012_Clip21 = "C:\\Users\\Bilalce\\Documents\\ArcGIS\\Default.gdb\\turkiye_lights2012_Clip21"&lt;/P&gt;&lt;P&gt;Turkiye__2_ = "Turkiye\\Turkiye"&lt;/P&gt;&lt;P&gt;Tur_81_2012 = "C:\\Users\\Bilalce\\Documents\\ArcGIS\\Default.gdb\\Tur_81_2012"&lt;/P&gt;&lt;P&gt;RasterT_turkiy19 = "C:\\Users\\Bilalce\\Documents\\ArcGIS\\Default.gdb\\RasterT_turkiy19"&lt;/P&gt;&lt;P&gt;Tur_81_2012_Clip = "C:\\Users\\Bilalce\\Documents\\ArcGIS\\Default.gdb\\Tur_81_2012_Clip"&lt;/P&gt;&lt;P&gt;ZonalSt_Tur_81_1 = "C:\\Users\\Bilalce\\Documents\\ArcGIS\\Default.gdb\\ZonalSt_Tur_81_1"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Process: Create Fishnet&lt;/P&gt;&lt;P&gt;arcpy.CreateFishnet_management(Tur_81_2012, "30.82083249005 40.61250013755", "30.82083249005 50.61250013755", "0.1", "0.1", "0", "0", "31.77083248625 41.12083346885", "NO_LABELS", "turkiye_lights2012_Clip21", "POLYGON")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Process: Raster to Polygon&lt;/P&gt;&lt;P&gt;arcpy.RasterToPolygon_conversion(turkiye_lights2012_Clip21__2_, RasterT_turkiy19, "NO_SIMPLIFY", "Value")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Process: Clip (2)&lt;/P&gt;&lt;P&gt;arcpy.Clip_analysis(Tur_81_2012, RasterT_turkiy19, Tur_81_2012_Clip, "")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Process: Select Layer By Attribute&lt;/P&gt;&lt;P&gt;arcpy.SelectLayerByAttribute_management(Turkiye, "NEW_SELECTION", "\"IL\" = '81'")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Process: Clip&lt;/P&gt;&lt;P&gt;arcpy.Clip_management(turkiye_lights2012, "25.6673999987543 35.8112000003457 44.8215000005126 42.1055999984562", turkiye_lights2012_Clip21, Turkiye__2_, "255", "ClippingGeometry", "NO_MAINTAIN_EXTENT")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Process: Zonal Statistics as Table&lt;/P&gt;&lt;P&gt;arcpy.gp.ZonalStatisticsAsTable_sa(Tur_81_2012, "OID", turkiye_lights2012_Clip21, ZonalSt_Tur_81_1, "DATA", "MEAN")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can see what i mean on the left side. When i do one by one, in the create fish net step, it is getting coordinates automatically after i chose input layer. However when i try to do it, i dont know which values to put. And it is giving me an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="fishnetnew.jpg" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/17689_fishnetnew.jpg" style="width: 620px; height: 209px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 05 Oct 2014 17:03:08 GMT</pubDate>
    <dc:creator>bilalcelik1</dc:creator>
    <dc:date>2014-10-05T17:03:08Z</dc:date>
    <item>
      <title>help with fishnet</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/help-with-fishnet/m-p/546286#M18127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am new on arcgis. Here is short description what i am doing. I am trying to get data from night lights that is taken from satellites.&lt;/P&gt;&lt;P&gt;I am trying to get city level data for turkey. I can get it by selecting each city by one by one.&lt;/P&gt;&lt;P&gt;Here is the steps i am doing. Select-clip-create fishnet-convert from raster to polygon-clip(again) and get zonal statistic as table. I can do these city by city.&lt;/P&gt;&lt;P&gt;However i want to do it by using python. I can do it by using model builder. I can export the python script.&lt;/P&gt;&lt;P&gt;But when i want to change the values for another city, this time create fish net step in python is not getting XY coordinate values automatically.&lt;/P&gt;&lt;P&gt;Because when i do it one by one, it gets values automatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the command that i created and run from model builder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# ---------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;# deneme.py&lt;/P&gt;&lt;P&gt;# Created on: 2014-10-05 12:47:05.00000&lt;/P&gt;&lt;P&gt;#&amp;nbsp;&amp;nbsp; (generated by ArcGIS/ModelBuilder)&lt;/P&gt;&lt;P&gt;# Description: &lt;/P&gt;&lt;P&gt;# ---------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Import arcpy module&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Check out any necessary licenses&lt;/P&gt;&lt;P&gt;arcpy.CheckOutExtension("spatial")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Local variables:&lt;/P&gt;&lt;P&gt;Turkiye = "Turkiye\\Turkiye"&lt;/P&gt;&lt;P&gt;turkiye_lights2012 = "turkiye_lights2012"&lt;/P&gt;&lt;P&gt;turkiye_lights2012_Clip21__2_ = "turkiye_lights2012_Clip21"&lt;/P&gt;&lt;P&gt;turkiye_lights2012_Clip21 = "C:\\Users\\Bilalce\\Documents\\ArcGIS\\Default.gdb\\turkiye_lights2012_Clip21"&lt;/P&gt;&lt;P&gt;Turkiye__2_ = "Turkiye\\Turkiye"&lt;/P&gt;&lt;P&gt;Tur_81_2012 = "C:\\Users\\Bilalce\\Documents\\ArcGIS\\Default.gdb\\Tur_81_2012"&lt;/P&gt;&lt;P&gt;RasterT_turkiy19 = "C:\\Users\\Bilalce\\Documents\\ArcGIS\\Default.gdb\\RasterT_turkiy19"&lt;/P&gt;&lt;P&gt;Tur_81_2012_Clip = "C:\\Users\\Bilalce\\Documents\\ArcGIS\\Default.gdb\\Tur_81_2012_Clip"&lt;/P&gt;&lt;P&gt;ZonalSt_Tur_81_1 = "C:\\Users\\Bilalce\\Documents\\ArcGIS\\Default.gdb\\ZonalSt_Tur_81_1"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Process: Create Fishnet&lt;/P&gt;&lt;P&gt;arcpy.CreateFishnet_management(Tur_81_2012, "30.82083249005 40.61250013755", "30.82083249005 50.61250013755", "0.1", "0.1", "0", "0", "31.77083248625 41.12083346885", "NO_LABELS", "turkiye_lights2012_Clip21", "POLYGON")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Process: Raster to Polygon&lt;/P&gt;&lt;P&gt;arcpy.RasterToPolygon_conversion(turkiye_lights2012_Clip21__2_, RasterT_turkiy19, "NO_SIMPLIFY", "Value")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Process: Clip (2)&lt;/P&gt;&lt;P&gt;arcpy.Clip_analysis(Tur_81_2012, RasterT_turkiy19, Tur_81_2012_Clip, "")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Process: Select Layer By Attribute&lt;/P&gt;&lt;P&gt;arcpy.SelectLayerByAttribute_management(Turkiye, "NEW_SELECTION", "\"IL\" = '81'")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Process: Clip&lt;/P&gt;&lt;P&gt;arcpy.Clip_management(turkiye_lights2012, "25.6673999987543 35.8112000003457 44.8215000005126 42.1055999984562", turkiye_lights2012_Clip21, Turkiye__2_, "255", "ClippingGeometry", "NO_MAINTAIN_EXTENT")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Process: Zonal Statistics as Table&lt;/P&gt;&lt;P&gt;arcpy.gp.ZonalStatisticsAsTable_sa(Tur_81_2012, "OID", turkiye_lights2012_Clip21, ZonalSt_Tur_81_1, "DATA", "MEAN")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can see what i mean on the left side. When i do one by one, in the create fish net step, it is getting coordinates automatically after i chose input layer. However when i try to do it, i dont know which values to put. And it is giving me an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="fishnetnew.jpg" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/17689_fishnetnew.jpg" style="width: 620px; height: 209px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Oct 2014 17:03:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/help-with-fishnet/m-p/546286#M18127</guid>
      <dc:creator>bilalcelik1</dc:creator>
      <dc:date>2014-10-05T17:03:08Z</dc:date>
    </item>
  </channel>
</rss>

