Aftermath...
I had to change some strings to make v.breach work on GRASS 6.4svn
revision 39873, Ubuntu/Debian 9.10.
Luís Ferreira
-------------------------------------
line 310
v.parallel input="${OUTP}_grid_addcat_bnd_patch_break_ln_2l_tmp_${UNQ}"
output="${OUTP}_segm_2l_r_tmp_${UNQ}" distance=0.00001 --o > /dev/null
and
line 312
v.parallel input="${OUTP}_grid_addcat_bnd_patch_break_ln_2l_tmp_${UNQ}"
output="${OUTP}_segm_2l_l_tmp_${UNQ}" distance=-0.00001 --o > /dev/null
change to
v.parallel
input="${OUTP}_grid_addcat_bnd_patch_break_ln_2l_tmp_${UNQ}"
output="${OUTP}_segm_2l_r_tmp_${UNQ}" side=right distance=0.00001 --o
/dev/null
v.parallel
input="${OUTP}_grid_addcat_bnd_patch_break_ln_2l_tmp_${UNQ}"
output="${OUTP}_segm_2l_l_tmp_${UNQ}" side=left distance=0.00001 --o
/dev/null
------------------------------------------
line 388
v.db.addcol map="${OUTP}" layer=2 'columns=x double, y double, z double,
z_breach double' > /dev/null
change to
v.db.addcol map="${OUTP}" layer=2
'columns=x double precision, y double
precision, z double precision, z_breach
double precision' > /dev/null
-------------------------------------------
line 474
db.execute input=$TMP.${PROG}.sql database=$dbs driver=$drv > /dev/null
change to
db.execute input=$TMP.${PROG}.sql database=${database}
driver=
${driver} > /dev/null
-------------------------------------------
change $tbl to $table
------------------------------------------
v.clean tool=prune
defaulting to treshold=0.0
------------------------------------------
line 464
change to
table=`v.db.connect -g "${OUTP}" | awk '{print $2}'`
database=`v.db.connect -g "${OUTP}" | awk '{print $4}'`
driver=`v.db.connect -g "${OUTP}" | awk '{print $5}'`
----------------------------------------
make explicit field separator for awk
awk -F "|"
On Wed, 2009-12-02 at 21:35 +0100, Maciej Sieczka wrote:
Luís Ferreira pisze:
> I want to make a hydrological corrected DEM, using v.surf.rst for
> interpolation/aproximation and v.breach to introduce aditional
> elevation points at streams.
>
> My spatial reference system is EPSG:3763 ETRS89 / Portugal TM06,
> (metrical).
>
> As required in v.breach document: - each input vect line have a
> unique category in layer 1; - input lines not cross themselves; -
> input lines not constitute loops; - the input vector lines not stand
> out of the input raster DEM; - the input lines direction is from
> upstream to downstream.
>
> After creating a DEM using v.surf.rst I want to correct the false
> sinks in narrow valleys and sparse points areas. Using v.breach I
> have as result two output vectors for streams lines and points but
> without entities or attributes. I tried with both PostgreSQL and
> Sqlite database connections.
>
> For PostgreSQL connection:
>
> DBMI-Postgres driver error: Cannot select: SELECT cat,lcat,z,z_breach
> FROM topografia.vbreachpoints_2 ERROR: column "z" does not exist
> LINE 1: SELECT cat,lcat,z,z_breach FROM topografia.vbreachpoints_2 ^
> Unable to open select cursor: 'SELECT cat,lcat,z,z_breach FROM
> topografia.vbreachpoints_2' Copy table failed Table <vbreach_2> does
> not exist in database <host=localhost,dbname=grass_pp_muda_pttm06>
> The table <vbreach_2> is now part of vector map <vbreach> and may be
> deleted or overwritten by GRASS modules DBMI-Postgres driver error:
> Cannot create index: create unique index vbreach_2_cat on vbreach_2
> ( cat ) ERROR: relation "vbreach_2" does not exist Cannot create
> index DBMI-Postgres driver error: Cannot grant on table: grant select
> on vbreach_2 to public ERROR: relation "vbreach_2" does not exist
> Cannot grant privileges on table vbreach_2 Select privileges were
> granted on the table
>
> Any ideas? If wanted I'll send the files needed for replication.
Luís,
Glad to see someone trying to use my stuff :).
What GRASS version do you use? What OS? What was your command line, exactly?
Maybe the culprit is the DB backend. I have never used the script with
anything else than DBF. Try to switch to DBF in GRASS (db.connect). Or a
GRASS version "too new". I think I used it only against 6.3. There
*might* have been changes to underlying GRASS modules.
I've written the script, and used it the last time, about 2 years ago.
It did the job fine then. I don't have a personal interest in developing
it at the moment. I could provide you a commercial support if you like.
That would include testing the script against your data, in a GRASS
setup similar to yours, and fixing the tool if necessary.
Please contact me in priv if you are interested. I don't charge much :).
Or, if there's a GRASS hacker willing to do it for free - please go
ahead, anybody.
Best,
Maciek
(attachments)
v.breach_changed (20.5 KB)