Re: [mapserver-users] GetFeatureInfo layout in plain text
Hi @all, thank you for that inspiration, Steve! This shows how valuable this list is... And sorry, Yves, for giving a wrong hint; but HTML-GFI within ArcGIS 10.2+ works, but be careful with embedded javascript and advanced css in html-template, ArcGIS doesn't like that much. Some thoughts on the Template-thing from Steve/Daniel: Regarding to Daniels reference to wms-server-documentation (http://mapserver.org/ogc/wms_server.html#how-does-a-wms-work), GFI-section: "text/html output using MapServer query templates (see Templating) specified in the CLASS TEMPLATE parameter (the filename has to have an .html extension). The MIME type returned by the Class templates defaults to text/html and can be controlled using the metadata “wms_feature_info_mime_type”. It looks like there's a "natural" binding between template and html output. As Daniel stated, this can be overridden with setting a other " wms_feature_info_mime_type" - OK so far. For example someone would now be using the template for individual text-plain output-styling and setting " 'wms_feature_info_mime_type' 'text/plain' ", what happens then, if a user requests the FeatureInfo in text/html, which is from my point of view the typical format? Mapserver wouldn't produce a valid html response anymore (because of the lack of an valid html-template), would it? Should GFI with HTML then be forbidden or are multiple templates for different outputformats possible? How would this work? Maybe I didn't fully understand Steve's hint and one of you can explain? Thanks a lot, Ben -Ursprüngliche Nachricht- Von: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] Im Auftrag von Lime, Steve D (MNIT) Gesendet: Donnerstag, 10. November 2016 19:51 An: Yves Jacolin; mapserver-users@lists.osgeo.org Betreff: Re: [mapserver-users] GetFeatureInfo layout in plain text This should be possible. Templates are not limited to HTML output, any text based format should be able to be created. You do this through output formats. Here's an example for plain text: OUTPUTFORMAT NAME 'plain-text' DRIVER 'TEMPLATE' MIMETYPE 'text/plain' FORMATOPTION "FILE=templates/plain.tmpl" FORMATOPTION 'ATTACHMENT=myfile.txt' END The template file's extension is really irrelevant to what's being delivered back to the client - the mimetype sets that. I don't recall of the top of my head how you expose this type via WMS but I think that's pretty straight forward. Steve -Original Message- From: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Yves Jacolin Sent: Thursday, November 10, 2016 4:16 AM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] GetFeatureInfo layout in plain text Hello, I have to setup a text format for a WMS' GetFeatureInfo service. I would like to know if it is possible to change the layout using a template. My first test was not working so any feedback is welcome. The documentation said that the user should read the templating chapter so I guess this is possible. Any confirmation? Y. -- Responsable Formation et Support Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac, Cedex Tel (France) : +33 4 58 48 20 43 (new !) Tel (Suisse) : +41 21 619 10 43 Mob. : +33 6 18 75 42 21 Fax : 04 79 70 15 81 Mail : yves.jaco...@camptocamp.com http://www.camptocamp.com ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] GetFeatureInfo layout in plain text
To complement what Steve wrote, have a look at the wms_getfeatureinfo_formatlist in http://mapserver.org/ogc/wms_server.html Daniel On 2016-11-10 1:50 PM, Lime, Steve D (MNIT) wrote: This should be possible. Templates are not limited to HTML output, any text based format should be able to be created. You do this through output formats. Here's an example for plain text: OUTPUTFORMAT NAME 'plain-text' DRIVER 'TEMPLATE' MIMETYPE 'text/plain' FORMATOPTION "FILE=templates/plain.tmpl" FORMATOPTION 'ATTACHMENT=myfile.txt' END The template file's extension is really irrelevant to what's being delivered back to the client - the mimetype sets that. I don't recall of the top of my head how you expose this type via WMS but I think that's pretty straight forward. Steve -Original Message- From: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Yves Jacolin Sent: Thursday, November 10, 2016 4:16 AM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] GetFeatureInfo layout in plain text Hello, I have to setup a text format for a WMS' GetFeatureInfo service. I would like to know if it is possible to change the layout using a template. My first test was not working so any feedback is welcome. The documentation said that the user should read the templating chapter so I guess this is possible. Any confirmation? Y. -- Daniel Morissette http://www.mapgears.com/ T: +1 418-696-5056 #201 http://evouala.com/ - Location Intelligence Made Easy ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] GetFeatureInfo layout in plain text
This should be possible. Templates are not limited to HTML output, any text based format should be able to be created. You do this through output formats. Here's an example for plain text: OUTPUTFORMAT NAME 'plain-text' DRIVER 'TEMPLATE' MIMETYPE 'text/plain' FORMATOPTION "FILE=templates/plain.tmpl" FORMATOPTION 'ATTACHMENT=myfile.txt' END The template file's extension is really irrelevant to what's being delivered back to the client - the mimetype sets that. I don't recall of the top of my head how you expose this type via WMS but I think that's pretty straight forward. Steve -Original Message- From: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Yves Jacolin Sent: Thursday, November 10, 2016 4:16 AM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] GetFeatureInfo layout in plain text Hello, I have to setup a text format for a WMS' GetFeatureInfo service. I would like to know if it is possible to change the layout using a template. My first test was not working so any feedback is welcome. The documentation said that the user should read the templating chapter so I guess this is possible. Any confirmation? Y. -- Responsable Formation et Support Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac, Cedex Tel (France) : +33 4 58 48 20 43 (new !) Tel (Suisse) : +41 21 619 10 43 Mob. : +33 6 18 75 42 21 Fax : 04 79 70 15 81 Mail : yves.jaco...@camptocamp.com http://www.camptocamp.com ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] GetFeatureInfo layout in plain text
Hi Yves, from my point of view this isn't possible, templating in mapserver-WMS just works for HTML. You would need an wrapper-script, which does some postprocessing/transforming with GFI-response (text) from mapserver - could be done with bash/perl/python/php whatever, maybe mapscript-engine (I'm not into this) or within Apache-Webserver (mod_sed ;-) ). Most structured way would be rewriting GFI-request from text-format to gml-format within the receiving webserver, directing this request to mapserver (which would create gml-response), directing mapserver-response to xml-processor and transform to whatever you want and then let webserver deliver the response to the client... Edit: Jörg was faster, because of having a phonecall from one of his coworkers ;-) and also my post was blocked by the mailing-list caused by an attachment ☹ ,sorry, Jeff. ArcGIS Desktop 10.x does show html-GFI, see attachment (image is clipped, it is a screenshot from within ArcGIS): http://pasteboard.co/pANcOnMbD.jpg Ben Mit freundlichen Grüßen Im Auftrag Benjamin Schepers Luftbild und Geoinformationssysteme Kronprinzenstraße 6 45128 Essen Fon: +49 201 2069-232 Fax: +49 201 2069-500 schep...@rvr-online.de [cid:image001.jpg@01D23B71.BDC6EEC0] Die Regionaldirektorin Kronprinzenstraße 35 45128 Essen Zentrale: +49 (0) 201 2069-0 Fax: +49 (0) 201 2069-500 www.metropoleruhr.de Postfach 10 32 64 45032 Essen Steuernummer: RVR 112/5797/0116 USt.-ldNr.: DE 173867500 Diese E-Mail koennte vertrauliche und/oder rechtlich geschuetzte Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail sind nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Von: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] Im Auftrag von Yves Jacolin Gesendet: Donnerstag, 10. November 2016 13:03 An: Jörg Thomsen (WhereGroup) Cc: mapserver-users Betreff: Re: [mapserver-users] GetFeatureInfo layout in plain text humm, good point, I need to check the output request from ArcGIS. The users said that for other service they get a table, so probably an html format. Thanks, Y. 2016-11-10 12:59 GMT+01:00 Jörg Thomsen (WhereGroup) <joerg.thom...@wheregroup.com<mailto:joerg.thom...@wheregroup.com>>: so, what do you have to style? Perhaps you could create a text-format output with templates to create a sort of ascii-tables, you don't have to use html-tags within the templates. But in this case the request has to be format=text/html. Jörg Am 10.11.2016 um 12:39 schrieb Yves Jacolin: > Thanks Jörg, > > Unfortunately I should use text format as ArcGIS desktop don't support other > format (to be confirmed). > > Y. > On Thursday, November 10, 2016 11:49:49 Jörg Thomsen wrote: >> Hi Yves, >> >> text/plain is text/plain, no layout. The Mapserver-templates work with >> html-format. Another way could be using the xml-output and styling it >> with xslt. But you can enable the html-output using templates with >> mapserver and it still will be possible to send text/plain requests. >> >> Templating ist easy and powerful, so to answer your question: yes, read >> the templating chapter. You'll find a short introduction in the old >> tutorial: http://demo.mapserver.org/tutorial/section3.html (example 3.1) >> >> Jörg >> >> Am 10.11.2016 um 11:16 schrieb Yves Jacolin: >>> Hello, >>> >>> I have to setup a text format for a WMS' GetFeatureInfo service. I would >>> like to know if it is possible to change the layout using a template. >>> >>> My first test was not working so any feedback is welcome. The >>> documentation >>> said that the user should read the templating chapter so I guess this is >>> possible. >>> >>> Any confirmation? >>> >>> Y. >> >> Viele Grüße, >> Jörg Thomsen > Viele Grüße, Jörg Thomsen -- Where2B Konferenz 2016 15. Dezember 2016 in Bonn www.where2b-conference.com<http://www.where2b-conference.com> --- Jörg Thomsen WhereGroup GmbH & Co. KG Gillweg 3 14193 Berlin Germany Fon: +49 (0)30 / 5130 278 74<tel:%2B49%20%280%2930%20%2F%205130%20278%2074> Fax: +49 (0)30 / 89 09 53 11<tel:%2B49%20%280%2930%20%2F%2089%2009%2053%2011> joerg.thom...@wheregroup.
Re: [mapserver-users] GetFeatureInfo layout in plain text
humm, good point, I need to check the output request from ArcGIS. The users said that for other service they get a table, so probably an html format. Thanks, Y. 2016-11-10 12:59 GMT+01:00 Jörg Thomsen (WhereGroup) < joerg.thom...@wheregroup.com>: > so, what do you have to style? Perhaps you could create a text-format > output with templates to create a sort of ascii-tables, you don't have > to use html-tags within the templates. But in this case the request has > to be format=text/html. > > Jörg > > > Am 10.11.2016 um 12:39 schrieb Yves Jacolin: > > Thanks Jörg, > > > > Unfortunately I should use text format as ArcGIS desktop don't support > other > > format (to be confirmed). > > > > Y. > > On Thursday, November 10, 2016 11:49:49 Jörg Thomsen wrote: > >> Hi Yves, > >> > >> text/plain is text/plain, no layout. The Mapserver-templates work with > >> html-format. Another way could be using the xml-output and styling it > >> with xslt. But you can enable the html-output using templates with > >> mapserver and it still will be possible to send text/plain requests. > >> > >> Templating ist easy and powerful, so to answer your question: yes, read > >> the templating chapter. You'll find a short introduction in the old > >> tutorial: http://demo.mapserver.org/tutorial/section3.html (example > 3.1) > >> > >> Jörg > >> > >> Am 10.11.2016 um 11:16 schrieb Yves Jacolin: > >>> Hello, > >>> > >>> I have to setup a text format for a WMS' GetFeatureInfo service. I > would > >>> like to know if it is possible to change the layout using a template. > >>> > >>> My first test was not working so any feedback is welcome. The > >>> documentation > >>> said that the user should read the templating chapter so I guess this > is > >>> possible. > >>> > >>> Any confirmation? > >>> > >>> Y. > >> > >> Viele Grüße, > >> Jörg Thomsen > > > > > Viele Grüße, > Jörg Thomsen > > -- > > > Where2B Konferenz 2016 > 15. Dezember 2016 in Bonn > www.where2b-conference.com > > > --- > Jörg Thomsen > WhereGroup GmbH & Co. KG > Gillweg 3 > 14193 Berlin > Germany > > Fon: +49 (0)30 / 5130 278 74 > Fax: +49 (0)30 / 89 09 53 11 > > joerg.thom...@wheregroup.com > www.wheregroup.com > Amtsgericht Bonn, HRA 6788 > --- > Komplementärin: > WhereGroup Verwaltungs GmbH > vertreten durch: > Olaf Knopp, Peter Stamm > --- > Folgen Sie der WhereGroup auf twitter: http://twitter.com/WhereGroup_com > ___ > mapserver-users mailing list > mapserver-users@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > -- Responsable Formation et Support Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac, Cedex Tel (France) : +33 4 58 48 20 43 (new !) Tel (Suisse) : +41 21 619 10 43 Mob. : +33 6 18 75 42 21 Fax : 04 79 70 15 81 Mail : yves.jaco...@camptocamp.com http://www.camptocamp.com ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] GetFeatureInfo layout in plain text
so, what do you have to style? Perhaps you could create a text-format output with templates to create a sort of ascii-tables, you don't have to use html-tags within the templates. But in this case the request has to be format=text/html. Jörg Am 10.11.2016 um 12:39 schrieb Yves Jacolin: > Thanks Jörg, > > Unfortunately I should use text format as ArcGIS desktop don't support other > format (to be confirmed). > > Y. > On Thursday, November 10, 2016 11:49:49 Jörg Thomsen wrote: >> Hi Yves, >> >> text/plain is text/plain, no layout. The Mapserver-templates work with >> html-format. Another way could be using the xml-output and styling it >> with xslt. But you can enable the html-output using templates with >> mapserver and it still will be possible to send text/plain requests. >> >> Templating ist easy and powerful, so to answer your question: yes, read >> the templating chapter. You'll find a short introduction in the old >> tutorial: http://demo.mapserver.org/tutorial/section3.html (example 3.1) >> >> Jörg >> >> Am 10.11.2016 um 11:16 schrieb Yves Jacolin: >>> Hello, >>> >>> I have to setup a text format for a WMS' GetFeatureInfo service. I would >>> like to know if it is possible to change the layout using a template. >>> >>> My first test was not working so any feedback is welcome. The >>> documentation >>> said that the user should read the templating chapter so I guess this is >>> possible. >>> >>> Any confirmation? >>> >>> Y. >> >> Viele Grüße, >> Jörg Thomsen > Viele Grüße, Jörg Thomsen -- Where2B Konferenz 2016 15. Dezember 2016 in Bonn www.where2b-conference.com --- Jörg Thomsen WhereGroup GmbH & Co. KG Gillweg 3 14193 Berlin Germany Fon: +49 (0)30 / 5130 278 74 Fax: +49 (0)30 / 89 09 53 11 joerg.thom...@wheregroup.com www.wheregroup.com Amtsgericht Bonn, HRA 6788 --- Komplementärin: WhereGroup Verwaltungs GmbH vertreten durch: Olaf Knopp, Peter Stamm --- Folgen Sie der WhereGroup auf twitter: http://twitter.com/WhereGroup_com ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] GetFeatureInfo layout in plain text
Thanks Jörg, Unfortunately I should use text format as ArcGIS desktop don't support other format (to be confirmed). Y. On Thursday, November 10, 2016 11:49:49 Jörg Thomsen wrote: > Hi Yves, > > text/plain is text/plain, no layout. The Mapserver-templates work with > html-format. Another way could be using the xml-output and styling it > with xslt. But you can enable the html-output using templates with > mapserver and it still will be possible to send text/plain requests. > > Templating ist easy and powerful, so to answer your question: yes, read > the templating chapter. You'll find a short introduction in the old > tutorial: http://demo.mapserver.org/tutorial/section3.html (example 3.1) > > Jörg > > Am 10.11.2016 um 11:16 schrieb Yves Jacolin: > > Hello, > > > > I have to setup a text format for a WMS' GetFeatureInfo service. I would > > like to know if it is possible to change the layout using a template. > > > > My first test was not working so any feedback is welcome. The > > documentation > > said that the user should read the templating chapter so I guess this is > > possible. > > > > Any confirmation? > > > > Y. > > Viele Grüße, > Jörg Thomsen -- Responsable Formation et Support Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac, Cedex Tel (France) : +33 4 58 48 20 43 (new !) Tel (Suisse) : +41 21 619 10 43 Mob. : +33 6 18 75 42 21 Fax : 04 79 70 15 81 Mail : yves.jaco...@camptocamp.com http://www.camptocamp.com ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] GetFeatureInfo layout in plain text
Hi Yves, text/plain is text/plain, no layout. The Mapserver-templates work with html-format. Another way could be using the xml-output and styling it with xslt. But you can enable the html-output using templates with mapserver and it still will be possible to send text/plain requests. Templating ist easy and powerful, so to answer your question: yes, read the templating chapter. You'll find a short introduction in the old tutorial: http://demo.mapserver.org/tutorial/section3.html (example 3.1) Jörg Am 10.11.2016 um 11:16 schrieb Yves Jacolin: > Hello, > > I have to setup a text format for a WMS' GetFeatureInfo service. I would like > to know if it is possible to change the layout using a template. > > My first test was not working so any feedback is welcome. The documentation > said that the user should read the templating chapter so I guess this is > possible. > > Any confirmation? > > Y. > Viele Grüße, Jörg Thomsen -- Where2B Konferenz 2016 15. Dezember 2016 in Bonn www.where2b-conference.com --- Jörg Thomsen WhereGroup GmbH & Co. KG Gillweg 3 14193 Berlin Germany Fon: +49 (0)30 / 5130 278 74 Fax: +49 (0)30 / 89 09 53 11 joerg.thom...@wheregroup.com www.wheregroup.com Amtsgericht Bonn, HRA 6788 --- Komplementärin: WhereGroup Verwaltungs GmbH vertreten durch: Olaf Knopp, Peter Stamm --- Folgen Sie der WhereGroup auf twitter: http://twitter.com/WhereGroup_com ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] GetFeatureInfo layout in plain text
Hello, I have to setup a text format for a WMS' GetFeatureInfo service. I would like to know if it is possible to change the layout using a template. My first test was not working so any feedback is welcome. The documentation said that the user should read the templating chapter so I guess this is possible. Any confirmation? Y. -- Responsable Formation et Support Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac, Cedex Tel (France) : +33 4 58 48 20 43 (new !) Tel (Suisse) : +41 21 619 10 43 Mob. : +33 6 18 75 42 21 Fax : 04 79 70 15 81 Mail : yves.jaco...@camptocamp.com http://www.camptocamp.com ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users