[GRASS-user] WMS fails on Geosciences Australia downloads

Hamish hamish_b at yahoo.com
Wed May 14 03:56:13 EDT 2008


Richard Chirgwin wrote:
> I am trying to access layers on the Geosciences Australia
> OGC Web Map server:
http://www.ga.gov.au/wms/getmap?dataset=national&request=getCapabilities
.....
Hamish:
> I'll be kind and say GRASS because /technically/ the other end conforms
> to the WMS spec. The problem was that the other end does not accept
> queries in the form of HTTP POST data.
[r.in.wms -g flag added to deal with that; this works:]
> r.in.wms -l -g mapserv="http://www.ga.gov.au/wms/getmap?dataset=national&"
>
> # search for Gold:
> r.in.wms mapserv="http://www.ga.gov.au/wms/getmap?dataset=national&" \
>   -g layers=au_occdd output=au_gold format=tiff
....
> ps- sorry if this email is wrapping at about char 90, yahoo as upgraded
> their system & removed the "wrap at 72" compose setting, I suppose to
> make things simpler for us.
[I hope to get back to using fetchyahoo.pl+cron and a sane client soon]

Richard:
> I didn't notice the mail wrapping issue ...

yours is missing newlines- even worse!  :)
(hint: don't post as HTML/rich formatted)


> Thanks for all your efforts. There's still something strange at the
> Geosciences Australia end; I have repeated your test with the Gold
> layer (success). But other layers show errors like "wms_roads__0.png
> not recognised as a supported file format".

if you look in that file you will see text not an image:
<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
<!DOCTYPE ServiceExceptionReport SYSTEM "http://schemas.opengeospatial.net/wms/1.1.1/exception_1_1_1.dtd">
<ServiceExceptionReport version="1.1.1">
<ServiceException code="InvalidSRS">
msWMSLoadGetMapParams(): WMS server error. Invalid SRS given : SRS must be valid for all requested layers.
</ServiceException>
</ServiceExceptionReport>


be sure to delete those old files from $GISDBASE/wms_downloads/ or they will be cached and it'll try to reuse them. ('r.in.wms -c' helps)


'r.in.wms -l' and  http://www.ga.gov.au/map/broker/wms_info.php state that the roads layer is in EPSG:3112, so you need to provide that on the command line:

# from a latlon/wgs84 location
g.region n=9S s=46S w=112E e=155E res=0:01 -p
r.in.wms mapserv="http://www.ga.gov.au/wms/getmap?dataset=national&" \
  -g layers=roads output=au_roads format=tiff srs=EPSG:3112



> So the server would have to be considered "a little flaky" on a good day.

naw, blame r.in.wms. the server is limited in what it will provide and r.in.wms is not handling the error messages well. (the error can come in the form of a web page, XML, or empty output, and success is a real image, so it is hard to pick how to recognize and pass on the error)


devs: One problem is that I don't know how to test for r.in.gdalwarp's exit code. it is called from r.in.wms with eval- the exit code returned is eval's not r.in.gdalwarp's.



> The tiles download okay - the directory shows files with .wget, .png
> (or tiff or whatever), .proj4 and .tfw formats, so I guess something is
> breaking / broken in the files GA is sending.

no, open the tile in a text editor and see



with the extra "srs=EPSG:3112" on the command line I could download the roads layer and it looks good.



Hamish



      



More information about the grass-user mailing list