Select to view content in your preferred language

How to Extract Value from Raster into Polygon?

10506
14
11-03-2016 02:09 PM
GwanSeonKim
Emerging Contributor

Hi, GIS users.

I am struggling with extracting value from raster into each polygon.

I have two layers, which are major crop raster and field boundary shapefile.

I attached a picture to explain what I want to do in detail.

Black line shows single polygon for each field boundaries, and yellow and red colors represent corn and soybeans respectively.

Each color includes single pixels (30 by 30 meters).  

I want to know how many pixels are located in each field.

I may need to clean (delete) some pixels in raster file since there are many single pixels located in field boundary. 

However, I really want to know how may pixels are combined in each field boundary. 

Please help me what tools should I used to do that. 

Thank you.

0 Kudos
14 Replies
DanPatterson_Retired
MVP Emeritus
0 Kudos
GwanSeonKim
Emerging Contributor

Thank you for your response.

I tried to use Tabulate area tool, but it takes 12 hours.

I guess it is due to the fact that I have 1290100 field boundaries with 5 different crops.

Do you think is it normal to take this much long?

I also realized that I have so unnecessary polygons if they do not have any pixels.

I additionally asked my question on GeoNet.  

Do you have any ideas how to delete those unnecessary polygons?

Thank you again.

0 Kudos
DanPatterson_Retired
MVP Emeritus

if you did a tabulate area, what is in the table?  There should be a field with results from it, which you can query for polygons that contain output, then switch the selection and save to a file which will only contain the results.

By the way... this is GeoNet...

Also, please answer the question as to what we are looking at... one polygon file... or a polygon and a raster file

0 Kudos
GwanSeonKim
Emerging Contributor

I eventually canceled the tabulate area tool because I could not get the output over 12 hours.

Should I wait more? because I do not know whether tabulate area takes this much long or not.

0 Kudos
DanPatterson_Retired
MVP Emeritus
0 Kudos
GwanSeonKim
Emerging Contributor

Thank you so much for all of your responses

0 Kudos
curtvprice
MVP Esteemed Contributor

1,290,100 is a very large polygon dataset, and REALLY big for a shapefile. If you're tabulating area I dont' see why single pixels are a problem, you would just get a total for each polygon.

It sounds like you are not sure what you are doing yet. It's generally a bad idea to do a huge overlay until you are sure you are going to get what you want! (Learned this the hard way.)

My advice (once have debugged a processing flow that gives what you want testing with smaller datasets and extent) is to tile your data, that is, do the analysis for smaller groups of polygons, not all million plus at once.

0 Kudos
GwanSeonKim
Emerging Contributor

Hi,

First of all, thanks for your response.

I have Cropland Data Layer, which is 30*30 meter satellite image.

I want to make a field-based panel data in order to see the crop rotation for specific crops in Kentucky at the end.

First, I was thinking to figure out how many fields are growing corn, soybean, and so on based on field boundary shapefile.

Since I have so many unnecessary fields (i.e., not for corn or soybean), I would like to delete those fields. (It is because 

Second, I want to calculate how many pixels are located in each field in order to calculate total acres in each field based on number of pixels.

Based on your suggestion, I may able to test smaller datasets and extent. However, I have 92 counties based on field boundary shapefile. It means I need to repeat 92 times.

If you have better ideas, please let me know. 

0 Kudos
curtvprice
MVP Esteemed Contributor

It means I need to repeat 92 times.

Exactly my suggestion. This will probably run much faster than running the whole thing at once due to memory limitations. Looping or model builder iteration should make this pretty straightforward.

0 Kudos