<?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: Clipping rasters by shapefile in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718277#M40663</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you, Robert!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using gp.clip_management works much faster indeed and also produces jpgs. The only thing that bothered me was that the clipped image was not of the same brightness as the original. Now I added the line: gp.compression= "LZ77" and everything looks awesome!! Thank you again, Robert!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Attached is the working script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As I cheched again the pixel values of the result are not the same as the original's, despite the LZ77 setting.. Any thoughts on how to achieve that the pixel values of the clipped image remain the same?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Sep 2010 06:55:03 GMT</pubDate>
    <dc:creator>MatejTacer</dc:creator>
    <dc:date>2010-09-23T06:55:03Z</dc:date>
    <item>
      <title>Clipping rasters by shapefile</title>
      <link>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718274#M40660</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 need to clip a lot of rasters by a shapefile (clip by irregular shape) and I need a georeferenced jpg as an output. I am trying using "Extract by mask" which basically does what I wanted except:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. the output is GRID instead jpg&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. it makes grid for each color band&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. it's extremely slow and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. it crashes with a large mask file&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thx,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 06:12:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718274#M40660</guid>
      <dc:creator>MatejTacer</dc:creator>
      <dc:date>2010-09-22T06:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping rasters by shapefile</title>
      <link>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718275#M40661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK. I've made it half way around.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I solved the problem with the JPEG output (convert GRID to jpg and delete GRID), however, the problems with speed and large shape file are still there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For clipping an image size 1000x1000 pixels it takes for about 10 minutes! How to speed up the process?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;BTW, I have polygon shape file representing surface area of roads, however, since my images cover a larger area, I need to clip them before analyzing them in terms of crack detection..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;See the attached code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your suggestions,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 12:07:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718275#M40661</guid>
      <dc:creator>MatejTacer</dc:creator>
      <dc:date>2010-09-22T12:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping rasters by shapefile</title>
      <link>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718276#M40662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Matej,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use the clip geoprocessing tool in the raster toolset. This tool allows you to clip based on the geometry of your feature (a parameter on the tool) and you can simply change the output from output.img or output.tif to output.jpg. This way, assuming that your input has a georeference, your output jpg image should also be georeferenced.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;See the help for more details: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000009n000000.htm"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000009n000000.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Robert&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 13:57:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718276#M40662</guid>
      <dc:creator>RobertBerger</dc:creator>
      <dc:date>2010-09-22T13:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping rasters by shapefile</title>
      <link>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718277#M40663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you, Robert!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using gp.clip_management works much faster indeed and also produces jpgs. The only thing that bothered me was that the clipped image was not of the same brightness as the original. Now I added the line: gp.compression= "LZ77" and everything looks awesome!! Thank you again, Robert!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Attached is the working script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As I cheched again the pixel values of the result are not the same as the original's, despite the LZ77 setting.. Any thoughts on how to achieve that the pixel values of the clipped image remain the same?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 06:55:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718277#M40663</guid>
      <dc:creator>MatejTacer</dc:creator>
      <dc:date>2010-09-23T06:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping rasters by shapefile</title>
      <link>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718278#M40664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Matej,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When you use jpg compression the compression algorithm is allowed to change pixel values slightly to achieve a higher compression ratio (smaller files). This is called lossy compression. &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009t00000021000000.htm"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009t00000021000000.htm&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Other compression algorithms such as RLE or LZW are lossless, meaning the pixels remain the same, but they don't work with jpg. You could use .img or .tif for those (and several other formats). &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Another reason why the image might look slightly different (usually you wouldn't notice the difference visually with jpg) is that the statistics are now different and so the image will be stretched differently. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Another reason why identify might show different pixel could be a pixel shift. If you clip to a boundary then your pixels might shift slightly to accommodate the new extent. You can see if snap raster will resolve this. Otherwise clip with lossless compression should not change the pixel value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm glad this is working well for you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Robert&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 13:40:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718278#M40664</guid>
      <dc:creator>RobertBerger</dc:creator>
      <dc:date>2010-09-23T13:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping rasters by shapefile</title>
      <link>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718279#M40665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The JPEG format only supports JPEG compression (not LZ77 compression). However, you can generally achieve a lossless jpeg compression if you modify the compression quality used by the JPEG to 100. However, like posted earlier, if you can use something other than JPEG (such as TIFF) you can guarantee a lossless compression.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Sep 2010 20:21:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718279#M40665</guid>
      <dc:creator>MelanieHarlow</dc:creator>
      <dc:date>2010-09-27T20:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping rasters by shapefile</title>
      <link>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718280#M40666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thank you, Robert!&lt;BR /&gt;&lt;BR /&gt;Using gp.clip_management works much faster indeed and also produces jpgs. The only thing that bothered me was that the clipped image was not of the same brightness as the original. Now I added the line: gp.compression= "LZ77" and everything looks awesome!! Thank you again, Robert!&lt;BR /&gt;Attached is the working script.&lt;BR /&gt;...&lt;BR /&gt;As I cheched again the pixel values of the result are not the same as the original's, despite the LZ77 setting.. Any thoughts on how to achieve that the pixel values of the clipped image remain the same?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Matejt,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does that script actually work?&amp;nbsp; I'm trying to do something similar and I can't get the extent to work out.&amp;nbsp; The clip tool seems a little redundant, if I already have a feature class I want to clip the raster by why do I need to supply the clip extent.&amp;nbsp; Anyway, I've gotten the extent from my feature class and supplied that to the tool but it doesn't actually clip the raster.&amp;nbsp; If I choose the clippinggeometry option it will be masked by the feature class but the extent is the same as the original.&amp;nbsp; My feature class and raster are in different coordinate systems, that might be an issue.&amp;nbsp; Is your feature class and raster in the same coordinate system?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd appreciate any info.&amp;nbsp; Thanks very much,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Nils&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Oct 2010 15:27:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718280#M40666</guid>
      <dc:creator>NilsBabel</dc:creator>
      <dc:date>2010-10-22T15:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping rasters by shapefile</title>
      <link>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718281#M40667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello.&amp;nbsp; I am having a similar issue with the Raster clip tool changing the pixel color of the output.&amp;nbsp; I have tried .jpg, .tif, and .img output and none match the original raster.&amp;nbsp; Its important for me that the colors stay consistent.&amp;nbsp; Any suggestions?&amp;nbsp; Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jan 2011 20:16:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718281#M40667</guid>
      <dc:creator>RyanIrwin1</dc:creator>
      <dc:date>2011-01-18T20:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping rasters by shapefile</title>
      <link>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718282#M40668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Download what used to be Hawth Tools.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://www.spatialecology.com/gme/gmedownload.htm"&gt;http://www.spatialecology.com/gme/gmedownload.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As for the colours the raster displays, that can be made the same with statistics options as long as the values are not being modified.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jan 2011 21:39:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718282#M40668</guid>
      <dc:creator>MichaelStead</dc:creator>
      <dc:date>2011-01-18T21:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping rasters by shapefile</title>
      <link>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718283#M40669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Georeferencing is indeed broken during a clip at ArcGIS 10. I dont know how ESRI allowed this to happen because it was fixed at ArcGIS 9.3.1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I vaguely remember scripting the same function at ArcGIS 9.3 and was relieved to see it was fixed in the last version.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For now I have justed 5 days struggling with this bug in ArcGIS 10 when the raster clipping and georeferencing function is handled in FME 2010.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am seriously considering going back to ArcGIS 9.3.1.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2011 01:22:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/clipping-rasters-by-shapefile/m-p/718283#M40669</guid>
      <dc:creator>SusanJones</dc:creator>
      <dc:date>2011-04-27T01:22:20Z</dc:date>
    </item>
  </channel>
</rss>

