[GRASSLIST:2860] Re: GRASS File structure for projects

Glynn Clements glynn.clements at virgin.net
Sat Jan 5 13:48:47 EST 2002


Keene Haywood wrote:

> Hello GRASS users.  I am new to GRASS and am using it on a PowerMac with
> OS X.  I've made a little headway in understanding how GRASS works
> through the tutorial that is posted for v.4.0.  However, I am still in
> the dark about exactly how file need to be organized in GRASS to be used
> with a project.

For the most part, you don't need to know about GRASS' actual
directory layout.

In brief, GRASS maintains a "database" of "map layers". The database
is divided into "locations", each location having a particular
projection and region. Each location is further subdivided into
"mapsets".

At the start of a GRASS session, you choose a location and mapset,
which will be created if they don't already exist. Within the session,
most commands operate on map layers within the selected location
(although some, e.g. r.proj, can read files from other locations). In
general, commands can read from any mapset, but only write to the
selected mapset.

> Also, exactly how does GRASS output files as well.  What
> sort of directory structure needs to be in place?

You need to create the top-level directory within which all of GRASS'
internal files will be created. You specify this directory on the last
line of the startup screen (the line titled "DATABASE:"). All other
files and directories will be created by GRASS as required.

If you start GRASS for the first time with the top-level directory
being empty, a subdirectory will be created for the location which you
specify on the "LOCATION:" line. You will then be prompted for the
geographical parameters (projection, region, resolution) for that
location.

Beneath the location directory, a subdirectory will be created for the
mapset which you choose. When you import files (with commands such as
r.in.tiff), GRASS will create further subdirectories and files within
that mapset.

> I tried setting up a directory the same as the tutorial one, but I
> could not get GRASS to recognize the files.

Various tutorials have associated tar files containing ready-made
directory hierarchies; these are extracted beneath the top-level
directory. Each tar file will typically create a single location (e.g. 
the "spearfish" data set creates a location called "spearfish").

You don't generally attempt to create such directory hierarchies
yourself. Instead, you let the GRASS startup screen create the
location and/or mapset, and let the various import programs create the
actual map layers.

> In particular, I would like to import a DRG tiff file, but can't seem to
> get GRASS to do this. It goes through the motions of importing, but the
> map does not show up in the monitor. 

I'm not familiar with "DRG" TIFF files (I'm a computer programmer, and
have only recently started working with GIS). In general, TIFF files
can be imported with r.in.tiff or r.in.gdal.

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-user mailing list