[GRASS-user] calculate pixel areas with starspan

Hi,

I have grass rasters and I want to calculate raster classes based on
the attributes of a shapefile. I'm experimenting with starspan and so
far its extremely fast than:

v.in.ogr #to export shapefile
v.build and v.digit #to check for topology problems
v.to.rast
r.report

But, how can I get area coverage (in percent and hectares) from a
given raster class in a polygon?

Any ideas?

Cheers,

Maning

--
|---------|----------------------------------------------------------|
| __.-._ |"Ohhh. Great warrior. Wars not make one great." -Yoda |
| '-._"7' |"Freedom is still the most radical idea of all" -N.Branden|
| /'.-c |Linux registered user #402901, http://counter.li.org/ |
| | /T |http://esambale.wikispaces.com|
| _)_/LI |http://www.geocities.com/esambale/philbiodivmap/philbirds.html |
|---------|----------------------------------------------------------|

On Sunday 19 November 2006 21:53, maning sambale wrote:

Hi,

I have grass rasters and I want to calculate raster classes based on
the attributes of a shapefile. I'm experimenting with starspan and so
far its extremely fast than:

v.in.ogr #to export shapefile
v.build and v.digit #to check for topology problems
v.to.rast
r.report

But, how can I get area coverage (in percent and hectares) from a
given raster class in a polygon?

Any ideas?

Cheers,

Maning

Hi Manning,

How are you invoking starspan, and what exactly do you mean by "an area
coverage" ?

You might check out the "mini-raster" options in starspan:
--mini_rasters <prefix>
--mini_raster_strip <filename>

I believe that these will extract "mini" rasters for each vector feature. Be
sure to read the documentation however.

Cheers,

--
Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis
530.754.7341

commands goes like tihis

#extract number of pixels by class, vector is a municipality shapefile
raster is grass raster
starspan --vector /home/maning/data/ciPhimuni/ciphimuni.shp --raster
/home/maning/data/manilageog/sealevel3/cellhd/rise_5_reclass --fields
MUNICIPALI --count-by-class /home/maning/data/stat/rise_5_class.csv
--noColRow --noXY --progress

#get statistics
starspan --vector /home/maning/data/ciPhimuni/ciphimuni.shp --raster
/home/maning/data/manilageog/sealevel3/cellhd/rise_5_reclass --fields
MUNICIPALI --stats /home/maning/data/stat/rise_5_stats.csv avg mode
stdev min max --noColRow --noXY --progress

How do I compute class areas for each polygon?

Cheers,

Maning

On 11/21/06, Dylan Beaudette <dylan.beaudette@gmail.com> wrote:

On Sunday 19 November 2006 21:53, maning sambale wrote:
> Hi,
>
> I have grass rasters and I want to calculate raster classes based on
> the attributes of a shapefile. I'm experimenting with starspan and so
> far its extremely fast than:
>
> v.in.ogr #to export shapefile
> v.build and v.digit #to check for topology problems
> v.to.rast
> r.report
>
> But, how can I get area coverage (in percent and hectares) from a
> given raster class in a polygon?
>
> Any ideas?
>
> Cheers,
>
> Maning

Hi Manning,

How are you invoking starspan, and what exactly do you mean by "an area
coverage" ?

You might check out the "mini-raster" options in starspan:
--mini_rasters <prefix>
--mini_raster_strip <filename>

I believe that these will extract "mini" rasters for each vector feature. Be
sure to read the documentation however.

Cheers,

--
Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis
530.754.7341

--
|---------|----------------------------------------------------------|
| __.-._ |"Ohhh. Great warrior. Wars not make one great." -Yoda |
| '-._"7' |"Freedom is still the most radical idea of all" -N.Branden|
| /'.-c |Linux registered user #402901, http://counter.li.org/ |
| | /T |http://esambale.wikispaces.com|
| _)_/LI |http://www.geocities.com/esambale/philbiodivmap/philbirds.html |
|---------|----------------------------------------------------------|

Just a bit of update:
Starspan is faster processing Gtiff (I'm using Byte) compared to
native GRASS raster.
Although I have not timed it precisely, its around 10 times faster.

Maning

On 11/23/06, maning sambale <emmanuel.sambale@gmail.com> wrote:

commands goes like tihis

#extract number of pixels by class, vector is a municipality shapefile
raster is grass raster
starspan --vector /home/maning/data/ciPhimuni/ciphimuni.shp --raster
/home/maning/data/manilageog/sealevel3/cellhd/rise_5_reclass --fields
MUNICIPALI --count-by-class /home/maning/data/stat/rise_5_class.csv
--noColRow --noXY --progress

#get statistics
starspan --vector /home/maning/data/ciPhimuni/ciphimuni.shp --raster
/home/maning/data/manilageog/sealevel3/cellhd/rise_5_reclass --fields
MUNICIPALI --stats /home/maning/data/stat/rise_5_stats.csv avg mode
stdev min max --noColRow --noXY --progress

How do I compute class areas for each polygon?

Cheers,

Maning

On 11/21/06, Dylan Beaudette <dylan.beaudette@gmail.com> wrote:
> On Sunday 19 November 2006 21:53, maning sambale wrote:
> > Hi,
> >
> > I have grass rasters and I want to calculate raster classes based on
> > the attributes of a shapefile. I'm experimenting with starspan and so
> > far its extremely fast than:
> >
> > v.in.ogr #to export shapefile
> > v.build and v.digit #to check for topology problems
> > v.to.rast
> > r.report
> >
> > But, how can I get area coverage (in percent and hectares) from a
> > given raster class in a polygon?
> >
> > Any ideas?
> >
> > Cheers,
> >
> > Maning
>
> Hi Manning,
>
> How are you invoking starspan, and what exactly do you mean by "an area
> coverage" ?
>
> You might check out the "mini-raster" options in starspan:
> --mini_rasters <prefix>
> --mini_raster_strip <filename>
>
> I believe that these will extract "mini" rasters for each vector feature. Be
> sure to read the documentation however.
>
> Cheers,
>
> --
> Dylan Beaudette
> Soils and Biogeochemistry Graduate Group
> University of California at Davis
> 530.754.7341
>

--
|---------|----------------------------------------------------------|
| __.-._ |"Ohhh. Great warrior. Wars not make one great." -Yoda |
| '-._"7' |"Freedom is still the most radical idea of all" -N.Branden|
| /'.-c |Linux registered user #402901, http://counter.li.org/ |
| | /T |http://esambale.wikispaces.com|
| _)_/LI |http://www.geocities.com/esambale/philbiodivmap/philbirds.html |
|---------|----------------------------------------------------------|

--
|---------|----------------------------------------------------------|
| __.-._ |"Ohhh. Great warrior. Wars not make one great." -Yoda |
| '-._"7' |"Freedom is still the most radical idea of all" -N.Branden|
| /'.-c |Linux registered user #402901, http://counter.li.org/ |
| | /T |http://esambale.wikispaces.com|
| _)_/LI |http://www.geocities.com/esambale/philbiodivmap/philbirds.html |
|---------|----------------------------------------------------------|

On 11/24/06, maning sambale <emmanuel.sambale@gmail.com> wrote:

Just a bit of update:
Starspan is faster processing Gtiff (I'm using Byte) compared to
native GRASS raster.
Although I have not timed it precisely, its around 10 times faster.

I've experience similar performance with starspan. I've not done any
precise tests but a 10x performance decrease sounds similar to my
experiences.

I've used starspan with arcinfo grids, gtiffs and erdas imgs with very
good performance; GRASS rasters seems to be the exception. It is odd
since starspan uses GDAL for raster access and normal GDAL operations
don't seem that much slower on GRASS rasters.

--
Matthew T. Perry
GIS Analyst / Software Engineer
National Center for Ecological Analysis and Synthesis (NCEAS)
work: perry@nceas.ucsb.edu
web: http://www.perrygeo.net

Hi,

On 11/26/06, Matthew Perry <perrygeo@gmail.com> wrote:

I've experience similar performance with starspan. I've not done any
precise tests but a 10x performance decrease sounds similar to my
experiences.

Not entirely GRASS related, but has anyone done any work in getting
starspan to work as a library? I have written some software in python
that works out aggregate statistics and so on, but it is not as
featuer complete as starspan. It would be really helpful to have
starspan as a library :slight_smile:

Jose