[GRASS-user] g.region (was v.to.rast conversion)

Giacomo Piva piva at meeo.it
Wed Dec 16 08:51:21 EST 2009


Hi Markus,
I'm not using the GUI because I need to use GRASS as automated tool to 
convert a shape file to a raster in GTIFF.
I tried to do what you have explained in many ways but without success.

I know that I have to execute something like:
v.in.ogr ...
v.to.rast ...
r.out.gdal ...

But the v.in.ogr returns the g.region error also with the location= option.

I tried to do another operation (maybe simpler), like reading a raster 
image and get information on the region, diong:

r.in.gdal -o -e input=$HOME/raster.tif output=grass_rast location=$LOCATION

Then setting the new location (as you suggested) and running the g.region

g.region -p

and this is the output:


Location <test> created
 100%
r.in.gdal complete. Raster map <grass_rast.1> created.
Copying 144 GCPS in points file for <grass_rast>
GCPs have the following OpenGIS WKT Coordinate System::
GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS
84",6378137,298.2572235629972,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]]
projection: 0 (x,y)
zone:       0
north:      2030
south:      0
west:       0
east:       1354
nsres:      1
ewres:      1
rows:       2030
cols:       1354
cells:      2748620

It seems to work properly...

Why I can't run the v.in.ogr?

Thank you for help.

Markus Metz wrote:
> Hi,
>
> According to the grass book, the v.in.ogr command should include the 
> location option:
> v.in.ogr -o -e dsn=./test_data/test_data.shp output=grass_map 
> location=$LOCATION
>
> then go to the newly created location (set the environment variables 
> accordingly and update .grassrc6), set the region extends and 
> resolution to your demands, run v.to.rast, then r.out.gdal.
>
> IMHO, it is easier to use the GUI.
>
> Hope that helps,
>
> Markus M
>
-- 
Giacomo 



More information about the grass-user mailing list