<?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: Arcpy clip file tiff in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34142#M2660</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi have try Dan but the result is always the same.&lt;/P&gt;&lt;P&gt;I have a result clip with bounds not smooth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Sep 2016 10:02:46 GMT</pubDate>
    <dc:creator>DEVAPP</dc:creator>
    <dc:date>2016-09-22T10:02:46Z</dc:date>
    <item>
      <title>Arcpy clip file tiff</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34134#M2652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;i have a tiff image that into Arcmap i clip with Data Frame Clip using a shp file into data frame as mask to clip and i have the result that you can see into this image&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/231914_Cattura1.PNG" style="width: 362px; height: 353px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead when i create a python script i can't use clip data frame so i use clip_managment or extract by mask with the same shp file but the result is different, you can see in this second image&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/231915_Cattura2.PNG" style="width: 470px; height: 306px;" /&gt;&lt;/P&gt;&lt;P&gt;You can see that the bouds of clip are not smooth as first clip resulted by clip data frame.&lt;/P&gt;&lt;P&gt;How i can resolve this problem and have the same result with bounds smooth?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2016 21:03:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34134#M2652</guid>
      <dc:creator>DEVAPP</dc:creator>
      <dc:date>2016-09-21T21:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy clip file tiff</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34135#M2653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in order to get the smoother edge, you have to explicitly set the cell size in the Environments tab of the tool. &amp;nbsp;If you don't, it defaults to 1/250th of the maximum of the extent with or height. &amp;nbsp;So when opening any tool in Arctoolbox, the first place you should go to is the Environments Tab and set your raster properties (there are a couple of places inside)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2016 21:08:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34135#M2653</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-09-21T21:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy clip file tiff</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34136#M2654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok but i have deelop a script to add into custom toolbox&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2016 21:22:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34136#M2654</guid>
      <dc:creator>DEVAPP</dc:creator>
      <dc:date>2016-09-21T21:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy clip file tiff</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34137#M2655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;would be nice to mention that as well, but as usual, there is an arcpy interface... see the examples in Environments section of arcpy and those that apply to raster processing.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/tools/environments/cell-size.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/environments/cell-size.htm"&gt;Cell Size (Environment setting)—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2016 21:38:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34137#M2655</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-09-21T21:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy clip file tiff</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34138#M2656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dan i have set arcpy.env.cellSIze = 0.5 and after i have run my arcoy clip but the result is the same. More bounds are not smooth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2016 22:26:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34138#M2656</guid>
      <dc:creator>DEVAPP</dc:creator>
      <dc:date>2016-09-21T22:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy clip file tiff</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34139#M2657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have a script, you should post it... it is not possible to discern an error from comments solely&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2016 22:49:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34139#M2657</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-09-21T22:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy clip file tiff</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34140#M2658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan this is my script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def main():&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Start script"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.overwriteOutput=True&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.cellSize = 0.1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; env.workspace = arcpy.GetParameterAsText(0)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date = arcpy.GetParameterAsText(1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; excludedValues = arcpy.GetParameterAsText(2)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument("Map.mxd")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; strNdvi = "ndvi.tif"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; strNdviLayer = "ndviLayer.lyr"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Temp_Symbology = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'ndviLayer.lyr')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Generate NDVI&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; strRedImage = "Image1.jp2"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; strIVImage = "Image2.jp2"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; strPolygons = "polygon.shp"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; strPolygon = "polygon"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sr = arcpy.Describe(strRedImage).spatialReference&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.spatialReference = sr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not arcpy.Exists(strNdvi) and arcpy.Exists(strRedImage) and arcpy.Exists(strIVImage):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rasNdvi = Divide(Minus(Float(strRedImage),Float(strIVImage)),Plus(Float(strRedImage),Float(strIVImage)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rasNdvi.save("ndvi.tif")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "NDVI created."&lt;/P&gt;&lt;P&gt;the ndvi created have a cell size 10 x 10 , i have used Describe to see&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and this is the rest of code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;arcpy.MakeRasterLayer_management(strNdvi, "ndvilyr")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lyrNdvi = arcpy.mapping.Layer(strNdvi)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.AddLayer(df, lyrNdvi)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lyr = arcpy.mapping.ListLayers(mxd)[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ##Clip Raster Dataset with feature geometry&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.cellSize = 0.05&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Clip_management("ndvi.tif", "#", "ndvi_clip.tif",strPolygons, "0", "ClippingGeometry")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "clip ok"&lt;/P&gt;&lt;P&gt;and the result is the second image, with bounds not smooth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 08:04:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34140#M2658</guid>
      <dc:creator>DEVAPP</dc:creator>
      <dc:date>2016-09-22T08:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy clip file tiff</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34141#M2659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/make-raster-layer.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/make-raster-layer.htm"&gt;Make Raster Layer—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;doesn't honour global settings other than workspaces... try&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/tools/conversion-toolbox/feature-to-raster.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/conversion-toolbox/feature-to-raster.htm"&gt;Feature to Raster—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp; which uses a cell size explicitly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to check what environment variables are honoured by tools as well&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 09:48:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34141#M2659</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-09-22T09:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy clip file tiff</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34142#M2660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi have try Dan but the result is always the same.&lt;/P&gt;&lt;P&gt;I have a result clip with bounds not smooth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 10:02:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34142#M2660</guid>
      <dc:creator>DEVAPP</dc:creator>
      <dc:date>2016-09-22T10:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy clip file tiff</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34143#M2661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you set the cell size in FeatureToRaster?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 11:41:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34143#M2661</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-09-22T11:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy clip file tiff</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34144#M2662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes i have set 0.5 cellsize but the result is always the same. I have try to set into env cellsize value 0.5 and run replace with this value as cell size but result is always the same&lt;/P&gt;&lt;P&gt;The bounds are not smooth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 12:11:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34144#M2662</guid>
      <dc:creator>DEVAPP</dc:creator>
      <dc:date>2016-09-22T12:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy clip file tiff</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34145#M2663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;skip the script for now... do the process manually using the tools in arctoolbox, when it works, go to Customize, Results and copy and paste the results of the process and export to a python code snippet so that we can see what was a 'successful' run to narrow down what your code situation problem is.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 16:47:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34145#M2663</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-09-22T16:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy clip file tiff</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34146#M2664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;thank for your help.&lt;/P&gt;&lt;P&gt;I have change the workflow into script and now works fine. Problem was the first clip of raster before resample.&lt;/P&gt;&lt;P&gt;I have try to clip the raster with a big polygon and after run the resample but with cell size 0,5 and. After i have execute other clip on resample result with a smal shp and the ruslt is good.&lt;/P&gt;&lt;P&gt;Now i have see other some strange but i will post it in other question&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Sep 2016 08:14:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-clip-file-tiff/m-p/34146#M2664</guid>
      <dc:creator>DEVAPP</dc:creator>
      <dc:date>2016-09-25T08:14:31Z</dc:date>
    </item>
  </channel>
</rss>

