3
  1. I have a raster data with a continuous value (from a Low 0 to a High 1).
  2. Across the whole area of the raster map, I have 4000 polygons of different shape and size.
  3. Each of these polygons is assigned a value percentage (%). This % indicates the proportion of pixels (from the raster map) out of the total pixels each polygon covers that will be extracted or classified as one category. The selection of pixels should start from the highest raster value until the required number of pixels is met.

Is there a way to do this in ArcGIS Desktop?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
DlanER
  • 31
  • 1
  • That is a tricky problem and there may not be a solution that will meet a precise percentage of pixels. What tolerance are you anticipating? You can get statistics like mean and standard deviation and from that work out what value is around the required percentage but it will not be exact. Would you consider doing this in arcpy? Do you have access to the spatial analyst extension? – Michael Stimson Mar 09 '18 at 03:49
  • Hi Michael, Thanks so much for your quick response. I am totally new to arcpy, so I would prefer Model Builder or any other manual operations. I am not considering any tolerance level. It is as long as the percentage (rounded-off to the nearest equivalent number of pixels) is met in each polygon. Thanks. – DlanER Mar 09 '18 at 03:55
  • RasterToNumPyArray http://resources.arcgis.com/en/help/main/10.2/index.html#//03q300000029000000 doesn't work so well in model builder, it works in python, then you could use this approach https://stackoverflow.com/questions/38504737/calculate-percentage-of-count-for-a-list-of-arrays and as a refinement reclassify the array to 0 or 1 and write as a new raster with NumPyArrayToRaster http://resources.arcgis.com/en/help/main/10.2/index.html#//03q30000007q000000 but the first step is extracting a raster for each polygon which would need spatial analyst extension, do you have this extension? – Michael Stimson Mar 09 '18 at 04:07
  • Hi Michael, I am sorry I missed your last question. Yes, I have access to the Spatial Analyst Extension. – DlanER Mar 09 '18 at 04:07
  • You could perhaps use Iterate Feature Selection http://resources.arcgis.com/en/help/main/10.2/index.html#/Iterate_Feature_Selection/00400000000s000000/ in model builder and Extract by Mask (sa) http://resources.arcgis.com/en/help/main/10.2/index.html#//009z0000002n000000 to stamp out your rasters for each polygon.. but first add a unique value field to your features if you don't already have one (FID isn't a good choice) so that you can relate back to the input polygons. When you're done reclassifying each little raster use Mosaic to New Raster to bring them back together. – Michael Stimson Mar 09 '18 at 04:11
  • Is it possible to post a screenshot here? – DlanER Mar 09 '18 at 04:12
  • Yes, click on the image button and drop your saved screen shot into it (alt+PrtScn with the window you want to copy active, paste into paint and save as png/tiff). Although the first step is possible in model builder this is something that I would definitely consider outside the capabilities of model builder and more suited to arcpy. – Michael Stimson Mar 09 '18 at 04:13
  • Welcome to GIS SE! As a new user be sure to take the [Tour] to learn about our focussed Q&A format. I recommend not thinking about GIS SE as being some sort of online GIS tutor. For your questions to be answered here they should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. – PolyGeo Mar 09 '18 at 04:20
  • Hi PolyGeo, Apologies for any inconvenience. – DlanER Mar 09 '18 at 05:00
  • Hi Michael, I have separated the raster map into 4000 .tif files based on the 4000 polygons using model builder. However, I am stuck on how to select and extract pixels within each polygon. I have to select and extract pixels starting with those with the highest continuous raster value until the required quantity of pixels for each polygon is met. The quantity of pixels is defined by the percentage value associated with each polygon (e.g. 10% of the total pixels inside a polygon; 55%..; and so on). The steps you mentioned above, could you please elaborate more? Thanks so much. – DlanER Mar 09 '18 at 06:09
  • 1
    Raster to points, sort descending and compute record in group. Spatial join is step 2. – FelixIP Mar 09 '18 at 06:45
  • I like your method @FelixIP, provided the individual rasters aren't too large as to overflow the maximum size. So, if you've got 1000 points, sorted ascending, and you want top 10% go to record 900 and select using greater than that value, vola! 10% of cells, then point to raster for the selected records - Nice and simple, but it's going to get very tedious for you DlanER doing this many many times, it might be a good time to think of learning python... it would be much quicker to read the points with a search cursor into a list then sort and find the nth in the list for selection. – Michael Stimson Mar 09 '18 at 11:53
  • @Michael Stimson it's done in one go ising https://gis.stackexchange.com/questions/200150/auto-incrementing-field-based-on-groups-within-feature-class/200154#200154 – FelixIP Mar 09 '18 at 18:34

1 Answers1

1

Input shows polygons over continious raster (made of 650k cells) labelled by required fraction: enter image description here

Output derived using method from my comments above:

enter image description here

Let me know if this is what you are after and you need more details.

FelixIP
  • 22,922
  • 3
  • 29
  • 61