<?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: RASTER CELL X/Y VALUES in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/raster-cell-x-y-values/m-p/759661#M58615</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Alcaraz,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use the &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//00170000002q000000" rel="nofollow noopener noreferrer" target="_blank"&gt;Fishnet &lt;/A&gt;&lt;SPAN&gt;tool to create a polygon fishnet using the extent and cell size of your raster.&amp;nbsp; You can then use the Search Cursor to return the xmin, ymin, xmax, and ymax of each polygon.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;cursor = arcpy.SearchCursor(fc)
for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print row.Shape.extent.XMin, row.Shape.extent.YMin, row.Shape.extent.XMax, row.Shape.extent.YMax

del cursor, row&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 08:16:08 GMT</pubDate>
    <dc:creator>JakeSkinner</dc:creator>
    <dc:date>2021-12-12T08:16:08Z</dc:date>
    <item>
      <title>RASTER CELL X/Y VALUES</title>
      <link>https://community.esri.com/t5/python-questions/raster-cell-x-y-values/m-p/759656#M58610</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;BR /&gt;&lt;SPAN&gt;I'm trying to calculate the area of multiple rasters on a cell by cell basis, that is from decimal degrees to square meters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've put together an equation that calculates that (see attachment) but as I'm very new to python I'm having difficulties trying to get the X Min, X Max, Y Min, Y Max values for each cell into the equation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any tips and trick that I can use to accomplish the task would be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Toni&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 13:52:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-cell-x-y-values/m-p/759656#M58610</guid>
      <dc:creator>anTonialcaraz</dc:creator>
      <dc:date>2013-08-23T13:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: RASTER CELL X/Y VALUES</title>
      <link>https://community.esri.com/t5/python-questions/raster-cell-x-y-values/m-p/759657#M58611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am not 100% on this but a raster can be broken down into a point feature and the entire cell is a single value.&amp;nbsp; The area of the cell is bespoken by the resolution of the raster.&amp;nbsp; Hence if the resolution is 2 foot the center of the cell (the x,y) would be 1 foot from each side at a 90 angle.&amp;nbsp; Pythagorean Theorem would then be used to determine the min/max of the x,y&amp;nbsp; of the cell.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I'm trying to calculate the area of multiple rasters on a cell by cell basis, that is from decimal degrees to square meters.&lt;BR /&gt;I've put together an equation that calculates that (see attachment) but as I'm very new to python I'm having difficulties trying to get the X Min, X Max, Y Min, Y Max values for each cell into the equation.&lt;BR /&gt;&lt;BR /&gt;Any tips and trick that I can use to accomplish the task would be greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Toni&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 14:14:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-cell-x-y-values/m-p/759657#M58611</guid>
      <dc:creator>RobertBorchert</dc:creator>
      <dc:date>2013-08-23T14:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: RASTER CELL X/Y VALUES</title>
      <link>https://community.esri.com/t5/python-questions/raster-cell-x-y-values/m-p/759658#M58612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply Robert.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As I'm dealing with Decimal Degrees here I'm not sure I would get the area right. The equation takes that into account.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm pretty sure there is a way in Python to call XY Min/Max for each cell so I can introduce those values into the equation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;many thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Toni&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 14:39:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-cell-x-y-values/m-p/759658#M58612</guid>
      <dc:creator>anTonialcaraz</dc:creator>
      <dc:date>2013-08-23T14:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: RASTER CELL X/Y VALUES</title>
      <link>https://community.esri.com/t5/python-questions/raster-cell-x-y-values/m-p/759659#M58613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not sure if this helps or hurts, but couldn't you:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Run RasterToPolygon_conversion to arrive at a polygon Feature Class.&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Raster_to_Polygon/001200000008000000/"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#/Raster_to_Polygon/001200000008000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Then go through a SearchCursor, set the shape extent for each row and this would get you the X Min, X Max, Y Min, Y Max values.&amp;nbsp; Perhaps you could just populate a list or data frame with which you could pass back to your process/calling application.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(sorry no working code to show on this one but you could probably whip something together pretty easily).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 14:58:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-cell-x-y-values/m-p/759659#M58613</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2013-08-23T14:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: RASTER CELL X/Y VALUES</title>
      <link>https://community.esri.com/t5/python-questions/raster-cell-x-y-values/m-p/759660#M58614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks a lot James. I had already considered this option.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Problem is that when I convert from raster to polygon some cells get merged together so I would lose the true area of several cells and I do need to get the area right for each cell prior to calculating volume.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;toni&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 08:50:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-cell-x-y-values/m-p/759660#M58614</guid>
      <dc:creator>anTonialcaraz</dc:creator>
      <dc:date>2013-08-27T08:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: RASTER CELL X/Y VALUES</title>
      <link>https://community.esri.com/t5/python-questions/raster-cell-x-y-values/m-p/759661#M58615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Alcaraz,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use the &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//00170000002q000000" rel="nofollow noopener noreferrer" target="_blank"&gt;Fishnet &lt;/A&gt;&lt;SPAN&gt;tool to create a polygon fishnet using the extent and cell size of your raster.&amp;nbsp; You can then use the Search Cursor to return the xmin, ymin, xmax, and ymax of each polygon.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;cursor = arcpy.SearchCursor(fc)
for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print row.Shape.extent.XMin, row.Shape.extent.YMin, row.Shape.extent.XMax, row.Shape.extent.YMax

del cursor, row&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:16:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-cell-x-y-values/m-p/759661#M58615</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-12T08:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: RASTER CELL X/Y VALUES</title>
      <link>https://community.esri.com/t5/python-questions/raster-cell-x-y-values/m-p/759662#M58616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks a lot Jake. That was very useful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Toni&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 14:03:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-cell-x-y-values/m-p/759662#M58616</guid>
      <dc:creator>anTonialcaraz</dc:creator>
      <dc:date>2013-08-28T14:03:51Z</dc:date>
    </item>
  </channel>
</rss>

