[GRASS-user] wms import fail
Maris Nartiss
maris.gis at gmail.com
Sun Jun 24 09:53:26 PDT 2012
Hello,
the problem is that some layer names have non-latin (Estonian) letters
and current code is not ready to handle such cases. I can try to look
at the code later (have to test changes) (as soon as I will recover
from Jaanipaev).
Still Maaamet watermarks their WMS service, what could interfere with
any automatic analysis. Example here:
http://kaart.maaamet.ee/wms/alus?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&BBOX=658960.012556,6474081.356986,659242.751929,6474249.416589&SRS=EPSG:3301&WIDTH=1152&HEIGHT=685&LAYERS=of10000&STYLES=&FORMAT=image/png&DPI=109&TRANSPARENT=TRUE
Maris.
PS. As I spend some time in Tartu, I would like to know if there are
any other GRASSers in Tartu too as it would be fun to have a beer :)
2012/6/22 Andres Kuusk <andres at aai.ee>:
>
>
> Hi,
>
> I have also trouble with r.in.wms.
>
> Estonian Land Board has a WMS server http://kaart.maaamet.ee/wms/alus,
> projection of maps EPSG:3301.
>
> I am using GRASS-7.0.svn, r52182, openSUSE-11.4, linux 2.6.37.6-0.11-pae.
>
> In the graphical user interface wxGUI the connect to server returns error
> message:
>
> Traceback (most recent call last):
> File "/usr/local/grass-7.0.svn/scripts/r.in.wms", line 284, in <module>
> sys.exit(main())
> File "/usr/local/grass-7.0.svn/scripts/r.in.wms", line 228, in main
> list_layers()
> File "/usr/local/grass-7.0.svn/scripts/r.in.wms", line 223, in list_layers
> cap_xml.getLayers()
> File "/usr/local/grass-7.0.svn/etc/r.in.wms/wms_parse.py", line 78, in
> getLayers
> print " Title: " + ly['title']
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xf5' in position
> 10: ordinal not in range(128)
>
> However, I got the list of layers - two items. Now, if I select a layer
> (of10000 - ortofoto) and connect, I got the same error message again, and
> nothing happens.
>
>
> In the commandline in the xterm window where I started GRASS the results are
> different.
>
> % env
> TERM=xterm
> SHELL=/bin/tcsh
> LANG=en_US.utf8
> PYTHONSTARTUP=/etc/pythonstart
> HOME=/home/grass/CHRIS_LE/CHRIS
> MACHTYPE=i586
> GISBASE=/usr/local/grass-7.0.svn
> GRASS_VERSION=7.0.svn
> PYTHONPATH=/usr/local/grass-7.0.svn/etc/python
> GRASS_PAGER=more
> GRASS_WISH=wish
> GRASS_PYTHON=python
> GRASS_GNUPLOT=gnuplot -persist
> GRASS_PROJSHARE=/usr/local/share/proj
> GRASS_HTML_BROWSER=xdg-open
> GISDBASE=/home/grass
>
> % g.region -p
> projection: 99 (Lambert Conformal Conic)
> zone: 0
> datum: wgs84
> ellipsoid: a=6378137 es=0.006694380022900787
> north: 6468300
> south: 6468050
> west: 693060
> east: 693315
> nsres: 1
> ewres: 1
> rows: 250
> cols: 255
> cells: 63750
>
> % r.in.wms mapserver=http://kaart.maaamet.ee/wms/alus -l
> returns the long list of map layers, there is a layer
>
> LAYER: of10000
> Title: ORTOFOTO
> SRS: EPSG:3301
>
>
> I have tried all possible combinations of r.in.wms options.
>
> % r.in.wms output=p_orto mapserver=http://kaart.maaamet.ee/wms/alus
> layers=of10000 srs=EPSG:3301 format=tiff maxcols=255 maxrows=250 method=near
> --overwrite
> Calculating tiles...
> ERROR: r.tileset failed
>
> In the directory /home/grass/wms_download/ an empty directory p_orto was
> created.
>
> Adding the option -p results in a different error message:
>
> % r.in.wms -p output=p_orto mapserver=http://kaart.maaamet.ee/wms/alus
> layers=of10000 srs=EPSG:3301 format=tiff maxcols=255 maxrows=250 method=near
> --overwrite
> Traceback (most recent call last):
> File "/usr/local/grass-7.0.svn/scripts/r.in.wms", line 284, in <module>
> sys.exit(main())
> File "/usr/local/grass-7.0.svn/scripts/r.in.wms", line 245, in main
> request = wms_request.WMSRequest(flags, options)
> File "/usr/local/grass-7.0.svn/etc/r.in.wms/wms_request.py", line 28, in
> __init__
> self.__set_options()
> File "/usr/local/grass-7.0.svn/etc/r.in.wms/wms_request.py", line 40, in
> __set_options
> self.srs_scale = int(grass.parse_key_val(proj_srs['+to_meter']))
> NameError: global name 'proj_srs' is not defined
>
>
> The same error messages I get using r.in.wms options -c, -g, -a.
>
>
> Do I something wrong or is there some error in the r.in.wms ?
>
> The native reolution of the ortophoto at WMS server is 0.25 m, I guess.
> I tried the region resolution of 0.25, and missed maxcols and maxrows values
> in the commandline as well but no success.
> In February 2010 using some GRASS-6 version I could download small pices of
> ortophoto from this WMS server.
>
> Thanks for any assistance.
>
>
> Andres Kuusk
> Tartu Observatory, Estonia
> andres at aai.ee
>
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
More information about the grass-user
mailing list