I have two raster maps both of which have the value of all cells as 2,
with the label 'Category 2.' I want to change the value of all cells in each
map, one map to 0.0 the other map to 12.5. r.category allows me to change
categories but not values and r.mapcalc allows me to create new maps with
cells having a value based on the expression.
What I fail to see is the appropriate module to modify an existing map by
changing the value in each cell. Please point me in the right direction.
Maybe if-then statements with mapcalc are applicable to the situation.
outputRaster=if(EXPRESSION,true,false)
Mark,
I'll try writing an expression that tests for a map name. I can use any
output map name because if it contains the appropriate cell values a simple
g.rename will work.
Perhaps this will work:
r.mapcalc 'output1 = if (mapname@mapset,value=0.0)'
I'll try it tomorrow morning and post the results.
Maybe if-then statements with mapcalc are applicable to the situation.
outputRaster=if(EXPRESSION,true,false)
Mark,
I'll try writing an expression that tests for a map name. I can use any
output map name because if it contains the appropriate cell values a simple
g.rename will work.
Perhaps this will work:
r.mapcalc 'output1 = if (mapname@mapset,value=0.0)'
I'll try it tomorrow morning and post the results.
which means in the resulting map: if the cell value in B is equal to 1, then
take the raster cell value of raster A, otherwise divide the raster cell
value of A by the raster cell value of B.
which means in the resulting map: if the cell value in B is equal to 1, then
take the raster cell value of raster A, otherwise divide the raster cell
value of A by the raster cell value of B.
Helmut,
I understand this produces a new map from two maps with different values.
My two raster maps have the same value (2) because they come from dividing a
single vector map whose area has a single value.
I'm trying various v.db.* modules to change values in the two vector maps,
then I can recreate the vector maps from these and each will have the
desired value. So far no success, but I'll keep trying.
which means in the resulting map: if the cell value in B is equal to 1,
then
take the raster cell value of raster A, otherwise divide the raster cell
value of A by the raster cell value of B.
Helmut,
I understand this produces a new map from two maps with different
values.
My two raster maps have the same value (2) because they come from dividing
a
single vector map whose area has a single value.
I'm trying various v.db.* modules to change values in the two vector
maps,
then I can recreate the vector maps from these and each will have the
desired value. So far no success, but I'll keep trying.
Thanks,
Rich
_______________________________________________
grass-user mailing list
Start editing the vector, then click "update/display attributes" button,
then click the appropriate centroid and change the value in the vector
table.
Mark,
Thank you. It did not occur to me to change the centroid value. I was
looking to add a column to the sqlite table and then apply a value to it.
Didn't work well.
Start editing the vector, then click "update/display attributes" button,
then click the appropriate centroid and change the value in the vector
table.
Mark,
For one of the two maps created from the overall area this worked fine.
For the other map there is no table where I can change the centroid's value.
The othe map displays an 'Update attributes' dialog box with the layer and
category tab, but the area beneath that is blank. Perhaps I need to replace
the centroid in that map?
For one of the two maps created from the overall area this worked fine.
For the other map there is no table where I can change the centroid's
value. The othe map displays an 'Update attributes' dialog box with the
layer and category tab, but the area beneath that is blank. Perhaps I need
to replace the centroid in that map?
Found a work-around. In the layer management window I selected the problem
map and chose 'Show attribute data'. In the manage tables tab I added a
second column of type float, then entered the value in the browse data tab.
Now both tables have an attribute column with appropriate values.