Re: [MapServer-users] readGIF error meaning ?
Hello Jeff, Thanks for the reply. Your answer was in my junk folder, sorry for the delay ^^' I found where the error was coming from, if it can interest someone else. My MapFile has thematics (many CLASS with EXPRESSION in LAYER), and some cases use an external GIF resource defined in my SYMBOLSET. It was not well defined, and I also have to change these from GIF to PNG, and now all works well. Best regards JCB -Message d'origine- De : MapServer-users De la part de Jeff McKenna Envoyé : lundi 7 novembre 2022 18:08 À : mapserver-users@lists.osgeo.org Objet : Re: [MapServer-users] readGIF error meaning ? Hello JC, If you are using MS4W, you can test a GetLegendGraphic request by using the local demo WMS service that comes with every MS4W install, out-of-the-box, such as: https://ms4w.dev/cgi-bin/mapserv.exe?MAP=/ms4w/apps/local-demo/local.map=WMS=1.1.1=getlegendgraphic=countries=image/png (you should be able to modify the url above for 127.0.0.1/ instead) If that works locally for you, just follow the local-demo.map, for your own mapfile. -jeff -- Jeff McKenna GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/ On 2022-11-07 11:23 a.m., Jean-Christophe Bastin wrote: > Hello, > > I have many map files and I’m trying to get legends from them. > > I followed the documentation I found : > https://mapserver.org/ogc/wms_server.html#getlegendgraphic-request > <https://mapserver.org/ogc/wms_server.html#getlegendgraphic-request> > > The map file I test follows the requirements. I tried many calls : > > http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/mywms.map=WMS=mylayer=getlegendgraphic=image/png=1.0.0 > > <http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/mywms.map=WMS=mylayer=getlegendgraphic=image/png=1.0.0> > > http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/mywms.map=WMS=mylayer=getlegendgraphic=image/png=1.1.0 > > <http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/mywms.map=WMS=mylayer=getlegendgraphic=image/png=1.1.0> > > http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/mywms.map=WMS=mylayer=getlegendgraphic=image/png=1.1.1 > > <http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/mywms.map=WMS=mylayer=getlegendgraphic=image/png=1.1.1> > > http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/mywms.map=WMS=mylayer=getlegendgraphic=image/png=1.3.0_VERSION=1.1.0 > > <http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/mywms.map=WMS=mylayer=getlegendgraphic=image/png=1.3.0_VERSION=1.1.0> > > Each of them give me the error : > > readGIF(): General error message. corrupted gif image?: Failed to read > from file > > What does that mean ? Am I missing a parameter in my call or something > more in the map file that is not in the documentation ? > > Or is it the kind of generic error “I can’t generate your legend, just > find by yourself why” ? XD > > Many thanks ! > > *JCB* > ___ 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
[MapServer-users] readGIF error meaning ?
Hello, I have many map files and I'm trying to get legends from them. I followed the documentation I found : https://mapserver.org/ogc/wms_server.html#getlegendgraphic-request The map file I test follows the requirements. I tried many calls : http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/mywms.map=WMS=mylayer=getlegendgraphic=image/png=1.0.0 http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/mywms.map=WMS=mylayer=getlegendgraphic=image/png=1.1.0 http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/mywms.map=WMS=mylayer=getlegendgraphic=image/png=1.1.1 http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/mywms.map=WMS=mylayer=getlegendgraphic=image/png=1.3.0_VERSION=1.1.0 Each of them give me the error : readGIF(): General error message. corrupted gif image?: Failed to read from file What does that mean ? Am I missing a parameter in my call or something more in the map file that is not in the documentation ? Or is it the kind of generic error "I can't generate your legend, just find by yourself why" ? XD Many thanks ! JCB ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Need help/sample on how to use templating please
Hello, Thank you very much. I was in the good way in the MapFile, but not in the way to test it. I was testing my template using info tool of QGIS, and it was always displaying the base GetFeatureInfo results. I noticed in your execise that you were using OpenLayers and getGetFeatureInfoUrl, so I did a test with an hardcoded url in my browser, and in this way it displays well the template. I don’t know if you use QGIS, but do you have any idea on how to get the template result with it ? Regards, JCB De : Kobben, Barend (UT-ITC) Envoyé : vendredi 17 juin 2022 11:51 À : Jean-Christophe Bastin ; mapserver-users@lists.osgeo.org Objet : Re: [mapserver-users] Need help/sample on how to use templating please This is an exercise for our students, in a different environment, but contain the needed steps - you migth have missed on of them... https://gip.itc.utwente.nl/exercises/docs/OpenLayersWMS/adding_getfeatureinfo_capability -- Barend Köbben On 17/06/2022, 11:12, "Jean-Christophe Bastin" mailto:jcbas...@thelis.be>> wrote: Hello, Thank you for the answer, but I already tried other extensions. Even with « .html », the result is the same. In fact, I can put anything in TEMPLATE, I always get the base results. JCB De : Kobben, Barend (UT-ITC) mailto:b.j.kob...@utwente.nl>> Envoyé : vendredi 17 juin 2022 11:02 À : Jean-Christophe Bastin mailto:jcbas...@thelis.be>>; mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> Objet : Re: [mapserver-users] Need help/sample on how to use templating please It might be as simple as naming the template template.html instead of template.tmpl -- Barend Köbben On 17/06/2022, 10:50, "MapServer-users on behalf of Jean-Christophe Bastin" mailto:mapserver-users-boun...@lists.osgeo.org> on behalf of jcbas...@thelis.be<mailto:jcbas...@thelis.be>> wrote: Hello community, I try to find how to format click results of my MapFile. I test my WMS on QGIS. By default, infotool result looks like this : GetFeatureInfo results: Layer 'my_layer' Feature 1234: field_1 = value_1 field_2 = value_2 field_3 = value_3 … The field names are base version coming from the data source. I'm looking to change them in a more literal way, something like « My super field 1 has the great value 1 ». I found that the way to reach this is templating. I found the documentation : * https://mapserver.org/mapfile/template.html#template * https://mapserver.org/output/template_output.html?highlight=template And I looked for examples but I can't make it work, I was wondering what I'm doing wrong. Here is what I did : I created a file "my_template.tmpl" containing just two lines : MY TEST Then, in a working Mapfile, I added the TEMPLATE to my LAYER (the file "my_template.tmpl" is stored at the same level than my MapFile) : MAP ... LAYER ... TEMPLATE "my_template.tmpl" ... END END If I understand well, when I click to get informations, I should see now "MY TEST" ? But it continues to display the base informations like explained above. I also tried with OUTPUTFORMAT, but it doesn't work better : MAP OUTPUTFORMAT NAME "infotool_template" DRIVER "TEMPLATE" MIMETYPE "text/html" FORMATOPTION "FILE=my_template.tmpl" END ... LAYER ... TEMPLATE "infotool_template" ... END END I guess I do something wrong, but I can't find what. Missing parameter ? Simple/double cotes issue ? Bad names/references ? Or something about the client (QGIS in my case) asking informations ? Any help/advice will be very appreciated. Hope to have some feedback. Many thanks :-) JCB ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Need help/sample on how to use templating please
Hello, Thank you for the answer, but I already tried other extensions. Even with « .html », the result is the same. In fact, I can put anything in TEMPLATE, I always get the base results. JCB De : Kobben, Barend (UT-ITC) Envoyé : vendredi 17 juin 2022 11:02 À : Jean-Christophe Bastin ; mapserver-users@lists.osgeo.org Objet : Re: [mapserver-users] Need help/sample on how to use templating please It might be as simple as naming the template template.html instead of template.tmpl -- Barend Köbben On 17/06/2022, 10:50, "MapServer-users on behalf of Jean-Christophe Bastin" mailto:mapserver-users-boun...@lists.osgeo.org> on behalf of jcbas...@thelis.be<mailto:jcbas...@thelis.be>> wrote: Hello community, I try to find how to format click results of my MapFile. I test my WMS on QGIS. By default, infotool result looks like this : GetFeatureInfo results: Layer 'my_layer' Feature 1234: field_1 = value_1 field_2 = value_2 field_3 = value_3 … The field names are base version coming from the data source. I'm looking to change them in a more literal way, something like « My super field 1 has the great value 1 ». I found that the way to reach this is templating. I found the documentation : * https://mapserver.org/mapfile/template.html#template * https://mapserver.org/output/template_output.html?highlight=template And I looked for examples but I can't make it work, I was wondering what I'm doing wrong. Here is what I did : I created a file "my_template.tmpl" containing just two lines : MY TEST Then, in a working Mapfile, I added the TEMPLATE to my LAYER (the file "my_template.tmpl" is stored at the same level than my MapFile) : MAP ... LAYER ... TEMPLATE "my_template.tmpl" ... END END If I understand well, when I click to get informations, I should see now "MY TEST" ? But it continues to display the base informations like explained above. I also tried with OUTPUTFORMAT, but it doesn't work better : MAP OUTPUTFORMAT NAME "infotool_template" DRIVER "TEMPLATE" MIMETYPE "text/html" FORMATOPTION "FILE=my_template.tmpl" END ... LAYER ... TEMPLATE "infotool_template" ... END END I guess I do something wrong, but I can't find what. Missing parameter ? Simple/double cotes issue ? Bad names/references ? Or something about the client (QGIS in my case) asking informations ? Any help/advice will be very appreciated. Hope to have some feedback. Many thanks :-) JCB ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Need help/sample on how to use templating please
Hello community, I try to find how to format click results of my MapFile. I test my WMS on QGIS. By default, infotool result looks like this : GetFeatureInfo results: Layer 'my_layer' Feature 1234: field_1 = value_1 field_2 = value_2 field_3 = value_3 ... The field names are base version coming from the data source. I'm looking to change them in a more literal way, something like < My super field 1 has the great value 1 >. I found that the way to reach this is templating. I found the documentation : * https://mapserver.org/mapfile/template.html#template * https://mapserver.org/output/template_output.html?highlight=template And I looked for examples but I can't make it work, I was wondering what I'm doing wrong. Here is what I did : I created a file "my_template.tmpl" containing just two lines : MY TEST Then, in a working Mapfile, I added the TEMPLATE to my LAYER (the file "my_template.tmpl" is stored at the same level than my MapFile) : MAP ... LAYER ... TEMPLATE "my_template.tmpl" ... END END If I understand well, when I click to get informations, I should see now "MY TEST" ? But it continues to display the base informations like explained above. I also tried with OUTPUTFORMAT, but it doesn't work better : MAP OUTPUTFORMAT NAME "infotool_template" DRIVER "TEMPLATE" MIMETYPE "text/html" FORMATOPTION "FILE=my_template.tmpl" END ... LAYER ... TEMPLATE "infotool_template" ... END END I guess I do something wrong, but I can't find what. Missing parameter ? Simple/double cotes issue ? Bad names/references ? Or something about the client (QGIS in my case) asking informations ? Any help/advice will be very appreciated. Hope to have some feedback. Many thanks :-) JCB ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] How is working TEMPLATE fooOnlyForWMSGetFeatureInfo ?
Hi all, I don't find good explanations about the use of TEMPLATE fooOnlyForWMSGetFeatureInfo in a Mapfile. In fact, I have a queryable WMS, and when I send a GetFeatureInfo request, I get the following answer : "http://www.digitalearth.gov/wmt/xml/exception_1_0_1.dtd;> msReturnPage(): Web application error. Malformed template name (fooOnlyForWMSGetFeatureInfo). What does that mean ? I did a research on "TEMPLATE" and "fooOnlyForWMSGetFeatureInfo", but I don't find how it is used. I only find Mapfile samples using it, but nothing about what and how it is used. Someone can explain me how can I resolve this issue ? Many thanks ! JCB ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users