[GRASS5] r.in.wms

hallo
according to script r.in.onearth from Soeren Gebbert, I tryed to write
other script, which is on r.in.onearth based.

It should be able to work with nearly *every* WMS server, thought I
tested it only against two servers...

Is anybody interested for testing?

Jachym
--
Jachym Cepicky
e-mail: jachym.cepicky@centrum.cz
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/gnupg_public_key/
-----------------------------------------
OFFICE:
Department of Geoinformation Technologies
LDF MZLU v Brnì
Zemìdìlská 3
613 00 Brno
e-mail: xcepicky@node.mendelu.cz
URL: http://mapserver.mendelu.cz
Tel.: +420 545 134 514

(attachments)

r.in.wms.tgz (3.62 KB)

For every body, who is using this script: it could destroy your .* files! I'm really sorry, for annoucing this.

If the variable $IMAGEFILE is not set, the script could start to remove all '.*' files in current directory -- see line 67 of the script. It should not happen.
But it could, I'm not by the linux machine now, to test the conditions...

I'm working on new version, which is able to pool avaliable layers from the server first (GetCapabilities) and in this version, I will take more care about it.

If you are using the script, pleace, change the line 67 for example to

if [ "${IMAGEFILE}" != "" ]; then
          rm -iv ${IMAGEFILE}.*
fi

Sorry for this again, I'll take advice for me.

jachym

______________________________________________________________

Od: jachym.cepicky@centrum.cz
Komu: GRASS Developers list <grass5@grass.itc.it>
CC:
Datum: 12.01.2006 18:45
Pøedmìt: [GRASS5] r.in.wms

hallo
according to script r.in.onearth from Soeren Gebbert, I tryed to write
other script, which is on r.in.onearth based.

It should be able to work with nearly *every* WMS server, thought I
tested it only against two servers...

Is anybody interested for testing?

Jachym
--
Jachym Cepicky
e-mail: jachym.cepicky@centrum.cz
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/gnupg_public_key/
-----------------------------------------
OFFICE:
Department of Geoinformation Technologies
LDF MZLU v Brnì
Zemìdìlská 3
613 00 Brno
e-mail: xcepicky@node.mendelu.cz
URL: http://mapserver.mendelu.cz
Tel.: +420 545 134 514

For every body, who is using this script: it could destroy your .*
files! I'm really sorry, for annoucing this.

If the variable $IMAGEFILE is not set, the script could start to
remove all '.*' files in current directory -- see line 67 of the
script. It should not happen. But it could, I'm not by the linux
machine now, to test the conditions...

I'm working on new version, which is able to pool avaliable layers
from the server first (GetCapabilities) and in this version, I will
take more care about it.

If it is possible, it is good to create, cd, and install files into a TMP
grass directory using the g.tempfile module. This makes it harder to make
these sorts of mistakes and if the script is aborted any left over files
are automatically cleaned when you leave grass.

see the v.in.garmin and r.in.srtm scripts for examples.

If you are using the script, pleace, change the line 67 for example to

if [ "${IMAGEFILE}" != "" ]; then
          rm -iv ${IMAGEFILE}.*
fi

better for cross-platform portability:

if [ -n "${IMAGEFILE}" ]; then

(-n means non-zero, == "" is -z)

[SUBMITTING_SCRIPTS file updated in 6.1 CVS]

Hamish

Hallo,
I'm sending new version of r.in.wms. I added new option "-l" for listing
avaliable layers on the server (very primitive). I also made safer cleaning of temporary
files -- it should not harm any more ...

I hope, it will work on other servers -- it worked for two, which are
iteresting for me, very well.

I hope, this script is good start for basic support of WMS in GRASS.

If nobody will have any objections, I would add it to GRASS-Addons site.

Jachym

On Mon, Jan 16, 2006 at 04:00:46PM +1300, Hamish wrote:

> For every body, who is using this script: it could destroy your .*
> files! I'm really sorry, for annoucing this.
>
> If the variable $IMAGEFILE is not set, the script could start to
> remove all '.*' files in current directory -- see line 67 of the
> script. It should not happen. But it could, I'm not by the linux
> machine now, to test the conditions...
>
> I'm working on new version, which is able to pool avaliable layers
> from the server first (GetCapabilities) and in this version, I will
> take more care about it.

If it is possible, it is good to create, cd, and install files into a TMP
grass directory using the g.tempfile module. This makes it harder to make
these sorts of mistakes and if the script is aborted any left over files
are automatically cleaned when you leave grass.

see the v.in.garmin and r.in.srtm scripts for examples.

> If you are using the script, pleace, change the line 67 for example to
>
> if [ "${IMAGEFILE}" != "" ]; then
> rm -iv ${IMAGEFILE}.*
> fi

better for cross-platform portability:

if [ -n "${IMAGEFILE}" ]; then

(-n means non-zero, == "" is -z)

[SUBMITTING_SCRIPTS file updated in 6.1 CVS]

Hamish

_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5

--
Jachym Cepicky
e-mail: jachym.cepicky@centrum.cz
URL: http://les-ejk.cz

(attachments)

r.in.wms.tgz (3.85 KB)