[GRASS-user] How to create a location and mapset programatically? (Using scritp). And then import MapInfo a vector map.

Dear All,
   I hope I am not repeating something already been answered.

Environment: I have grass621 on a redhat linux.

I have two questions:

Q1. I want to create a location and a mapset via a shell script. I can
create it by invoking grass in a text mode (or gui interface mode) and
then stepping through several screeens (location , mapset input in the
1st screen, projection in the next screen, bounding box for the region
in the 3rd screen and so on). I am wondering whether it is possible to
do all in a script by invoking a set of commands. If so what should be
the sequence of commands.

Q2: Once I create a location and mapset I want to import a vactor map
expoted from MapInfo as .MIF and .MID files. Here we can use v.in.ogr.
But will it have any issues with region deifnition? DO I have to
explicitly specify region before importing MapInfo data?

Thanks in advance,
-Karun

Hi!

On Thu, 2008-07-17 at 16:57 -0500, Nithi, Nachi K (Karun) wrote:
[...]

Q2: Once I create a location and mapset I want to import a vactor map
expoted from MapInfo as .MIF and .MID files. Here we can use v.in.ogr.
But will it have any issues with region deifnition? DO I have to
explicitly specify region before importing MapInfo data?

I don't think setting a region before importing vector data is required
except if you would like to limit import of some data to a specific
region of your interest and use for this purpose the "-r" flag of
v.in.ogr

Thanks in advance,
-Karun

Regards, Nikos

Nithi, Nachi K \(Karun\) wrote:

I have two questions:

Q1. I want to create a location and a mapset via a shell script. I can
create it by invoking grass in a text mode (or gui interface mode) and
then stepping through several screeens (location , mapset input in the
1st screen, projection in the next screen, bounding box for the region
in the 3rd screen and so on). I am wondering whether it is possible to
do all in a script by invoking a set of commands. If so what should be
the sequence of commands.

Use g.proj or g.mapset with the -c flag (note that the version of
g.mapset in 6.2.x doesn't have the -c flag; that requires 6.3.0).

If you want to do this from outside of GRASS, you can start GRASS
non-interactively by running the grass62 script with the full path to
an existing mapset directory as an argument.

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