[GRASS-dev] Building a map to test my module

Hi everyone,
I need to test a part of my module and I’d like to know if it is possible to build a very little raster map starting with some data I’d send in input in that script (like elevations, areas, number of rows and cols and so on).

Regards,
Roberto


Inviato da Yahoo! Mail.
La casella di posta intelligente.

roberto caselli wrote:

I need to test a part of my module and I'd like to know if it is
possible to build a very little raster map starting with some data I'd
send in input in that script (like elevations, areas, number of rows
and cols and so on).

There are many ways to generate test maps. r.surf.random and
r.surf.gauss will generate random values, r.mapcalc can be used to
generate surfaces specified by an equation and/or random values,
r.in.xyz and r.in.ascii can be used to generate a map from data which
can be easily generated by a script.

Except for r.in.ascii, the bounds and resolution of any raster map
created as above will be determined by the current region.

--
Glynn Clements <glynn@gclements.plus.com>

roberto caselli wrote:

I need to test a part of my module and I'd like to know if it is
possible to build a very little raster map starting with some data I'd
send in input in that script (like elevations, areas, number of rows
and cols and so on).

for an example using g.region + r.mapcalc, see the v.colors script in
grass-addons:
  http://trac.osgeo.org/grass/browser/grass-addons/vector/v.colors/
  # Populate a GRASSRGB column with a color map and data column
  # Helper script for thematic mapping tasks

look for:
# setup internal region
# create dummy raster map

Hamish

      ____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

I used r.is.ascii with this example:

north:                   4299000.00
south:                   4247000.00
east:                     528000.00
west:                     500000.00
rows:                         10   
cols:                         15   
null:                      -9999   

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

but that module gave me a raster map with all null cells
and with number of rows and cols different than those I wrote
in that input file

Glynn Clements glynn@gclements.plus.com ha scritto:

roberto caselli wrote:

I need to test a part of my module and I’d like to know if it is
possible to build a very little raster map starting with some data I’d
send in input in that script (like elevations, areas, number of rows
and cols and so on).

There are many ways to generate test maps. r.surf.random and
r.surf.gauss will generate random values, r.mapcalc can be used to
generate surfaces specified by an equation and/or random values,
r.in.xyz and r.in.ascii can be used to generate a map from data which
can be easily generated by a script.

Except for r.in.ascii, the bounds and resolution of any raster map
created as above will be determined by the current region.


Glynn Clements


Inviato da Yahoo! Mail.
La casella di posta intelligente.

Hi,
number of output rows/cols depends on Your current region settings.
Try to run g.region rast=MyInputMap at first to set Your region to
input map.

NULL values in output depend on Your code - no help without actual module code.

Maris.

2008/4/23, roberto caselli <roberto.caselli@yahoo.it>:

I used r.is.ascii with this example:

north: 4299000.00
south: 4247000.00
east: 528000.00
west: 500000.00
rows: 10
cols: 15
null: -9999

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

but that module gave me a raster map with all null cells
and with number of rows and cols different than those I wrote
in that input file