[GRASS-user] NULL cells

Micha Silver micha at arava.co.il
Thu Jul 22 15:42:30 EDT 2010


On 07/22/2010 10:55 AM, Sandile Gumede wrote:
> Hi
> How do you remove null cells, I guess that is what's causing the problem.
Sandile:
If I remember your project details, I think that the problem is not the 
null cells in your rainfall data, but rather the very small catchment 
polygons, some of which fall *totally* within a single rainfall cell 
which has a null value.
>
> r.to.vect complete.
I guess this step is your conversion of basins to a polygon vector map? 
How many polygons are you getting? Check with v.info. What size are they?
v.db.addcol catchments col="area_sqm double precision"
v.to.db catchments opt=area col=area_sqm units=me

And please remind us of the resolution of the rainfall raster with:
r.info rainfall
> GRASS 6.4.0svn (SRTMDEM):~ > r.univar rainfall 100%
> total null and non-null cells: 12967201
> total null cells: 7202
>
> Of the non-null cells:
> ----------------------
> n: 12959999
> minimum: 0
> maximum: 36
> range: 36
> mean: 4.99965
> mean of absolute values: 4.99965
> standard deviation: 9.57207
> variance: 91.6246
> variation coefficient: 191.455 %
> sum: 64795464
>
> GRASS 6.4.0svn (SRTMDEM):~ > v.rast.stats vect=catchments 
> rast=rainfall colprefix=precip
> Processing data (16 categories)...
> Updating the database ...
> DBMI-DBF driver error:
> SQL parser error: syntax error processing 'NULL'
> in statement:
> UPDATE catchments SET precip_cf_=-NULL WHERE cat=10728
> Error in db_execute_immediate()
>
> ERROR: Error while executing: 'UPDATE catchments SET precip_cf_=-NULL 
> WHERE
>        cat=10728'
>
>
Another suggestion: One of the catchment polygons that is failing above 
has cat value 10728. How about extracting just that single polygon, then 
display it on a map together with the rainfall raster to see where it 
falls?
# extract
v.extract catchments out=catch_10728 where="cat=10728"
# Display
g.region rast=rainfall
d.rast rainfall
d.vect catch_10728

-- 
cheers,
Micha
> -- 
> Kind Regards
> TS Gumede
> CSIR, Meraka Institute
> 072 258 1650
>
>
> This mail was received via Mail-SeCure System.
>
>
> _______________________________________________
> grass-user mailing list
> grass-user at 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://surfaces.co.il


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20100722/5b1cf269/attachment.html


More information about the grass-user mailing list