GPSFileDepot.com
 

News:

Welcome to GPSFileDepot!

Main Menu

Converting raster landcover data to shapefiles

Started by Boyd, December 23, 2010, 08:13:12 PM

Previous topic - Next topic

Seldom

Boyd,
Have you seen a way to script this yet?  I just posted the question on the GM Yahoo group?

Boyd

No I haven't, but Globalmapper scripting is something I just haven't had the time to dabble in at all...

maps4gps

Do some testing a use caution.  I found this not to be 100% accurate.  It was not hard to find 'areas' were GM miss classified the polygons.  Anywhere from one or two pixels in size to one area about 1 by 1/4 mile in size.  There was a line around most of these areas but the color in GM was the same (the large area was medium tan bordered by cream, and included dark green and medium red pixels).  Except for processing a very small 'quad' area around this area; the size of the area/quad processed did not seam to matter; even with a very small sized quad/area there were some small miss classified/labeled areas.

Boyd

Are you talking about the National Landcover Dataset? There's an interesting article here: https://www.e-education.psu.edu/natureofgeoinfo/c8_p19.html

There's a lot of variation in the colors of each category, and I spent awhile dealing with that when I developed the technique with Mapwel that I described at the beginning of this thread. From the article in the link above:

QuoteThe USGS hired private sector vendors to assess the classification accuracy of the NLCD 92 by checking randomly sampled pixels against manually interpreted aerial photographs. Results from the first four completed regions suggested that the likelihood that a given pixel is correctly classified ranges from only 38 to 62 percent. Much of the classification error was found to occur among the Level II classes that make up the various Level I classes, and some classes were much more error-prone than others.

USGS encourages users to aggregate the data into 3 x 3 or 5 x 5 pixel blocks (in other words, to decrease spatial resolution from 30 meters to 90 or 150 meters), or to aggregate the 21 Level II classes into the nine Level I classes. Even in the current era of high-resolution satellite imaging and sophisticated image processing techniques, there is still no cheap and easy way to produce detailed, accurate geographic data.

maps4gps

The 2001 NLCD.  For the 2001 data, USGS used different classification algorithms in different areas which were 'tweaked' to give more accurate results in each region; I think the value was 70, or 80 %, but was not able to find the reference yesterday.
Refer to the article you provided the link for.  In the data set provide, each of the classification catagories is assigned and displayed with a specific RGB value.  Three years ago when I check using Photoshop, I found some of the values differed by a number or two (from the values given on a USGS site); however they were consistent.

Boyd

I think the 2001 data has a lot of variation in it..... and I just spent many hours staring at it and clicking on individual pixels using the mapwel feature that selects all other pixels of the same value. Off the top of my head, I'd say that each category probably has from 5 to 10 different RGB values. It seems to vary depending on the color of the adjacent pixels. In other words, if a red pixel is next to a green pixel there can be a range of intermediate colors between red and green. But if a red pixel is next to a yellow pixel, there's a different range of colors.

Your experience and analysis may be different though. If you develop your own techniques that work well for this, I will certainly be interested in hearing about them.

Seldom

#21
If anyone's interested I've attached a draft script that defines areas, assigns types and attributes, and exports them as shape files, using Mike's Do Loop example.  The syntax of color numbers with leading zeros is fussy.  You need to replace the leading zero with a space, so there are two spaces in front of all 2 digit RGB values.

To make it work you need to use the latest build of GM12.01.

maps4gps

FWIW and this may only confuse the issue.

The NLCD data uses a single RGB value for each classification type.
In GM9 the pixels may show a slightly different value depending on the values of the adjacent pixels and may even change values as the tool is moved across a pixel.
In GM12 the values appear to be constant.
In PhotoShop, selecting a polygon with the dropper tool appears to 'flag' all with the same classification.
In MapWell, Boyd reports 'blends' of colors.  I could not remember how to get the RGB value of a pixel.

I conclude that both GM9 and MapWell are changing the pixel values for some reason and the user has no control over this. 
GM12 and PhotoShop are using the RGB values as given in the source data.

Boyd

Very interesting.... that could certainly explain it. Will have to take a closer look at that.

Boyd

Nope, that isn't it. I can clearly see the variation when I open the file and zoom way in in GM 12.01 - see for yourself in this screenshot. After downloading the area 13 landcover file, I used Globalmapper 11 to crop it to the boundaries of each of my map tiles, then exported that as a 24-bit RGB GeoTIFF. Could something have gone wrong there?


Seldom

maps4gps, do you have a link to a site that shows the RGB assignment for each NLCD landcover type?  Right now I'm assigning them by eye, assuming that Dark Green (028,102,051) is Evergreen, etc.

Boyd


Seldom




Closeup of Cedar City, Utah. No ghosting here, but it sure looks like Boyd has it.  There appear to be 4 red to pink settings:
Light pink: Developed Open Space
Dark pink: Developed Low Intensity
Light red:   Developed Medium Intensity
Dark red:  Developed High Intensity

Seldom

Quote from: Boyd on January 19, 2011, 04:13:26 PM
All I have been able to find is this, and it's a .jpg so I don't think the colors are accurate: http://www.mrlc.gov/downloadfile.php?file=NLCD2001_Colour_Classification_Update.jpg

That's the basis for my eyeball judgment, but the numbers must be some sort of classification because RGB requires three comma delimited values.

Boyd

OK, something odd is happening, so I have to check my original downloaded file. If I use the NLCD viewer there's a world of difference. These screenshots don't quite match in coverage and projection, but here's what the viewer looks like:





And this is the same vicinity in Globalmapper:




I'm pretty sure I used the maximum quality in all my imports/exports but maybe I goofed. Or maybe globalmapper is doing some compression?