[GRASSLIST:8373] EUCALLOCATION in GRASS?

ArcInfo has a function called EUCALLOCATION (I think that's it) that I
am trying to duplicate in GRASS. I don't know if there is a single
command or a smart way to do this, but I don't have any efficient
ideas.

The EUCALLOCATION function takes a categorical raster as input. Any
null cells are assigned the category value of the nearest known value
based on euclidean distance (hence the name). You can work with
floating point values by converting them to integer "categories". This
is useful for extrapolating into null areas without changing the value
of the last known good point.

I do wave modeling and sometimes the shoreline in the model doesn't
match up with higher resolution bathymetry in GRASS. So I wind up with
waves that are breaking well seaward of the real shoreline. What I
want to do is extrapolate the wave values from the low-resolution data
shoreward to the beach on the high resolution model. I don't want to
change the values in those last known good cells using a neighborhood
function, just "move" them shoreward and fill in the data gap.

Any ideas on how to do this?

David
--
David Finlayson
Marine Geology & Geophysics
School of Oceanography
Box 357940
University of Washington
Seattle, WA 98195-7940
USA

Office: Marine Sciences Building, Room 112
Phone: (206) 616-9407
Web: http://students.washington.edu/dfinlays

The EUCALLOCATION function takes a categorical raster as input. Any
null cells are assigned the category value of the nearest known value
based on euclidean distance (hence the name). You can work with
floating point values by converting them to integer "categories". This
is useful for extrapolating into null areas without changing the value
of the last known good point.

r.grow can be used to do this, perhaps with a r.mapcalc masking step
before/mid/after.

I do wave modeling and sometimes the shoreline in the model doesn't
match up with higher resolution bathymetry in GRASS. So I wind up with
waves that are breaking well seaward of the real shoreline. What I
want to do is extrapolate the wave values from the low-resolution data
shoreward to the beach on the high resolution model. I don't want to
change the values in those last known good cells using a neighborhood
function, just "move" them shoreward and fill in the data gap.

Any ideas on how to do this?

Be careful doing this-- the energy dissipation of the wave model will be
resoloved for the model's domain in a finite sense, and by entending the
surf zone in towards shore you will be artifically increasing its
integrated magnitude.

Someday I hope to get SWAN going for more than 500x500 cells.... it has
horribly wasteful memory usage and also segfaults if you try and
allocate more than 2gb RAM (at least for me).

There's also the common problem that before modern LIDAR bathymetry
(which can see down to 20m) there was generally pretty poor nearshore
coverage by nautical surveyors (can't blame them not wanting to get in
among the rocks and breaking waves really). So you end up trying to
interpolate a DEM from a coastline and the coastline of any nearby
islands. With no soundings in between you are going from 0m->0m across
the bay.. you can try to fix this by including lots of above ground
topography in the DEM creation step to keep the downward "momentum" of
the slope of the beach, but if you have cliffs or the like near the
water's edge this all falls over with bad overshoots, and is generally
a pretty dodgy assumption anyway.. but better than nothing.

Hamish