Re: [MapServer-users] How to add templates(html) to be use with getFeatureInfo for raster data

2023-03-24 Thread Trygve Aspenes via MapServer-users

Thanks

I have already tried all kind of options with template and filenames.
What I was missing was the query option "info_format=text/html" doing 
eg. curl.


So my setup was working all the time, but my test curl was wrong.

Trygve

Den 2023-03-24 18:09, skrev Kobben, Barend (UT-ITC):

The line

TEMPLATE "empty"

Should be

TEMPLATE ""

_-- _

_Barend Köbben_

On 24/03/2023, 17:48, "MapServer-users"
 wrote:

Hi Users list!

I'm trying to get getFeatureRequest to reply with a html template with

pixel values from a geotiff raster image.

I have my layer like this:

   LAYER
 NAME "Overview"
 STATUS ON
 TYPE raster
 TEMPLATE "empty"
 DATA 
 METADATA
   "wms_title" "Overview"
   "wms_timeextent" "2021-08-27T13:20:48Z/2021-08-27T13:20:48Z"
   "wms_enable_request" "*"
 END
 FILTER (`[TIME]` = `2021-08-27T13:20:48Z`)
   END

If I ask for the getcapabilities, the getfeatureinfo looks like this:

 
   text/html
   application/vnd.ogc.gml
   text/plain
   
 
   https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink=05%7C01%7Cb.j.kobben%40utwente.nl%7Ca71634c058d2421f20d508db2c879c59%7C723246a1c3f543c5acdc43adb404ac4d%7C0%7C0%7C638152733187323138%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=b1Um6UNYhoT5jVanlyPbiM4W3aHN7eIlSNMu3sVIuQM%3D=0;

xlink:href="http://localhost:8080/mapserverapi?"/>
   https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink=05%7C01%7Cb.j.kobben%40utwente.nl%7Ca71634c058d2421f20d508db2c879c59%7C723246a1c3f543c5acdc43adb404ac4d%7C0%7C0%7C638152733187323138%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=b1Um6UNYhoT5jVanlyPbiM4W3aHN7eIlSNMu3sVIuQM%3D=0;

xlink:href="http://localhost:8080/mapserverapi?"/>
 
   
 

And if I ask for the getfeatureinfo I get:

GetFeatureInfo results:

Layer 'Overview'
   Feature 0:

So far so good.

But now I want to add a custom template to ultimately give me a html
template with pixel values. but what ever I try to put in the TEMPLATE

variable, I dont get any other than the results shown above.

In my LAYER config I try with
TEMPLATE "http://localhost:8080/.html"
or
TEMPLATE ".html"

but nope.

mapserver is v7.4.3

In the documentation there is something about getfeatureinfo here
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmapserver.org%2Fmapfile%2Fcluster.html%23handling-getfeatureinfo=05%7C01%7Cb.j.kobben%40utwente.nl%7Ca71634c058d2421f20d508db2c879c59%7C723246a1c3f543c5acdc43adb404ac4d%7C0%7C0%7C638152733187323138%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=uWdSh%2BNpt4m5Q2u8i39XtCWnsnbFzhrGP2DtvO1VRbA%3D=0,
but
that is for cluster so I dont think it applies here.
Something more here
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmapserver.org%2Fogc%2Fwms_server.html%23how-does-a-wms-work=05%7C01%7Cb.j.kobben%40utwente.nl%7Ca71634c058d2421f20d508db2c879c59%7C723246a1c3f543c5acdc43adb404ac4d%7C0%7C0%7C638152733187323138%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=FhVwEX6uJgfDF7LXIiUei68dGgYM1kXP0laJ2s58m1Y%3D=0,
but still
I don't get it.
Some lines after
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmapserver.org%2Fogc%2Fwms_server.html%23setup-a-mapfile-for-your-wms=05%7C01%7Cb.j.kobben%40utwente.nl%7Ca71634c058d2421f20d508db2c879c59%7C723246a1c3f543c5acdc43adb404ac4d%7C0%7C0%7C638152733187323138%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=KvCsFuN%2BE8sKZpxlGvf9X2vTPE6zWlJxGw2GuOzxSAs%3D=0

there is also Configuring for GetFeatureInfo Requests:
Here I learned how to enable the getfeatureinfo. But the examples only

gives the replies, not how I need to setup my map file.
Also
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmapserver.org%2Fogc%2Fwms_server.html%23sample-wms-server-mapfile=05%7C01%7Cb.j.kobben%40utwente.nl%7Ca71634c058d2421f20d508db2c879c59%7C723246a1c3f543c5acdc43adb404ac4d%7C0%7C0%7C638152733187323138%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=8e9FKztuVma73pzpqXu8vKJtCwwtBSjdA7ndZedTjnM%3D=0
[3]
is nice, But I still don't get it.

Any advise is much appreciated.

Trygve
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org

Re: [MapServer-users] How to add templates(html) to be use with getFeatureInfo for raster data

2023-03-24 Thread Kobben, Barend (UT-ITC) via MapServer-users
The line
TEMPLATE "empty"

Should be
TEMPLATE ""

--
Barend Köbben


On 24/03/2023, 17:48, "MapServer-users" 
 wrote:

Hi Users list!

I'm trying to get getFeatureRequest to reply with a html template with
pixel values from a geotiff raster image.

I have my layer like this:

   LAYER
 NAME "Overview"
 STATUS ON
 TYPE raster
 TEMPLATE "empty"
 DATA 
 METADATA
   "wms_title" "Overview"
   "wms_timeextent" "2021-08-27T13:20:48Z/2021-08-27T13:20:48Z"
   "wms_enable_request" "*"
 END
 FILTER (`[TIME]` = `2021-08-27T13:20:48Z`)
   END

If I ask for the getcapabilities, the getfeatureinfo looks like this:

 
   text/html
   application/vnd.ogc.gml
   text/plain
   
 
   https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink=05%7C01%7Cb.j.kobben%40utwente.nl%7Ca71634c058d2421f20d508db2c879c59%7C723246a1c3f543c5acdc43adb404ac4d%7C0%7C0%7C638152733187323138%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=b1Um6UNYhoT5jVanlyPbiM4W3aHN7eIlSNMu3sVIuQM%3D=0;
xlink:href="http://localhost:8080/mapserverapi?"/>http://localhost:8080/mapserverapi?%22/%3e%3c/Get>>
   https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink=05%7C01%7Cb.j.kobben%40utwente.nl%7Ca71634c058d2421f20d508db2c879c59%7C723246a1c3f543c5acdc43adb404ac4d%7C0%7C0%7C638152733187323138%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=b1Um6UNYhoT5jVanlyPbiM4W3aHN7eIlSNMu3sVIuQM%3D=0;
xlink:href="http://localhost:8080/mapserverapi?"/>http://localhost:8080/mapserverapi?%22/%3e%3c/Post>>
 
   
 

And if I ask for the getfeatureinfo I get:

GetFeatureInfo results:

Layer 'Overview'
   Feature 0:

So far so good.

But now I want to add a custom template to ultimately give me a html
template with pixel values. but what ever I try to put in the TEMPLATE
variable, I dont get any other than the results shown above.

In my LAYER config I try with
TEMPLATE "http://localhost:8080/.html"
or
TEMPLATE ".html"

but nope.

mapserver is v7.4.3

In the documentation there is something about getfeatureinfo here
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmapserver.org%2Fmapfile%2Fcluster.html%23handling-getfeatureinfo=05%7C01%7Cb.j.kobben%40utwente.nl%7Ca71634c058d2421f20d508db2c879c59%7C723246a1c3f543c5acdc43adb404ac4d%7C0%7C0%7C638152733187323138%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=uWdSh%2BNpt4m5Q2u8i39XtCWnsnbFzhrGP2DtvO1VRbA%3D=0,
 but
that is for cluster so I dont think it applies here.
Something more here
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmapserver.org%2Fogc%2Fwms_server.html%23how-does-a-wms-work=05%7C01%7Cb.j.kobben%40utwente.nl%7Ca71634c058d2421f20d508db2c879c59%7C723246a1c3f543c5acdc43adb404ac4d%7C0%7C0%7C638152733187323138%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=FhVwEX6uJgfDF7LXIiUei68dGgYM1kXP0laJ2s58m1Y%3D=0,
 but still
I don't get it.
Some lines after
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmapserver.org%2Fogc%2Fwms_server.html%23setup-a-mapfile-for-your-wms=05%7C01%7Cb.j.kobben%40utwente.nl%7Ca71634c058d2421f20d508db2c879c59%7C723246a1c3f543c5acdc43adb404ac4d%7C0%7C0%7C638152733187323138%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=KvCsFuN%2BE8sKZpxlGvf9X2vTPE6zWlJxGw2GuOzxSAs%3D=0
there is also Configuring for GetFeatureInfo Requests:
Here I learned how to enable the getfeatureinfo. But the examples only
gives the replies, not how I need to setup my map file.
Also 
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmapserver.org%2Fogc%2Fwms_server.html%23sample-wms-server-mapfile=05%7C01%7Cb.j.kobben%40utwente.nl%7Ca71634c058d2421f20d508db2c879c59%7C723246a1c3f543c5acdc43adb404ac4d%7C0%7C0%7C638152733187323138%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=8e9FKztuVma73pzpqXu8vKJtCwwtBSjdA7ndZedTjnM%3D=0
is nice, But I still don't get it.

Any advise is much appreciated.

Trygve
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fmapserver-users=05%7C01%7Cb.j.kobben%40utwente.nl%7Ca71634c058d2421f20d508db2c879c59%7C723246a1c3f543c5acdc43adb404ac4d%7C0%7C0%7C638152733187323138%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=sYLWKm4FJmM665EGV68H4GKS1azKs0YJtVx5WPSxfqA%3D=0
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org

[MapServer-users] How to add templates(html) to be use with getFeatureInfo for raster data

2023-03-24 Thread Trygve Aspenes via MapServer-users

Hi Users list!

I'm trying to get getFeatureRequest to reply with a html template with 
pixel values from a geotiff raster image.


I have my layer like this:

  LAYER
NAME "Overview"
STATUS ON
TYPE raster
TEMPLATE "empty"
DATA 
METADATA
  "wms_title" "Overview"
  "wms_timeextent" "2021-08-27T13:20:48Z/2021-08-27T13:20:48Z"
  "wms_enable_request" "*"
END
FILTER (`[TIME]` = `2021-08-27T13:20:48Z`)
  END

If I ask for the getcapabilities, the getfeatureinfo looks like this:


  text/html
  application/vnd.ogc.gml
  text/plain
  

  xmlns:xlink="http://www.w3.org/1999/xlink; 
xlink:href="http://localhost:8080/mapserverapi?"/>
  xmlns:xlink="http://www.w3.org/1999/xlink; 
xlink:href="http://localhost:8080/mapserverapi?"/>


  


And if I ask for the getfeatureinfo I get:

GetFeatureInfo results:

Layer 'Overview'
  Feature 0:

So far so good.

But now I want to add a custom template to ultimately give me a html 
template with pixel values. but what ever I try to put in the TEMPLATE 
variable, I dont get any other than the results shown above.


In my LAYER config I try with
TEMPLATE "http://localhost:8080/.html"
or
TEMPLATE ".html"

but nope.

mapserver is v7.4.3

In the documentation there is something about getfeatureinfo here 
https://mapserver.org/mapfile/cluster.html#handling-getfeatureinfo, but 
that is for cluster so I dont think it applies here.
Something more here 
https://mapserver.org/ogc/wms_server.html#how-does-a-wms-work, but still 
I don't get it.
Some lines after 
https://mapserver.org/ogc/wms_server.html#setup-a-mapfile-for-your-wms 
there is also Configuring for GetFeatureInfo Requests:
Here I learned how to enable the getfeatureinfo. But the examples only 
gives the replies, not how I need to setup my map file.
Also https://mapserver.org/ogc/wms_server.html#sample-wms-server-mapfile 
is nice, But I still don't get it.


Any advise is much appreciated.

Trygve
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] MSSQL plugin path outside of the global CONFIG file

2023-03-24 Thread Steve Lime
One point of clarification. If a config file is referenced then when the
mapfile is read then the value for PLUGIN is always interpreted as a key to
the list of plugins. That is always the case for CGI/FastCGI where a config
file is required. In the case of MapScript (or shp2map) loading a mapfile,
the config file is optional and the value for PLUGIN works as prior
versions if a config file is not referenced. This was done to minimize
impact on scripts. If a mapfile serves dual purposes then a config file
will be required and PLUGIN values represent keys.

--Steve

On Mon, Mar 20, 2023 at 9:13 AM Jörg Thomsen (WhereGroup) <
joerg.thom...@wheregroup.com> wrote:

> Hello Benedek,
>
>  > Is it mandatory now, to define the PLUGIN path from the global CONFIG
> file?
>
> short answer: yes it's mandatory and it's a security issue.
>
> the documentation is very explizit
> (see https://mapserver.org/mapfile/layer.html):
>
> > For MapServer >=8:
> defining plugins for dataconnections in the config-gile
> ...
> > For MapServer <8:
> defining plugins for dataconnections in the mapfile
>
> further in https://mapserver.org/mapfile/config.html :
> > This block allows for keys to be mapped to plugin library paths.
>  > For example the MS SQL Plugin.
>  > **This registry of plugins avoids possible unsafe libraries being
>  >  loaded by a mapfile.**
>
> Regards, Jörg
>
>
>
>
>
>
> Am 20.03.23 um 14:51 schrieb Benedek Petrovicz:
> > Hi!
> >
> > Before MapServer 8, I always defined the mssql plugin path in the
> > mapfiles directly.
> > It was a convenient way for my use case.
> >
> > Now from MapServer 8 there's the required global CONFIG file I have to
> > define.
> > Which is fine, but MapServer will only allow loading the plugin through
> > that global CONFIG file.
> >
> > The CONFIG reference states the following:
> >
> > /"PLUGINS: This block allows for keys to be mapped to plugin library
> > paths."/
> >
> > For me, this means I can define a global plugin keyword if I want to,
> > but I don't have to.
> > In reality I don't have other options. At least I don't know about any.
> >
> > Is it mandatory now, to define the PLUGIN path from the global CONFIG
> file?
> >
> > Thank you!
> > Benedek Petrovicz
> >
> > ___
> > MapServer-users mailing list
> > MapServer-users@lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
> --
> Viele Grüße,
> Jörg Thomsen
> -
> Aufwind durch Wissen!
> Web-Seminare und Online-Schulungen
> bei der www.foss-academy.com
> -
>
>
> Jörg Thomsen
> WhereGroup GmbH
> Bundesallee 23
> 10717 Berlin
> Germany
>
> Tel: +49 (0)30 / 5130 278 74
> Fax: +49 (0)30 / 5130 278 11
>
> joerg.thom...@wheregroup.com
> www.wheregroup.com
>
> Geschäftsführer:
> Olaf Knopp, Peter Stamm
> Amtsgericht Bonn, HRB 9885
>
> ---
> Folgen Sie der WhereGroup auf twitter: http://twitter.com/WhereGroup_com
>
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] MS_MAP_PATTERN cannot accept network share

2023-03-24 Thread Steve Lime
Hi Benedek: You'll need to fiddle with MS_MAP_BAD_PATTERN. Looking at the
sample configuration file it's value is:

  MS_MAP_BAD_PATTERN "[/\\]{2}|[/\\]?\\.+[/\\]|,"

If a mapfile path matches any of those, it's rejected. By default it's
blocking anything with \\, //, back references or commas anywhere in the
path. This makes it easier to write clear MS_MAP_PATTERN values. Anway, you
can override that value in the config file to remove blocking the //. Then
you'd want to make sure your MS_MAP_PATTERN starts with something like:

  MS_MAP_PATTERN "^//MY-NAS/MapFiles"

and be sure to test your patterns. Let us know how it goes.

--Steve

On Thu, Mar 23, 2023 at 3:48 PM Benedek Petrovicz <
benedek.petrov...@gmail.com> wrote:

> Hi!
>
> I'm running into an issue where I cannot reference the mapfiles from a
> network share.
> I'm getting the following error: *msCGILoadMap(): Web application error.
> CGI variable "map" fails to validate.*
>
> The path to my mapfile is the following: *//MY-NAS/MapFiles/test.map*
> It's under a network share.
>
> I know that it should work, because when I set a MAP alias to the same
> path in the global config, it just works.
>
> I tried multiple MS_MAP_PATTERN settings, but couldn't get it to accept
> the path.
>
>- *MS_MAP_PATTERN "."*
>- *MS_MAP_PATTERN "^.+$"*
>
> Is there any way to get MapServer accept a network share path?
> Unfortunately I cannot use the MAP aliases, because I have to make it work
> for multiple dynamic environments.
>
> I'm trying to make it work under MapServer 8.
>
> Thank you!
> Benedek
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users