[GRASS-dev] wms in wxgrass?

In the Python wiki is mentioned that grass users can or maybe could eventually display wms maps in there. Is that only a prevision or is already implemented? My experience with wms maps in Grass is more than frustrating, I haven’t been able, so far, to import anything with r.in.wms but this is a separtate oddissey.

Agustin Diez Castillo wrote:

My experience with wms maps in Grass is more than frustrating, I
haven't been able, so far, to import anything with r.in.wms but this
is a separtate oddissey.

Could you try the r.in.wms in the new 6.2.2rc1 release? I hope we have
all the bugs and bashisms fixed now.

"LANDSAT from OnEarth server download" is a nice demo.

the r.in.onearth script from the wiki add-ons page is also very nice.

Hamish

Today, I have been able to use r.in.wms for the first time with some success, but only against the servers in the manual (Landsat works great). Others are giving me some errors beyond both my capabilities and their capabilities. The mapserver in the example works in QGis and others,

I can’t get even the capabilities
r.in.wms mapserver=http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx -l
List of layers for server
http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx:
–16:42:14-- http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx
=> `/Users/Shared/grassdata/Projecte/adiez2/.tmp/regadiuet.prearq.uv.es/14547.0capabilities.xml’
Resolving ovc.catastro.meh.es… 193.203.200.44
Connecting to ovc.catastro.meh.es[193.203.200.44]:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 316 [text/xml]

100%[=========================================================================================================================================================>] 316 --.–K/s

16:42:14 (3.01 MB/s) - `/Users/Shared/grassdata/Projecte/adiez2/.tmp/regadiuet.prearq.uv.es/14547.0capabilities.xml’ saved [316/316]

WARNING: xml2 NOT avaliable


The xml is not there or anywhere else


My frustrating results:

r.in.wms layers=Catastro mapserver=http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx output=Catastro
Calculating tiles
Requesting 2 tiles.
Downloading tiles
Downloading data
Requesting Data from
http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx:

request=GetMap&layers=Catastro&styles=&srs=EPSG:4326&bbox=-.58861800000000000000,38.63127700000000000000,-.35464634808259587021,38.82263078500707213578&width=680&height=709&format=image/geotiff&transparent=TRUE&version=1.1.1
16:33:00 URL:http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx [316/316] → “/Users/Shared/grassdata/wms_download/Catastro__0.geotiff” [1]
Downloading data
Requesting Data from
http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx:

request=GetMap&layers=Catastro&styles=&srs=EPSG:4326&bbox=-.35533450000000000000,38.63127700000000000000,-.12067469616519174042,38.82263078500707213578&width=680&height=709&format=image/geotiff&transparent=TRUE&version=1.1.1
16:33:01 URL:http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx [316/316] → “/Users/Shared/grassdata/wms_download/Catastro__1.geotiff” [1]
All tiles downloaded successfully
ERROR 4: `/Users/Shared/grassdata/wms_download/Catastro__0.geotiff’ not recognised as a supported file format.

ERROR 4: `/Users/Shared/grassdata/Projecte/adiez2/.tmp/regadiuet.prearq.uv.es/10778.0warped.geotiff’ does not exist in the file system,
and is not recognised as a supported dataset name.

ERROR 4: `/Users/Shared/grassdata/wms_download/Catastro__1.geotiff’ not recognised as a supported file format.

ERROR 4: `/Users/Shared/grassdata/Projecte/adiez2/.tmp/regadiuet.prearq.uv.es/10778.0warped.geotiff’ does not exist in the file system,
and is not recognised as a supported dataset name.


OK, I will try another another format


GRASS 6.3.cvs (Projecte):/Volumes/LaCieDisk/Users/Shared/src/grass6/doc/raster/r.example > r.in.wms layers=Catastro mapserver=http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx output=Catastro format=png
Calculating tiles
Requesting 2 tiles.
Downloading tiles
Downloading data
Requesting Data from
http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx:

request=GetMap&layers=Catastro&styles=&srs=EPSG:4326&bbox=-.58861800000000000000,38.63127700000000000000,-.35464634808259587021,38.82263078500707213578&width=680&height=709&format=image/png&transparent=TRUE&version=1.1.1
16:33:36 URL:http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx [316/316] → “/Users/Shared/grassdata/wms_download/Catastro__0.png” [1]
Downloading data
Requesting Data from
http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx:

request=GetMap&layers=Catastro&styles=&srs=EPSG:4326&bbox=-.35533450000000000000,38.63127700000000000000,-.12067469616519174042,38.82263078500707213578&width=680&height=709&format=image/png&transparent=TRUE&version=1.1.1
16:33:36 URL:http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx [316/316] → “/Users/Shared/grassdata/wms_download/Catastro__1.png” [1]
All tiles downloaded successfully
ERROR 4: `/Users/Shared/grassdata/wms_download/Catastro__0.png’ not recognised as a supported file format.

ERROR 4: `/Users/Shared/grassdata/Projecte/adiez2/.tmp/regadiuet.prearq.uv.es/13176.0warped.geotiff’ does not exist in the file system,
and is not recognised as a supported dataset name.

ERROR 4: `/Users/Shared/grassdata/wms_download/Catastro__1.png’ not recognised as a supported file format.

ERROR 4: `/Users/Shared/grassdata/Projecte/adiez2/.tmp/regadiuet.prearq.uv.es/13176.0warped.geotiff’ does not exist in the file system,
and is not recognised as a supported dataset name.


This happens to me with most of the wms server at http://www.sigua.ua.es/es/utilidades/phpwms/index.php that, otherwise, are working.

On May 30, 2007, at 3:58 PM, Hamish wrote:

Agustin Diez Castillo wrote:

My experience with wms maps in Grass is more than frustrating, I
haven’t been able, so far, to import anything with r.in.wms but this
is a separtate oddissey.

Could you try the r.in.wms in the new 6.2.2rc1 release? I hope we have
all the bugs and bashisms fixed now.

“LANDSAT from OnEarth server download” is a nice demo.

the r.in.onearth script from the wiki add-ons page is also very nice.

Hamish

HamishB wrote:

Agustin Diez Castillo wrote:

My experience with wms maps in Grass is more than frustrating, I
haven't been able, so far, to import anything with r.in.wms but this
is a separtate oddissey.

Could you try the r.in.wms in the new 6.2.2rc1 release? I hope we have
all the bugs and bashisms fixed now.

I have tried it in our new NC dataset location:
# list available layers
r.in.wms -l output=terraserver-drg \
        mapserver=http://terraserver.microsoft.com/ogccapabilities.ashx
# -> works

g.region rural_1m -p
r.in.wms output=terraserver-drg
mapserver=http://terraserver.microsoft.com/ogcmap6.ashx layers=DRG
region=rural_1m format=tiff wgetoptions="--user-agent=MSIE5.5"
Calculating tiles
Requesting 1 tiles.
Downloading tiles
Tile already downloaded
All tiles downloaded successfully
#################################
<html><head><title>OGCMap Test</title></head>
<body>
<h3>Service Exception Report</h3>
<p>Found 1 errors</p>
<br>Unable to parse EPSG code 3358
</body></html>

Any idea?
Markus
--
View this message in context: http://www.nabble.com/wms-in-wxgrass--tf3839786.html#a10877697
Sent from the Grass - Dev mailing list archive at Nabble.com.

Markus Neteler wrote:

I have tried it in our new NC dataset location:

..

g.region rural_1m -p
r.in.wms output=terraserver-drg
mapserver=http://terraserver.microsoft.com/ogcmap6.ashx
layers=DRG region=rural_1m format=tiff
wgetoptions="--user-agent=MSIE5.5" Calculating tiles

..

Requesting 1 tiles.
Downloading tiles
Tile already downloaded
All tiles downloaded successfully
#################################
<html><head><title>OGCMap Test</title></head>
<body>
<h3>Service Exception Report</h3>

vvv

<p>Found 1 errors</p>
<br>Unable to parse EPSG code 3358

^^^

</body></html>

Any idea?

- EPSG code 3358 isn't in my EPSG file. (proj 4.4.9) custom?
- the WMS server will be limited to the epsg codes it knows/allows.
- I haven't looked at r.in.wms closely, but I thought the r.in.gdal step
was there to do common <4326> WGS84 LL -> current projection?

Hamish

> Agustin Diez Castillo wrote:
>> Today, I have been able to use r.in.wms for the first time with
>some > success,
>
> good news!
>
>> Others are giving me some errors beyond both my capabilities
>> and their capabilities. The mapserver in the example works in QGis
>> and others,
>> I can't get even the capabilities
>> r.in.wms mapserver=http://ovc.catastro.meh.es/Cartografia/WMS/
>> ServidorWMS.aspx -l
>
> I have just made the error handling better in CVS, could you update
> and try once again?

I will update and keep checking.

> That shows the real error was:
> "Este servicio sirve para ser utilizado por programas de
> visualización de cartografía. No es una página web."
>
> you should see that now, both for the layers list and the broken
> download. Sorry, I can't help you with the server error itself.

It says that this service have been developed for cartographic
applications. This is not a web page. So the error is not help as far
as grass is the best cartogpraphic application I'm aware of and I'm
not looking for a web page.

I really don't know enough about WMS servers to answer.
The help page mentions adding "?" to the URL, but that doesn't help.

>> WARNING: xml2 NOT avaliable
I knew that, and I think it is there /Library/Frameworks/
libxml.framework/Versions/2.6.26/Resources/Scripts/xml2-config.
>
> xml2 is a program, it's not needed, but helps parse the XML better
> if it's there.
> http://ofb.net/~egnor/xml2/

xml2-config is something else, part of Gnome's libxml. It's needed to
compile xml2, but xml2 is something more.

$ apropos xml2-config
xml2-config (1) - script to get information about the installed
version of GNOME-XML

Hamish

Hamish wrote on 05/31/2007 08:21 AM:

Markus Neteler wrote:
  

I have tried it in our new NC dataset location:
    

..
  

g.region rural_1m -p
r.in.wms output=terraserver-drg
mapserver=http://terraserver.microsoft.com/ogcmap6.ashx
layers=DRG region=rural_1m format=tiff
wgetoptions="--user-agent=MSIE5.5" Calculating tiles
    

..
  

Requesting 1 tiles.
Downloading tiles
Tile already downloaded
All tiles downloaded successfully
#################################
<html><head><title>OGCMap Test</title></head>
<body>
<h3>Service Exception Report</h3>
    

vvv
  

<p>Found 1 errors</p>
<br>Unable to parse EPSG code 3358
    

^^^
  

</body></html>

Any idea?
    
- EPSG code 3358 isn't in my EPSG file. (proj 4.4.9) custom?
  

It should be there, at least it is in PROJ 4.5.0:

# NAD83(HARN) / North Carolina
<3358> +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334
+lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +ellps=GRS80 +units=m
+no_defs <>

- the WMS server will be limited to the epsg codes it knows/allows.
- I haven't looked at r.in.wms closely, but I thought the r.in.gdal step
was there to do common <4326> WGS84 LL -> current projection?

I dunno - the r.in.wms script is rather unreadable for me.

Markus

------------------
ITC -> dall'1 marzo 2007 Fondazione Bruno Kessler
ITC -> since 1 March 2007 Fondazione Bruno Kessler
------------------

same command I got a somewhat different error

All tiles downloaded successfully
#################################
r.in.gdalwarp -c ‘input=/Users/Shared/grassdata/wms_download/terraserver-drg_rural_1m_0.tiff’ ‘output=terraserver-drg’ ‘method=nearest’ ‘s_srs=EPSG:4326’
gdalwarp -s_srs “EPSG:4326” -t_srs “PROJCS[“Lambert Conformal Conic”,GEOGCS[“grs80”,DATUM[“North_American_Datum_1983”,SPHEROID[“grs80”,6378137,298.257222101]],PRIMEM[“Greenwich”,0],UNIT[“degree”,0.0174532925199433]],PROJECTION[“Lambert_Conformal_Conic_2SP”],PARAMETER[“standard_parallel_1”,34.33333333333334],PARAMETER[“standard_parallel_2”,36.16666666666666],PARAMETER[“latitude_of_origin”,33.75],PARAMETER[“central_meridian”,-79],PARAMETER[“false_easting”,609601.22],PARAMETER[“false_northing”,0],UNIT[“Meter”,1]]” “/Users/Shared/grassdata/wms_download/terraserver-drg_rural_1m_0.tiff” “/Users/Shared/grassdata/nc_spm_05/user1/.tmp/regadiuet.prearq.uv.es/16540.0warped.geotiff” -rn
ERROR 1: TIFFFetchDirectory:/Users/Shared/grassdata/wms_download/terraserver-drg_rural_1m_0.tiff: Can not read TIFF directory count
ERROR 1: TIFFReadDirectory:/Users/Shared/grassdata/wms_download/terraserver-drg_rural_1m_0.tiff: Failed to read directory at offset 0
ERROR 4: `/Users/Shared/grassdata/nc_spm_05/user1/.tmp/regadiuet.prearq.uv.es/16540.0warped.geotiff’ does not exist in the file system,
and is not recognised as a supported dataset name.

On May 31, 2007, at 11:56 AM, Markus Neteler wrote:

g.region rural_1m -p

r.in.wms output=terraserver-drg

mapserver=http://terraserver.microsoft.com/ogcmap6.ashx

layers=DRG region=rural_1m format=tiff

Requesting 1 tiles.
Downloading tiles
Tile already downloaded
All tiles downloaded successfully
#################################

OGCMap Test

Service Exception Report

vvv

Found 1 errors


Unable to parse EPSG code 3358

^^^

Any idea?

Agustin Diez Castillo wrote:

same command I got a somewhat different error

# skipped region setting
r.in.wms output=terraserver-drg mapserver=http://terraserver.microsoft.com/ogcmap6.ashx layers=DRG format=tiff

All tiles downloaded successfully
#################################
r.in.gdalwarp -c 'input=/Users/Shared/grassdata/wms_download/

..

ERROR 1: TIFFFetchDirectory:/Users/Shared/grassdata/wms_download/
terraserver-drg_rural_1m_0.tiff: Can not read TIFF directory count
ERROR 1: TIFFReadDirectory:/Users/Shared/grassdata/wms_download/
terraserver-drg_rural_1m_0.tiff: Failed to read directory at offset 0
ERROR 4: `/Users/Shared/grassdata/nc_spm_05/user1/.tmp/
regadiuet.prearq.uv.es/16540.0warped.geotiff' does not exist in the
file system,
and is not recognised as a supported dataset name.

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.

$ gdalinfo wms_download/terraserver-drg__0.tiff
ERROR 1: TIFFReadDirectory:wms_download/terraserver-drg__0.tiff: Can not read TIFF directory count
GDALOpen failed - 1
TIFFReadDirectory:wms_download/terraserver-drg__0.tiff: Can not read TIFF directory count

Hamish

Hi,

Trying r.in.wms and it asks install "bc"
it is not in the dependency list, isn't it?

Yann