Importing Vector Files in Grass

 

When you want to use Grass5 to make a geographical study of a particular region, you have to build your own mapset. Here is the problem of importing data into Grass5 : there are different formats. We will describe here how to import vector files into Grass5, from ESRI shape files and ASCII vector files.

How can I import a vector file into Grass5 from an ASCII vector file ?

It exists a functionalitie called v.in.ascii to import such data. If you have opened Grass TCLTK (TCLTK is the graphic user interface), you can reach this function on the menu bar : Import > Vector Map > ASCII GRASS vector file. Then a window will appear :

On the first line, write the name of the ASCII vector file you want to import. On the second line, type in the name of the resulting Grass binary vector map. Then, click Run. You can do this without the TCLTK interface, using Grass5 in a Unix shell, by entering the command line :

v.in.ascii input=[name of the ASCII vector file] output=[name of the resulting binary file]

 

How can I import a vector file into Grass5 from an ESRI shape file (.shp) ?

You must use the function v.in.shape. In TCLTK, choose on the menu bar Import > Vector Map > ESRI shape file. Then, this window will appear :

When you import a shape file (file.shp), you maust verify that this file is stored with 3 other files (file.dbf ...).

The only field that you must fill in this window is the name of the shape file you want to import (on the first line). If you are interested in the very precise other parameters, you can read the manual. Some of them are interesting for debugging, or to change the scale of the map.

It could be interesting to click "List fields in database (dbf)"; it lists the list of the field contained in the database (file.dbf) of the shape file.

When you have chosen everything, click Run.

If you are using Grass5 in a shell, type in :

v.in.shape input=file.shp output= [name of the Grass vector file]

You can notice that when using TCLTK, you cannot directly give a name to the resulting file...

 

What are the other formats that can be imported as Grass5 vector files ?

You can import ARC/INFO ungenerate files, AUTOCAD DXF files and GPS files. You can also try to import other formats, with the function v.import.