# Can an area be quantified from a binary color raster? (how much of is x color)

Hi guys

I've been breaking my head trying to figure out a way to do this.

Essentially I have a DTM/DEM, customer wants to know how much of the land is below 23 degrees (45%) slope, so ive done some shaders and its done, simple enough.

Now he asks if i can tell him EXACTLY how much of that land is below 23 degrees... well it should be a simple matter of counting how many pixels are in total in the raster, then subtracting those that are red (over 23 degrees) and what ever is left in pixels multiplied by the pixel resolution should give the correct answer.

The problem is it does not seem to be as straight forward as that, even when i tell global mapper to do the cut-off areas in a sharp binary matter there's still some "blurriness" caused by the compression around the edges of the red, this throws off the whole math

Is there any better, proper way to do this? I guess someone here should know how

Here's an image of the raster, basically I'm being asked to find out how much of it is black and how much is red

Any help on this would be greatly appreciated.

Tagged:

• Ideally getting the areas automatically created as separate vectors so I can just select them and hit analysis/measure and get the total area would be ideal however at this point ill take what ever I can get haha

• Have you looked at "Create Area Features from Equal Values" under the Layer menu and then selecting black or picking it from your image as shown below?

I've shown the results of my crude attempt below just using a screen clip of your image. Your resolution will be (presumably) much higher.

Hope this helps.

Ta,

/al

1. Create the two colour shader
2. Disable Hill Shading to leave just the two colours (it's the mountain shaped button next to shader name on the main toolbar)
3. File > Export > Raster/Image Format
4. Import raster
5. Right-click the raster layer and choose Layer > Create Area Features from Equal Areas
6. Choose All Encountered Color Values
7. Right-click on the new vector layer and choose Split
8. Choose COLOR from the list
9. Right-click on one of the layers then choose Select
10. Right-click in the main window then choose Analysis/Measurement > MEASURE
11. Note the Total Enclosed Area just above the Export to CSV File button
12. Repeat for the other layer
13. Use a little maths to calculate the percentages

• Global Mapper User Trusted User

If you enable slope shader new functions are available.

Choose slope shader and then calculate equal area from layer options. Limits then refer to slopes (either degrees or fractions).

Choose low value, like 0.1 for match distance (if you are using degrees). GM create a bunch of new areas. With "search attributes . . . " and query, find and select those areas where "slope" <= your 23 degrees. Voila!

Copy those and paste in new layer.