[GRASS-user] r.in.wms and PCN webservices

Dear GRASS User
did anyone tried to use r.in.wms to get data from pcn[1] webservices?

I want to download aerial photo from this URL:
http://wms.pcn.minambiente.it/ogc?map=/ms_ogc/WMS_v1.3/raster/ortofoto_colore_06.map

if I run
r.in.wms -c
url=http://wms.pcn.minambiente.it/ogc?map=/ms_ogc/WMS_v1.3/raster/ortofoto_colore_06.map wms_version=1.3.0

it retries me an error.
below details.

<b>Warning</b>: ms_newMapObj(): [MapServer Error]: msLoadMap():
MS_DEFAULT_MAPFILE_PATTERN validation failed.
in <b>C:\ms4w\Apache\htdocs\wms_capabilities_v130.php</b> on line
<b>72</b><br />
<br />
<b>Warning</b>: ms_newMapObj(): [MapServer Error]: msEvalRegex():
String failed expression test.

in <b>C:\ms4w\Apache\htdocs\wms_capabilities_v130.php</b> on line
<b>72</b><br />
<br />
<b>Fatal error</b>: Uncaught exception 'MapScriptException' with
message 'Failed to open map file
&quot;/ms_ogc/WMS_v1.3/raster/ortofoto_colore_06.map?SERVICE=WMS&quot;'
in C:\ms4w\Apache\htdocs\wms_capabilities_v130.php:72

Stack trace:
#0 C:\ms4w\Apache\htdocs\wms_capabilities_v130.php(72):
ms_newMapObj('/ms_ogc/WMS_v1....')
#1 {main}
  thrown in <b>C:\ms4w\Apache\htdocs\wms_capabilities_v130.php</b> on
line <b>72</b><br />

[1] http://www.pcn.minambiente.it/PCNDYN/catalogowms.jsp
--

________________________________________________________________________
Ing. Pierluigi De Rosa (PhD)
Studio Associato GFOSSERVICES

Hi,

please try r56519. It should work now.

Best
Stepan

---------- Původní zpráva ----------
Od: Ing. Pierluigi De Rosa pierluigi.derosa@gfosservices.it
Datum: 31. 5. 2013
Předmět: [GRASS-user] r.in.wms and PCN webservices

Dear GRASS User
did anyone tried to use r.in.wms to get data from pcn[1] webservices?

I want to download aerial photo from this URL:
http://wms.pcn.minambiente.it/ogc?map=/ms_ogc/WMS_v1.3/raster/ortofoto_colore_06.map

if I run
r.in.wms -c
url=http://wms.pcn.minambiente.it/ogc?map=/ms_ogc/WMS_v1.3/raster/ortofoto_colore_06.map wms_version=1.3.0

it retries me an error.
below details.

Warning: ms_newMapObj(): [MapServer Error]: msLoadMap():
MS_DEFAULT_MAPFILE_PATTERN validation failed.
in C:\ms4w\Apache\htdocs\wms_capabilities_v130.php on line
72



Warning: ms_newMapObj(): [MapServer Error]: msEvalRegex():
String failed expression test.

in C:\ms4w\Apache\htdocs\wms_capabilities_v130.php on line
72



Fatal error: Uncaught exception ‘MapScriptException’ with
message ‘Failed to open map file
"/ms_ogc/WMS_v1.3/raster/ortofoto_colore_06.map?SERVICE=WMS"’
in C:\ms4w\Apache\htdocs\wms_capabilities_v130.php:72

Stack trace:
#0 C:\ms4w\Apache\htdocs\wms_capabilities_v130.php(72):
ms_newMapObj(‘/ms_ogc/WMS_v1…’)
#1 {main}
thrown in C:\ms4w\Apache\htdocs\wms_capabilities_v130.php on
line 72

[1] http://www.pcn.minambiente.it/PCNDYN/catalogowms.jsp


Ing. Pierluigi De Rosa (PhD)
Studio Associato GFOSSERVICES


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

=

Hi pierluigi

this should work in grass7 (don't know in grass 6.4) :

r.in.wms --overwrite output=tile1 url=http://wms.pcn.minambiente.it/ogc
urlparams="map=/ms_ogc/WMS_v1.3/raster/ortofoto_colore_06.map"
layers="OI.ORTOIMMAGINI.2006." srs=32633 format=jpeg maxcols=2000
maxrows=2000 method=near wms_version=1.3.0

please use "urlparams"

ciao

ivan

On Fri, 2013-05-31 at 14:11 +0200, Ing. Pierluigi De Rosa wrote:

Dear GRASS User
did anyone tried to use r.in.wms to get data from pcn[1] webservices?

I want to download aerial photo from this URL:
http://wms.pcn.minambiente.it/ogc?map=/ms_ogc/WMS_v1.3/raster/ortofoto_colore_06.map

if I run
r.in.wms -c
url=http://wms.pcn.minambiente.it/ogc?map=/ms_ogc/WMS_v1.3/raster/ortofoto_colore_06.map wms_version=1.3.0

it retries me an error.
below details.

<b>Warning</b>: ms_newMapObj(): [MapServer Error]: msLoadMap():
MS_DEFAULT_MAPFILE_PATTERN validation failed.
in <b>C:\ms4w\Apache\htdocs\wms_capabilities_v130.php</b> on line
<b>72</b><br />
<br />
<b>Warning</b>: ms_newMapObj(): [MapServer Error]: msEvalRegex():
String failed expression test.

in <b>C:\ms4w\Apache\htdocs\wms_capabilities_v130.php</b> on line
<b>72</b><br />
<br />
<b>Fatal error</b>: Uncaught exception 'MapScriptException' with
message 'Failed to open map file
&quot;/ms_ogc/WMS_v1.3/raster/ortofoto_colore_06.map?SERVICE=WMS&quot;'
in C:\ms4w\Apache\htdocs\wms_capabilities_v130.php:72

Stack trace:
#0 C:\ms4w\Apache\htdocs\wms_capabilities_v130.php(72):
ms_newMapObj('/ms_ogc/WMS_v1....')
#1 {main}
  thrown in <b>C:\ms4w\Apache\htdocs\wms_capabilities_v130.php</b> on
line <b>72</b><br />

[1] http://www.pcn.minambiente.it/PCNDYN/catalogowms.jsp

Hy pierluigi
a web GET request is made of a url and, after a "?", of a set of params.
I think that r.in.wms try to put a "?" at the and of the url.
but the wms address you use already contain a "?"
so you have to use, for the url, only the http addrees and, for the
urlparams, the remaining part of the address.

hope this help..

ciao

Ivan

On Fri, 2013-05-31 at 16:59 +0200, Ing. Pierluigi De Rosa wrote:

Thanks it works!

could you explain better what is this urlparams and wht for this
services I need to use it?
maybe someone else is interested in that.
Thanks
Pierluigi

PS I'm using GRASS 7.0; I will try with GRASS 6.4.x

Il giorno ven, 31/05/2013 alle 15.16 +0200, Ivan Marchesini ha scritto:
> Hi pierluigi
>
> this should work in grass7 (don't know in grass 6.4) :
>
> r.in.wms --overwrite output=tile1 url=http://wms.pcn.minambiente.it/ogc
> urlparams="map=/ms_ogc/WMS_v1.3/raster/ortofoto_colore_06.map"
> layers="OI.ORTOIMMAGINI.2006." srs=32633 format=jpeg maxcols=2000
> maxrows=2000 method=near wms_version=1.3.0
>
> please use "urlparams"
>
> ciao
>
> ivan
>
> On Fri, 2013-05-31 at 14:11 +0200, Ing. Pierluigi De Rosa wrote:
> > Dear GRASS User
> > did anyone tried to use r.in.wms to get data from pcn[1] webservices?
> >
> > I want to download aerial photo from this URL:
> > http://wms.pcn.minambiente.it/ogc?map=/ms_ogc/WMS_v1.3/raster/ortofoto_colore_06.map
> >
> > if I run
> > r.in.wms -c
> > url=http://wms.pcn.minambiente.it/ogc?map=/ms_ogc/WMS_v1.3/raster/ortofoto_colore_06.map wms_version=1.3.0
> >
> > it retries me an error.
> > below details.
> >
> > <b>Warning</b>: ms_newMapObj(): [MapServer Error]: msLoadMap():
> > MS_DEFAULT_MAPFILE_PATTERN validation failed.
> > in <b>C:\ms4w\Apache\htdocs\wms_capabilities_v130.php</b> on line
> > <b>72</b><br />
> > <br />
> > <b>Warning</b>: ms_newMapObj(): [MapServer Error]: msEvalRegex():
> > String failed expression test.
> >
> > in <b>C:\ms4w\Apache\htdocs\wms_capabilities_v130.php</b> on line
> > <b>72</b><br />
> > <br />
> > <b>Fatal error</b>: Uncaught exception 'MapScriptException' with
> > message 'Failed to open map file
> > &quot;/ms_ogc/WMS_v1.3/raster/ortofoto_colore_06.map?SERVICE=WMS&quot;'
> > in C:\ms4w\Apache\htdocs\wms_capabilities_v130.php:72
> >
> > Stack trace:
> > #0 C:\ms4w\Apache\htdocs\wms_capabilities_v130.php(72):
> > ms_newMapObj('/ms_ogc/WMS_v1....')
> > #1 {main}
> > thrown in <b>C:\ms4w\Apache\htdocs\wms_capabilities_v130.php</b> on
> > line <b>72</b><br />
> >
> >
> > [1] http://www.pcn.minambiente.it/PCNDYN/catalogowms.jsp
>
>

Hi Ivan and pierluigi,

Hy pierluigi
a web GET request is made of a url and, after a “?”, of a set of params.
I think that r.in.wms try to put a “?” at the and of the url.
but the wms address you use already contain a “?”
so you have to use, for the url, only the http addrees and, for the
urlparams, the remaining part of the address.

it worked as you described, however GetCapabilities request ignored urlparams parameter. After r56519 it should be able also to use url with “?”. GetCapabilities request should also work both ways now (r56520) (using urlparams or including parameters directly into url).

Best

Stepan

Ivan wrote:

this should work in grass7 (don't know in grass 6.4) :

r.in.wms --overwrite output=tile1 url=http://wms.pcn.minambiente.it/ogc
urlparams="map=/ms_ogc/WMS_v1.3/raster/ortofoto_colore_06.map"
layers="OI.ORTOIMMAGINI.2006." srs=32633 format=jpeg
maxcols=2000
maxrows=2000 method=near wms_version=1.3.0

I'm not sure about location setup and valid region bounds, but
something like this should work in 6.4 from the command line:

urlparams="map=/ms_ogc/WMS_v1.3/raster/ortofoto_colore_06.map"

# works
r.in.wms -l output=dummy mapserver="http://wms.pcn.minambiente.it/ogc&quot; \
  wmsquery="version=1.3.0&$urlparams"

# server error, but I'm probably asking for the wrong bounds
r.in.wms output=tile1 mapserver="http://wms.pcn.minambiente.it/ogc&quot; \
  layers="OI.ORTOIMMAGINI.2006.33" srs="EPSG:32633" format=jpeg \
  method=nearest wmsquery="version=1.3.0&$urlparams"

Hamish

Many thanks stephan… I will try with the new release… Ciao

inviato da smartphone

Il giorno 31/mag/2013 18:52, “Štěpán Turek” <stepan.turek@seznam.cz> ha scritto:

Hi Ivan and pierluigi,

Hy pierluigi
a web GET request is made of a url and, after a “?”, of a set of params.
I think that r.in.wms try to put a “?” at the and of the url.
but the wms address you use already contain a “?”
so you have to use, for the url, only the http addrees and, for the
urlparams, the remaining part of the address.

it worked as you described, however GetCapabilities request ignored urlparams parameter. After r56519 it should be able also to use url with “?”. GetCapabilities request should also work both ways now (r56520) (using urlparams or including parameters directly into url).

Best

Stepan