[GRASS-user] problem with r.in.wms

I cannot get r.in.wms into getting me a wms layer imported. The projection settings match, the layer is avaible for the region. Am I doing something wrong?

Input:
r.in.wms -kp mapserver=http://wms.jpl.nasa.gov/wms.cgi output=bmng.wms.jul layers=BMNG styles=Jul

output:
wms.request -p 'folder=/home/mate/wms_download' 'prefix=wms.bmng.jul'\
'mapserver=http://wms.jpl.nasa.gov/wms.cgi’ 'layers=BMNG' 'styles=Jul' \
'srs=EPSG:4326' 'format=geotiff' 'wmsquery=version=1.1.1' 'maxcols=1024'\
'maxrows=1024'
###############################
Calculating tiles
###############################
/usr/lib/grass/etc/r.in.wms//wms.request: 326: SIZE_ARRAY[0]=: not found
/usr/lib/grass/scripts/r.tileset: 193: declare: not found
/usr/lib/grass/scripts/r.tileset: 258: Syntax error: Bad for loop variable
###################################
Requesting 0 tiles!
###################################
wms.download 'requestfile=/home/mate/wms_download/wms.bmng.jul_.wget' 'wgetoptions=-c -t 5 --user-agent=MSIE5.5'
###############################
Downloading tiles
###############################
#################################
All tiles downloaded successfully
#################################
r.in.gdalwarp -c -k -p 'output=wms.bmng.jul' 'method=nearest' 's_srs=EPSG:4326'

ERROR: Required parameter <input> not set:
    (Raster file or files to be imported. If multiple files are specified they will be patched together.).

--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

"MK" == Maximilian Krambach <Maximilian.Krambach@gmx.de> writes:

[...]

> /usr/lib/grass/etc/r.in.wms//wms.request: 326: SIZE_ARRAY[0]=: not found
> /usr/lib/grass/scripts/r.tileset: 193: declare: not found
> /usr/lib/grass/scripts/r.tileset: 258: Syntax error: Bad for loop variable

        Looks like a sh/dash/bash problem? What's the first line of
        /usr/lib/grass/scripts/r.tileset? E. g.:

$ head -n1 /usr/lib/grass/scripts/r.tileset

[...]

        Looks like a sh/dash/bash problem? What's the first line of
        /usr/lib/grass/scripts/r.tileset? E. g.:

$ head -n1 /usr/lib/grass/scripts/r.tileset

[...]

First line is
#!/bin/sh

193 is part of
# purpose: lookup values in passed by reference arrays
declare -f LookupP # Function "Pointer"

258 is part of
# name: project
# purpose: projects x1 y1 using projector

326 is part of
# name: Side Length
# purpose: Find the length of sides of a set of points from one to the next

btw: installation is 6.2.1 from Jachym's ubuntu repository (les-ejk.cz)
--
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail

"MK" == Maximilian Krambach <Maximilian.Krambach@gmx.de> writes:

>> Looks like a sh/dash/bash problem? What's the first line of
>> /usr/lib/grass/scripts/r.tileset? E. g.:

>> $ head -n1 /usr/lib/grass/scripts/r.tileset

>> [...]

MK> First line is #!/bin/sh

        I guess it needs to be changed to #!/bin/bash (and you're to
        have Bash installed, of course.)

MK> 193 is part of

MK> # purpose: lookup values in passed by reference arrays
MK> declare -f LookupP # Function "Pointer"

        There's a `declare' command in Bash, but not in POSIX shell, nor
        in Dash.

[...]

MK> btw: installation is 6.2.1 from Jachym's ubuntu repository
MK> (les-ejk.cz)

        IIRC, Ubuntu uses Dash for /bin/sh by default.

Sorry if I go off topic, but wouldn't be r.in.wms a good example to re write it (almost) fully in python? So you could get rid of many dependencies and make grass more portable. I did not completely understood in the scripts the use of r.tileset and gdalwarp but I had only a short look at the script till now. It is only a suggestion, and there is still a lot to learn for me regarding programming at all and programming for grass in specific.

Ivan Shmakov schrieb:

"MK" == Maximilian Krambach <Maximilian.Krambach@gmx.de> writes:

>> Looks like a sh/dash/bash problem? What's the first line of
>> /usr/lib/grass/scripts/r.tileset? E. g.:

>> $ head -n1 /usr/lib/grass/scripts/r.tileset

>> [...]

MK> First line is #!/bin/sh

       I guess it needs to be changed to #!/bin/bash (and you're to
       have Bash installed, of course.)

MK> 193 is part of

MK> # purpose: lookup values in passed by reference arrays
MK> declare -f LookupP # Function "Pointer"

       There's a `declare' command in Bash, but not in POSIX shell, nor
       in Dash.

[...]

MK> btw: installation is 6.2.1 from Jachym's ubuntu repository
MK> (les-ejk.cz)

       IIRC, Ubuntu uses Dash for /bin/sh by default.

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

Maximilian Krambach wrote:

I cannot get r.in.wms into getting me a wms layer imported. The
projection settings match, the layer is avaible for the region. Am I
doing something wrong?

..

btw: installation is 6.2.1 from Jachym's ubuntu repository
(les-ejk.cz)

Please try with GRASS 6.2.2rc1 if you can. I believe this is fixed
there, as well as many other fixes for the script.

see the DRAFT release announcement in CVS:
  http://freegis.org/cgi-bin/viewcvs.cgi/*checkout*/web/announces/announce_grass622.html?rev=HEAD

"This release is particularly important for Ubuntu users due to a number
of Bourne shell script fixes."

Agustin Diez Castillo wrote:

This issue have been discussed on the dev-list without solution as far
as I can say.

No, AFAIK it should be solved & working now in CVS.
(maybe we worked through that off-list or in the bug tracker)

same here, downloaded TIFF contains junk: (903K binary file)

$ tiffinfo wms_download/terraserver-drg__0.tiff
TIFFReadDirectory: wms_download/terraserver-drg__0.tiff: Can not read
TIFF directory count.

this should be fixed too.

Ivan Shmakov wrote:

IIRC, Ubuntu uses Dash for /bin/sh by default.

Yes, that was the main part of the problem, r.in.wms and friends had
many bashisms. 6.2.2 should be bashism-free (hopefully we found them
all!).

WolfgangZ wrote:

Sorry if I go off topic, but wouldn't be r.in.wms a good example to re
write it (almost) fully in python?

Yes, absolutely.

please do report any problems found in the latest CVS versions,

Hamish

"H" == Hamish <hamish_nospam@yahoo.com> writes:

H> WolfgangZ wrote:

>> Sorry if I go off topic, but wouldn't be r.in.wms a good example to
>> re write it (almost) fully in python?

H> Yes, absolutely.

        Are there reasons to favor Python for GRASS scripts over, say,
        Tcl, Scheme, Common Lisp, or Perl?

[...]

wms

My machine:
Model Name: iMac
Model Identifier: iMac5,1
Processor Name: Intel Core 2 Duo
Processor Speed: 2 GHz
Number Of Processors: 1
Total Number Of Cores: 2
L2 Cache (per processor): 4 MB
Memory: 2 GB
Bus Speed: 667 MHz
Boot ROM Version: IM51.0090.B03
SMC Version: 1.8f2

My history with wms:
If I try r.in.wms mapserver=http://wms.jpl.nasa.gov/wms.cgi -l it works fine, but if I try other servers see below (those servers work fine in qgis, gvsig, web applets and everywhere but grass):

r.in.wms mapserver=http://wms.mapa.es/wms/wms.aspx? -l
List of layers for server http://wms.mapa.es/wms/wms.aspx?:
14:13:47 URL:http://wms.mapa.es/wms/wms.aspx? [492/492] → “/Users/Shared/grassdata/Projecte/adiez2/.tmp/regadiuet.prearq.uv.es/2523.0capabilities.xml” [1]
WARNING: xml2 NOT avaliable

ERROR: Parsing XML file

Untitled Page
************************************** r.in.wms mapserver=[http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?](http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?) -l List of layers for server [http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?](http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?): 14:20:28 URL:[http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?](http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?) [316/316] -> "/Users/Shared/grassdata/Projecte/adiez2/.tmp/regadiuet.prearq.uv.es/2641.0capabilities.xml" [1] WARNING: xml2 NOT avaliable

ERROR: Parsing XML file

<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?> [my translation: This service is used by cartographic display programs. This is not a web page] ******************************************** Even when things are little better and I can at least get the layers I find trouble:

r.in.wms output=sigua ‘mapserver=http://www.sigua.ua.es/cgi-bin/mapserv4.2.1.exe?map=d:/carto/sigua/map/ogc.map&’ layers=fotografia srs=EPSG:23030 --o
Calculating tiles
Requesting 4 tiles.
Downloading tiles
Tile already downloaded
Tile already downloaded
Tile already downloaded
Tile already downloaded
All tiles downloaded successfully
ERROR 4: `/Users/Shared/grassdata/wms_download/sigua__0.geotiff’ not recognised as a supported file format.

I repeat all those servers work just fine in any other application.

Can somebody try any of those in linux and report?

On Jul 3, 2007, at 12:18 PM, Hamish wrote:

Maximilian Krambach wrote:

I cannot get r.in.wms into getting me a wms layer imported. The
projection settings match, the layer is avaible for the region. Am I
doing something wrong?

btw: installation is 6.2.1 from Jachym’s ubuntu repository
(les-ejk.cz)

Please try with GRASS 6.2.2rc1 if you can. I believe this is fixed
there, as well as many other fixes for the script.

see the DRAFT release announcement in CVS:
http://freegis.org/cgi-bin/viewcvs.cgi/checkout/web/announces/announce_grass622.html?rev=HEAD

“This release is particularly important for Ubuntu users due to a number
of Bourne shell script fixes.”

Agustin Diez Castillo wrote:

This issue have been discussed on the dev-list without solution as far
as I can say.

No, AFAIK it should be solved & working now in CVS.
(maybe we worked through that off-list or in the bug tracker)

same here, downloaded TIFF contains junk: (903K binary file)

$ tiffinfo wms_download/terraserver-drg__0.tiff
TIFFReadDirectory: wms_download/terraserver-drg__0.tiff: Can not read
TIFF directory count.

this should be fixed too.

Ivan Shmakov wrote:

IIRC, Ubuntu uses Dash for /bin/sh by default.

Yes, that was the main part of the problem, r.in.wms and friends had
many bashisms. 6.2.2 should be bashism-free (hopefully we found them
all!).

WolfgangZ wrote:

Sorry if I go off topic, but wouldn’t be r.in.wms a good example to re
write it (almost) fully in python?

Yes, absolutely.

please do report any problems found in the latest CVS versions,

Hamish

Ivan Shmakov wrote:

        Are there reasons to favor Python for GRASS scripts over, say,
        Tcl, Scheme, Common Lisp, or Perl?

Scheme/Lisp won't be installed on many systems, and Tcl and Perl both
have significant deficiencies as programming languages.

--
Glynn Clements <glynn@gclements.plus.com>

On 7/4/07 4:36 AM, "Glynn Clements" <glynn@gclements.plus.com> wrote:

Ivan Shmakov wrote:

        Are there reasons to favor Python for GRASS scripts over, say,
        Tcl, Scheme, Common Lisp, or Perl?

Scheme/Lisp won't be installed on many systems, and Tcl and Perl both
have significant deficiencies as programming languages.

Here are some other points

I can attest that Python is relatively easy to learn. It is a very powerful,
full-featured, object-oriented programming language. It is both easier to
program and much richer than BASH shell scripts.

It seems to be regularly updated and available on all common platforms with
current (2.5) or near current (2.4) versions.

It is pretty widely used in the sciences.

One of the leading GUI packages (wxWidgets) has been ported to Python
(wxPython)

GRASS with Python lets you do a LOT of things that can't easily be done (or
not done at all) with other GIS packages.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton