# How to calculate percentage of land covered by a raster

1066
7
11-26-2020 11:53 PM
Labels (1) New Contributor II

Ho I have a raster which shows a density map of this specific phenomenon number of inhabitants/km2.

I need to calculate the percentage for each classes ( 5)  that I created in order to make comparisons.

For example I need do say that the range from 10-20 si represented by the 25% while the range of 20-30 is represented by the 35%.

Is that a way to do that type of analysis with ARCGIS?

3 Solutions

Accepted Solutions by MVP Frequent Contributor

Can you send a picture of the properties of the raster or describe them?

You'll probably have the best luck with just reclassifying the raster to ranges of 0-20, 20-30 etc Reclass by ranges of values—Help | ArcGIS for Desktop (a tip is to do this in the symbology first, which automatically maps these ranges across to the reclassify tool).

When it's reclassified, just use that reclassified raster as input to the build raster attribute table tool.

There are other options such as converting your floats to ints, e.g. use raster calculator to multiply by 1000 etc. then use INT to truncate. The result would represent the values to 3 decimal places multiplied by 1000. by MVP Frequent Contributor

I'm not completely sure of that methodology, the statistics per area are more of a moving window analysis. You may be best setting aggregation zones (split the area into a fishnet/grid of squares, or use the generate tesellation tool to produce hexagons, set the size of these to be 1sqkm for example.  You can then just split the lines at intersections of the boundary of the fishnet, and count the lengths of the lines within each square/hexagon. by MVP Frequent Contributor

Pretty easily, use a spatial join, 'contains' parameter, and set a merge rule to 'sum' of the shape_length field. the output is a copy of the fishnet, but with an additional few attributes, including the sum of all the lines within each polygon.

7 Replies by MVP Frequent Contributor

You should be able to create a Raster Attribute Table (Save the raster into an FGDB first I think). Raster dataset attribute tables—Help | ArcGIS for Desktop

Then you'll have a table of each raster value and the corresponding sum of cell counts.

It would then be fairly easy to sort this out in excel, or you could reclassify the raster first before building the attribute table. New Contributor II

Thank you for your advice. I tried to use the geoprocessing option "build raster attribute table" but unsucessfully.

The system put this type of warning "Only single band integer raster dataset is a valid input" .

I tried to separate the raster into the different bands with Make Raster Layer tool but nothing happened.

The raster that I'm using was created by myself with the tool Line statistics ( from a  shapefile) and it is stored in a file geodatabase. And when I open the single File I can't see the band trees.

Shall I set some specific parameter when creating the raster in order to see the different bands and be able to build the raster  attribute table? by MVP Frequent Contributor

Can you send a picture of the properties of the raster or describe them?

You'll probably have the best luck with just reclassifying the raster to ranges of 0-20, 20-30 etc Reclass by ranges of values—Help | ArcGIS for Desktop (a tip is to do this in the symbology first, which automatically maps these ranges across to the reclassify tool).

When it's reclassified, just use that reclassified raster as input to the build raster attribute table tool.

There are other options such as converting your floats to ints, e.g. use raster calculator to multiply by 1000 etc. then use INT to truncate. The result would represent the values to 3 decimal places multiplied by 1000. New Contributor II

I tried to use this method but I did not obtain the results which I desired applying it to my Master thesis' project.

Here some points to resume my project:

- I have a line shapefile where I mapped a set of drystone walls in an Island.

-I need to make some distribution analysis on it.

-First of all with Line Statistic Tool I Created a raster in order to see the relatioship: km of walls/ area of 1 ha.  It is from this raster that I need to calculate the percentage of each class. And can't find a method to do that

. Then I would like to calculate the area that the drystone walls ( lines) occupy in order to make a comparison between that Area and the total area of the Island ( so I think that I need to find a method to calculate an area from a line shape file)

I tried different method and tools like you suggested me but I couldn't obtain this results.

Thank you so much for any type of advice. by MVP Frequent Contributor

I'm not completely sure of that methodology, the statistics per area are more of a moving window analysis. You may be best setting aggregation zones (split the area into a fishnet/grid of squares, or use the generate tesellation tool to produce hexagons, set the size of these to be 1sqkm for example.  You can then just split the lines at intersections of the boundary of the fishnet, and count the lengths of the lines within each square/hexagon. New Contributor II

I tried to use generate tesselation tool and it was useful to calculate the area occupied by the lines.

I have another question: after splitting the lines at intersections of the fishnet, is that a tool  that I can use to calculate the area per square? by MVP Frequent Contributor

Pretty easily, use a spatial join, 'contains' parameter, and set a merge rule to 'sum' of the shape_length field. the output is a copy of the fishnet, but with an additional few attributes, including the sum of all the lines within each polygon. 