[GRASS-user] Extracting centroids as a raster (and are these centroids really at the center?)

Markus Neteler neteler at osgeo.org
Sun Jan 8 19:20:24 EST 2012


On Tue, Jan 3, 2012 at 3:15 PM, Marcello Gorini <gorini at gmail.com> wrote:
> Dear all,
>
> I need to extract the center of raster areas as another raster.
>
> Since my script is totaly raster-based (and I am not used to using vectors),
> I tried to find some kind of r.thin that would generate the centroids,
> instead of trying to "force" the area into lines.

find a script attached which calculated centroids from raster areas.
You may expand it with a final r.in.xyz step to write out the calculated
centroid(s) as raster map.

Hope this helps,
Markus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: r.centroid
Type: application/octet-stream
Size: 3950 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20120109/32458332/r.obj


More information about the grass-user mailing list