Creating MASK from vect

Hi GRASSers,

I would like to create a MASK using a shoreline which I have as a
vector file (ascii or binary) imported to GRASS. Using v.to.rast
results is a raster layer where everything is 0 but the shoreline,
so either everything but the shoreline would be visible or the
other way round :frowning: What I would like to have is: a mask, which
blanks the sea. Since it is not an island, or a lake, it is not a
closed line, the coastline "enters" at the left (western) end of
my loacation and "leaves" at the right (easter) end. A simple
"is-north-of-decision" will fail.
How can I define an area (comparable like a floodfill - pattern in
image-processing tools), so that I can build up my mask?
Or is there a way to make it more directly from the vectors?
Thanks in advance for any suggestion!

Regards,

        Stephan

--
------------------------------------------------------------------------

Stephan Eickschen Tel. : +49 (0)251 83-34704
Westfaelische Wilhelms-Universitaet Fax. : +49 (0)251 83-36100
Institute for Geophysics
Research Unit of Physical Glaciology email: eicksch@uni-muenster.de
Corrensstrasse 24
48149 Muenster
Germany

------------------------------------------------------------------------

My suggestion would be to go back to the vector file in v.digit. Add a
loop around your study area (either land or sea) and label that as a
polygon of type 1. Then convert the polygon vector file to raster. This
will produce a mask file that will have one value over water and another
over land.

Stephan Eickschen wrote:

I would like to create a MASK using a shoreline which I have as a
vector file (ascii or binary) imported to GRASS. Using v.to.rast
results is a raster layer where everything is 0 but the shoreline,

--
Donald R. Newcomb * newcomb@navo.hpc.mil
Naval Oceanographic Office * newcombd@navo.navy.mil
Stennis Space Center, MS 39522 * Voice: (228) 688-5998
FAX: (228) 688-5485 * DSN: 485-5998

Hi, Stephan
What you must do is create a vector polygon, from which you can create a
raster mask. The way that I would do this is first to create a vector
polygon for your region:

r.mapcalc 'region_poly=1'
r.poly i=region_poly o=region_poly
v.support region_poly

Next, patch this polygon to your shoreline, and create nodes where the
lines cross:

v.patch i=region_poly,(your shoreline layer) o=newmap
v.support newmap
v.spag newmap
v.support newmap

Finally, use v.digit to edit newmap. You must make sure that the lines
surrounding the area that you want to show through your mask are "typed"
as Area (under Edit there is a "re-Type" command), and you must label the
area with a non-zero value, such as 1.

v.support newmap (one more time!)
v.to.rast i=newmap o=ocean_mask

Use r.mask to incorporate "ocean_mask" as your mask when desired.
Remember, the non-zero categories in a raster mask are the areas where
analysis will occur. I know this all sounds complicated, but it's really
fairly simple once you understand how it all works. Good luck,
--
Malcolm D. Williamson - GIS Specialist E-mail: malcolm@cast.uark.edu
Center for Advanced Spatial Technologies Phone: (501) 575-6159
Ozark Rm. 12 Fax: (501) 575-5218
University of Arkansas
Fayetteville, AR 72701 Web: http://www.cast.uark.edu

On Sun, 3 May 1998, Stephan Eickschen wrote:

Hi GRASSers,

I would like to create a MASK using a shoreline which I have as a
vector file (ascii or binary) imported to GRASS. Using v.to.rast
results is a raster layer where everything is 0 but the shoreline,
so either everything but the shoreline would be visible or the
other way round :frowning: What I would like to have is: a mask, which
blanks the sea. Since it is not an island, or a lake, it is not a
closed line, the coastline "enters" at the left (western) end of
my loacation and "leaves" at the right (easter) end. A simple
"is-north-of-decision" will fail.
How can I define an area (comparable like a floodfill - pattern in
image-processing tools), so that I can build up my mask?
Or is there a way to make it more directly from the vectors?
Thanks in advance for any suggestion!

Regards,

        Stephan

--
------------------------------------------------------------------------

Stephan Eickschen Tel. : +49 (0)251 83-34704
Westfaelische Wilhelms-Universitaet Fax. : +49 (0)251 83-36100
Institute for Geophysics
Research Unit of Physical Glaciology email: eicksch@uni-muenster.de
Corrensstrasse 24
48149 Muenster
Germany

------------------------------------------------------------------------

Hi-

thanks to all who have answered my request for help! Malcolm - your
way seems to be the best. Unfortunatly, v.spag hangs on my system (as it
is mentioned to be possible in the GRASS Ref. Man. at v.spag / BUGS...).
I am running GRASS4.1.5 on a SGI system (uname -srm IRIX64 6.4 IP27).
It is the binary release from ftp.funet.fi (that is the same as
ftp.cecer.army.mil). >file v.spag< results in

ELF 32-bit MSB dynamic executable MIPS - version 1

Does anybody have an update I could use (if possible as binary)?

I need the capability of v.spag to create nodes for crossing lines. It
hangs at

    Reading Vector file.
100%
    Cleaning lines less than thresh
Identical lines check and Line intersections

Does anybody have experience wilth v.spag of GRASS 4.2X with Linux, or:
Is there a binary release of 4.2X for SGI?

Thanks in advance for any help,

regards,

  Stephan

--
------------------------------------------------------------------------

Stephan Eickschen Tel. : +49 (0)251 83-34704
Westfaelische Wilhelms-Universitaet Fax. : +49 (0)251 83-36100
Institute for Geophysics
Research Unit of Physical Glaciology email: eicksch@uni-muenster.de
Corrensstrasse 24
48149 Muenster
Germany

------------------------------------------------------------------------