r.in.wms2: should this work on GRASS 6.4.3RC3?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

r.in.wms2: should this work on GRASS 6.4.3RC3?

RichardCooper
Hi,

I've installed r.in.wms2 into GRASS 6.4.3RC3, but I cannot import a layer.

Here are two examples of output (using different drivers):

r.in.wms2.py url=http://neowms.sci.gsfc.nasa.gov/wms/wms? layers=MOD14A1_E_FIRE output=MOD14A1_E_FIRE maxcols=398

ERROR: value <WMS_GRASS> out of range for parameter <driver>
       Legal range: WMS_GDAL, WMS_GRASS, WMTS_GRASS,
OnEarth_GRASS
Description:
 Downloads and imports data from WMS servers.
Keywords:
 wms
Usage:
 r.in.wms2.py [-oc] url=string layers=string[,string,...]
output=name
   [srs=value] [region=string] [wms_version=string]
[format=string]
   [method=string] [maxcols=value] [maxrows=value]
[urlparams=string]
   [username=string] [password=string]
[styles=string[,string,...]]
   [bgcolor=string] [driver=string] [capfile=name]
[capfile_output=name]
   [--overwrite] [--verbose] [--quiet]
Flags:
  -o   Don't request transparent data
  -c   Get capabilities
 --o   Allow output files to overwrite existing files
 --v   Verbose module output
 --q   Quiet module output
Parameters:
             url   URL of WMS server
          layers   Layers to request from map server
          output   Name for output raster map
             srs   EPSG number of source projection for
request
                   default: 4326
          region   Named region to request data for. Current
region used if omitted
     wms_version   WMS standard
                   options: 1.1.1,1.3.0
                   default: 1.1.1
          format   Image format requested from the server
                   options: geotiff,tiff,jpeg,gif,png
                   default: geotiff
          method   Reprojection method to use
                   options: near,bilinear,cubic,cubicspline
                   default: near
         maxcols   Maximum columns to request at a time
                   default: 400
         maxrows   Maximum rows to request at a time
                   default: 300
       urlparams   Additional query parameters for server
        username   Username for server connection
        password   Password for server connection
          styles   Styles to request from map server
         bgcolor   Color of map background
          driver   Driver for communication with server
                   options: WMS_GDAL, WMS_GRASS, WMTS_GRASS,
OnEarth_GRASS
                   default: WMS_GRASS
         capfile   Capabilities file (input)
  capfile_output   File where capabilities will be saved
(only with 'c' flag).


2.
r.in.wms2.py url=http://neowms.sci.gsfc.nasa.gov/wms/wms? layers=MOD14A1_E_FIRE output=MOD14A1_E_FIRE maxcols=398 driver=WMS_GDAL
Traceback (most recent call last):
  File "/home/rcooper/.grass6/addons/r.in.wms2.py", line
230, in <module>
    sys.exit(main())
  File "/home/rcooper/.grass6/addons/r.in.wms2.py", line
213, in main
    from wms_gdal_drv import WMSGdalDrv
ImportError: No module named wms_gdal_drv



Any ideas how I should proceed. Will also test on GRASS 7.


Cheers,
Richard

Linux Mint 13 (ubuntu Precise)
Reply | Threaded
Open this post in threaded view
|

Re: r.in.wms2: should this work on GRASS 6.4.3RC3?

Martin Landa
Hi,

2013/7/1 RichardC <[hidden email]>:
> I've installed r.in.wms2 into GRASS 6.4.3RC3, but I cannot import a layer.

unfortunately `r.in.wms2` is broken (GRASS 6 Addons). Some fixes are
needed (issues are related to the differences between GRASS 6 and
GRASS 7 building system). It could be one of tasks for GRASS Community
Sprint (cc'ed original author).

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: r.in.wms2: should this work on GRASS 6.4.3RC3?

hamish-2
In reply to this post by RichardCooper
Richard wrote:

> I've installed r.in.wms2 into GRASS 6.4.3RC3, but I cannot
> import a layer.

It's not working yet.
  https://trac.osgeo.org/grass/ticket/2010

Is the original r.in.wms also not working for you, or did you just
want to try out the new & improved version?


regards,
Hamish

_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: r.in.wms2: should this work on GRASS 6.4.3RC3?

RichardCooper
This post was updated on .
>Is the original r.in.wms also not working for you, or did you just want to try out the new & improved version?

Unfortunately I cannot get it to work. For example, attempting to connect to the following URL gives the following error:

http://neowms.sci.gsfc.nasa.gov/wms/wms?

Traceback (most recent call last):
  File
"/usr/lib/grass64/etc/wxpython/modules/ogc_services.py",
line 196, in OnConnect

if 'style' not in layers[lastLayer]:
KeyError
:
''


I tested the URL in QGIS and the server is active.
Reply | Threaded
Open this post in threaded view
|

Re: r.in.wms2: should this work on GRASS 6.4.3RC3?

hamish-2
Hamish:

>> Is the original r.in.wms also not working for you, or did
>> you just want to try out the new & improved version?

Richard:

> Unfortunately I cannot get it to work. For example, attempting
> to connect to the following URL gives the following error on
> attempting to connect:
>
> http://neowms.sci.gsfc.nasa.gov/wms/wms?
>
> Traceback (most recent call last):
>   File
> "/usr/lib/grass64/etc/wxpython/modules/ogc_services.py",
> line 196, in OnConnect
>
> if 'style' not in layers[lastLayer]:
> KeyError
> :
> ''
>
> I tested the URL in QGIS and the server is active.

that's an error in the 6.4 wxGUI front-end. Can you try to build
the latest 6.4.3svn from source and see if it still breaks?
(the old version did not gracefully handle the `xml2` parser
program being missing, but now it tells you about it in an error
message instead of failing with the traceback)

But I'm wondering if the r.in.wms(.sh) shell script that comes
default with GRASS 6.4.svn is working for you or not. It works
for me from the 6.4 command line (nicer with xml2 installed),

  r.in.wms -l maps="http://neowms.sci.gsfc.nasa.gov/wms/wms?" out=dummy

note you'll get an error message at the start since their server
doesn't support http POST, but it automatically fails-over to the
GET method and tries again. you could use the -g flag for that:
  -g   Use GET method instead of POST data method
        This may be needed to connect to servers which lack POST capability
and avoid the warning/save one second or two.

and/or install `xml2` and the GUI version should start working.


regards,
Hamish

_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: r.in.wms2: should this work on GRASS 6.4.3RC3?

hamish-2
> Richard:

>>  Unfortunately I cannot get it to work. For example, attempting
>>  to connect to the following URL gives the following error on
>>  attempting to connect:
>>
>>  http://neowms.sci.gsfc.nasa.gov/wms/wms?
>>
>>  Traceback (most recent call last):
>>    File
>>  "/usr/lib/grass64/etc/wxpython/modules/ogc_services.py",
>>  line 196, in OnConnect
>>
>>  if 'style' not in layers[lastLayer]:
>>  KeyError
>>  :
>>  ''
...
> that's an error in the 6.4 wxGUI front-end. Can you try to build
> the latest 6.4.3svn from source and see if it still breaks?
> (the old version did not gracefully handle the `xml2` parser
> program being missing, but now it tells you about it in an error
> message instead of failing with the traceback)

I believe the above error is from a missing `xml2`, but there is
another trouble with the module after that, that WMS server returns
subsection Titles (e.g. "the next 4 layers are about ozone, and
some explanation about what it is"), which is confusing the
ogc_services.py parser which expects only Titles subordinate to
and following Layers. Even after testing to see if the layer is
set it still gets out of order as the subsection Title overwrites
the layer's title before the next Layer is created.

I'll open a bug for that.

But the r.in.wms script from the command line should still work.


Hamish

_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: r.in.wms2: should this work on GRASS 6.4.3RC3?

NikosAlexandris
In reply to this post by hamish-2
Hamish:

> >> Is the original r.in.wms also not working for you, or did
> >> you just want to try out the new & improved version?


Richard:

> > Unfortunately I cannot get it to work. For example, attempting
> > to connect to the following URL gives the following error on
> > attempting to connect:

> > http://neowms.sci.gsfc.nasa.gov/wms/wms?

> > Traceback (most recent call last):
> >   File
> > "/usr/lib/grass64/etc/wxpython/modules/ogc_services.py",
> > line 196, in OnConnect

> > if 'style' not in layers[lastLayer]:
> > KeyError
 
> > ''
 
> > I tested the URL in QGIS and the server is active.


Hamish wrote:
 
> that's an error in the 6.4 wxGUI front-end. Can you try to build
> the latest 6.4.3svn from source and see if it still breaks?
> (the old version did not gracefully handle the `xml2` parser
> program being missing, but now it tells you about it in an error
> message instead of failing with the traceback)

The command below (in GRASS 6.4.3svn, Revision: 50937) responds:

WARNING: The 'xml2' program was not found. Proceeding with internal XML
         parsing which may not be as reliable.

> But I'm wondering if the r.in.wms(.sh) shell script that comes
> default with GRASS 6.4.svn is working for you or not. It works
> for me from the 6.4 command line (nicer with xml2 installed),
>
>   r.in.wms -l maps="http://neowms.sci.gsfc.nasa.gov/wms/wms?" out=dummy

See above -- Can't find which is package to be installed in openSUSE 12.3 yet.

Nikos

> note you'll get an error message at the start since their server
> doesn't support http POST, but it automatically fails-over to the
> GET method and tries again. you could use the -g flag for that:
>   -g   Use GET method instead of POST data method
>         This may be needed to connect to servers which lack POST capability
> and avoid the warning/save one second or two.
>
> and/or install `xml2` and the GUI version should start working.
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: r.in.wms2: should this work on GRASS 6.4.3RC3?

RichardCooper
In reply to this post by hamish-2
I installed xml2 and can now partially run r.in.wms from the Command console, but it appears to get stuck calculating tiles:

r.in.wms output=MOD_LSTD_CLIM_E mapserver=http://neowms.sci.gsfc.nasa.gov/wms/wms? layers=MOD_LSTD_CLIM_E format=geotiff maxcols=1024 maxrows=1024 method=nearest
Calculating tiles

I can see a  0 byte file in the LOCATION's .tmp directory.


In GRASS7 I can download the capabilities document, but not any layer, running from GRASS' Command console in the Layer Manager.

This outputs the capability document: r.in.wms -c url=http://neowms.sci.gsfc.nasa.gov/wms/wms?

The following gives an error:

r.in.wms url=http://neowms.sci.gsfc.nasa.gov/wms/wms? layers=MOD_LSTD_CLIM_E output=MOD_LSTD_CLIM_E
Downloading data from WMS server...
ERROR: Unable to fetch data from: 'http://neowms.sci.gsfc.nasa.gov/wms/wms?&'

Reply | Threaded
Open this post in threaded view
|

Re: r.in.wms2: should this work on GRASS 6.4.3RC3?

hamish-2
Richard:

> I installed xml2 and can now partially run r.in.wms from
> the Command console,
> but it appears to get stuck calculating tiles:
>
> r.in.wms output=MOD_LSTD_CLIM_E
> mapserver=http://neowms.sci.gsfc.nasa.gov/wms/wms? layers=MOD_LSTD_CLIM_E
> format=geotiff maxcols=1024 maxrows=1024 method=nearest
> Calculating tiles
>
> I can see a  0 byte file in the LOCATION's .tmp directory.

also look in &/or clear out files in ~/grassdata/wms_download/.
For me the instead of a PNG image the file actually contains
WMS XML capabilities with little indication of what was wrong
that I could see. for debug you get a .wget file in the
wms_download/ cache directory with the tile's raw download
command.

it's quite frustrating to support WMS, every WMS server likes
to respond to query failures in its own different and unique
way.


> In GRASS7 I can download the capabilities document, but not
> any layer, running from GRASS' Command console in the Layer
> Manager.

fwiw in qgis 1.8.0 I could get that server to return data, but
something wasn't quite right with the positioning.

I believe the grass 7 version lets you try a number of different
methods? maybe more luck with something other than the default.


Hamish

_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: r.in.wms2: should this work on GRASS 6.4.3RC3?

hamish-2
In reply to this post by NikosAlexandris
Nikos:
> See above -- Can't find which is package to be installed in openSUSE
> 12.3 yet.


no idea, in Debian/Ubuntu-land it's in the xml2 package.

it's a series of small CLI programs, so easy to build from source
if needed,
http://ftp.de.debian.org/debian/pool/main/x/xml2/xml2_0.4.orig.tar.gz

but it's kinda common, so I'd be surprised if there wasn't a
rpm for it somewhere..


Hamish
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: r.in.wms2: should this work on GRASS 6.4.3RC3?

Štěpán Turek
In reply to this post by RichardCooper
Hi Richard,

Please in G7 try:
r.in.wms url=http://neowms.sci.gsfc.nasa.gov/wms/wms layers=MOD_LSTD_CLIM_E output=MOD_LSTD_CLIM_E format=png

Implicitly format is set to geotiff, however this server does not provide it. 

Also you can try WMS in WxGUI [1] in G7, there you get only options which server supports. After r56978 G7 should also support CRS:84 projection code, which the server uses for WMS 1.3.0.

Best,
Stepan


---------- Původní zpráva ----------
Od: RichardC <[hidden email]>
Datum: 2. 7. 2013
Předmět: Re: [GRASS-user] r.in.wms2: should this work on GRASS 6.4.3RC3?


I installed xml2 and can now partially run r.in.wms from the Command console,
but it appears to get stuck calculating tiles:

r.in.wms output=MOD_LSTD_CLIM_E
mapserver=http://neowms.sci.gsfc.nasa.gov/wms/wms? layers=MOD_LSTD_CLIM_E
format=geotiff maxcols=1024 maxrows=1024 method=nearest
Calculating tiles

I can see a 0 byte file in the LOCATION's .tmp directory.


In GRASS7 I can download the capabilities document, but not any layer,
running from GRASS' Command console in the Layer Manager.

This outputs the capability document: r.in.wms -c
url=http://neowms.sci.gsfc.nasa.gov/wms/wms?

The following gives an error:

r.in.wms url=http://neowms.sci.gsfc.nasa.gov/wms/wms? layers=MOD_LSTD_CLIM_E
output=MOD_LSTD_CLIM_E
Downloading data from WMS server...
ERROR: Unable to fetch data from:
'http://neowms.sci.gsfc.nasa.gov/wms/wms?&'





--
View this message in context: http://osgeo-org.1560.x6.nabble.com/r-in-wms2-should-this-work-on-GRASS-6-4-3RC3-tp5063334p5063479.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user

_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: r.in.wms2: should this work on GRASS 6.4.3RC3?

hamish-2
> Subject: Re: [GRASS-user] r.in.wms2: should this work on GRASS 6.4.3RC3?


Hi,

I've updated r.in.wms2 in grass 6 addons, you might try again with that.
(note neither version of g.extension working right now, you need to do a svn checkout and 'make MODULE_TOPDIR=$GISBASE' from the source dir)


I'm not sure what the trouble is with r.in.wms(.sh) in grass6.5 now, probably just something minor.



Hamish

_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user