— On Tue, 11/9/10, Micha Silver <micha@arava.co.il> wrote:
From: Micha Silver <micha@arava.co.il>
Subject: Re: [GRASS-user] r.thin ?
To: “charlie” <carowan@yahoo.com>
Cc: grass-user@lists.osgeo.org
Date: Tuesday, November 9, 2010, 1:53 PMOn 11/09/2010 06:21 PM, charlie wrote:
Micha and Achim, thank you for the replies. In response to your questions, I am trying to convert a raster map (a scanned & georeferenced map with only XY data) with a shoreline and some wetland islands into a vector map so I can compare gains/losses over time. A preview of the map is here: http://historicalcharts.noaa.gov/tiled_jpgs_done/zoomifyURLDrivenWebPage.htm?zoomifyImagePath=579-12-1929 |
So what you want is the boundaries of the islands? I think that in order to extract this from the image, you’ll have to do some pre-processing of the image - you need the raster to show only the boundaries, and everything else should be 0. From the r.thin man page:
"r.thin assumes that linear features are encoded with positive values on a background of 0’s in the input raster data file. "
So you’ll have to query the image for the color value of the boundary lines, then use an r.mapcalc expression to get only those raster pixels and set everything else to 0. This might get very tedious since it seems all the text and horizontal hashing lines are the same color as the boundary lines…
If you succeed to separate the boundaries, then run the resulting raster thru r.thin, and finally convert to vector.
This mail was received via Mail-SeCure System.
The command I used is as follows:
r.thin input=NOAA1929 output=NOAA1929THIN iterations=6000I have tried r.thin with 1000 iterations, which did successfully thin the lines down to the features borders quite well, however only 50% of the map was completed.
I bumped the iterations up to 6000, it completed in 4200, but it seemed that it thinned the entire map down to a 1px line.
Thanks
— On Tue, 11/9/10, Micha Silver <micha@arava.co.il> wrote:
> From: Micha Silver <micha@arava.co.il>
> Subject: Re: [GRASS-user] r.thin ?
> To: “charlie” <carowan@yahoo.com>
> Cc: grass-user@lists.osgeo.org
> Date: Tuesday, November 9, 2010, 5:24 AM
>
> charlie wrote:
>
> > Hi. I am currently using Grass 6.4 on linux and beginning the the process of vectorizing an old NOAA raster map with r.thin. The map is approximately 12,000 pixels by 8,000 pixels wide.
> >
> > According to this post, ( http://osgeo-org.1803224.n2.nabble.com/r-thin-td2718260.html#a2718260 )the iteration variable has to be equal or larger than half the number of cells of the wider line so I increased the iterations to 6,000, and it would up finishing in approximately 4,200 passes.
> >
> > Previously, I was getting excellent preliminary results, with fewer (1,000) iterations, distinct features were visible, however at least 50% of the map was not completed.
> > Now with an increase to 6,000 iterations r.thin completes, but the results are a single 1px wide horizontal line. Im sure I am overlooking something relatively simple; can anyone give me any advice on how to best run r.thin in this particular case?
> >
>
> What is it you are trying to do? The r.thin module is designed to make line features in a raster exactly one pixel wide so that when converting to a line vector, the line will be clean.
> If you run r.thin on a raster that represents areas, and give a high enough iteration value, the areas will eventually be reduced to lines.
>
> >
> > Thanks!
> >
> > Charlie
> >
> >
> > <a href=“http://www.wetlandresearch.com”>Wetlands</a>
> >
> >
> > This mail was received via Mail-SeCure System.
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > grass-user mailing list
> > grass-user@lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/grass-user
> >
> > This mail was received via Mail-SeCure System.
> >
> >
> >
--
Micha Silver
Arava Development Co. +972-52-3665918
[http://www.surfaces.co.il](http://www.surfaces.co.il)