Hi All,
BY the help of below script, i trying to get properties of raster using mask file. I want certain area statistics value of raster.
So far i have, but its getting error while performing the task
<SPAN class="keyword token">import</SPAN> arcpy
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>workspace <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"D:\Annomaly_SPEI_12"</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>Mask <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"D:\Agro_Zone\Zone-1.shp"</SPAN>
Mask <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>Mask
rasterList <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>ListRasters<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">for</SPAN> raster <SPAN class="keyword token">in</SPAN> rasterList<SPAN class="punctuation token">:</SPAN>
rasterObj <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Raster<SPAN class="punctuation token">(</SPAN>raster<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> raster
bands <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>GetRasterProperties_management<SPAN class="punctuation token">(</SPAN>Mask <SPAN class="punctuation token">,</SPAN>raster<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"MEAN"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">"MEAN VALUE: %s"</SPAN> <SPAN class="operator token">%</SPAN>bands
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Error Massage :
ERROR <SPAN class="number token">000864</SPAN><SPAN class="punctuation token">:</SPAN> Property type<SPAN class="punctuation token">:</SPAN> The input <SPAN class="keyword token">is</SPAN> <SPAN class="operator token">not</SPAN> within the defined domain<SPAN class="punctuation token">.</SPAN>
ERROR <SPAN class="number token">000800</SPAN><SPAN class="punctuation token">:</SPAN> The value <SPAN class="keyword token">is</SPAN> <SPAN class="operator token">not</SPAN> a member of MAXIMUM <SPAN class="operator token">|</SPAN> MINIMUM <SPAN class="operator token">|</SPAN> MEAN <SPAN class="operator token">|</SPAN> STD <SPAN class="operator token">|</SPAN> TOP <SPAN class="operator token">|</SPAN> LEFT <SPAN class="operator token">|</SPAN> RIGHT <SPAN class="operator token">|</SPAN> BOTTOM <SPAN class="operator token">|</SPAN> CELLSIZEX <SPAN class="operator token">|</SPAN> CELLSIZEY <SPAN class="operator token">|</SPAN> VALUETYPE <SPAN class="operator token">|</SPAN> COLUMNCOUNT <SPAN class="operator token">|</SPAN> ROWCOUNT <SPAN class="operator token">|</SPAN> BANDCOUNT <SPAN class="operator token">|</SPAN> ALLNODATA <SPAN class="operator token">|</SPAN> ANYNODATA <SPAN class="operator token">|</SPAN> SENSORNAME <SPAN class="operator token">|</SPAN> PRODUCTNAME <SPAN class="operator token">|</SPAN> ACQUSITIONDATE <SPAN class="operator token">|</SPAN> SOURCETYPE <SPAN class="operator token">|</SPAN> CLOUDCOVER <SPAN class="operator token">|</SPAN> SUNAZIMUTH <SPAN class="operator token">|</SPAN> SUNELEVATION <SPAN class="operator token">|</SPAN> SENSORAZIMUTH <SPAN class="operator token">|</SPAN> SENSORELEVATION <SPAN class="operator token">|</SPAN> OFFNADIR <SPAN class="operator token">|</SPAN> WAVELENGTH<SPAN class="punctuation token">.</SPAN>
ERROR <SPAN class="number token">000864</SPAN><SPAN class="punctuation token">:</SPAN> Band Name<SPAN class="punctuation token">:</SPAN> The input <SPAN class="keyword token">is</SPAN> <SPAN class="operator token">not</SPAN> within the defined domain<SPAN class="punctuation token">.</SPAN>
ERROR <SPAN class="number token">000800</SPAN><SPAN class="punctuation token">:</SPAN> The value <SPAN class="keyword token">is</SPAN> <SPAN class="operator token">not</SPAN> a member of Band_1<SPAN class="punctuation token">.</SPAN>
Failed to execute <SPAN class="punctuation token">(</SPAN>GetRasterProperties<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>