Re: [MapServer-users] Mapserver x k8s issue

2022-11-25 Thread Bjørn Ove Grøtan
Marcin Niemyjski via MapServer-users:
> Hello,
> 
> I'm involved in the development of a project connecting Mapserver with
> capabilities of Kubernetes like scalability, load balancing etc.
> 
> We've run into problem wich I think can be solved on the side o Mapserver,
> namely:
> 
> The k8s external IP cannot immediately be placed in "wms_onlineresource"
> because it takes time to generate it. Up to now I have checked the WMS
> operation by GetCapabilites, GetMap queries, and set "wms_onlineresource" to
> http://localhost:80/?map=/etc/mapserver/map1-test.map. I've made requests
> (GetMap GetCapabilites) via http:// Address>/?map=/etc/mapserver/map1-test.map - everything was working. However,
> when loading the layer into QGIS nothing happened. I believe this is because
> even though the queries work using url with external IP, the information that
> comes in the XML file contains localhost:80 and QGIS is trying to connect to
> a layer that does not exist locally.
> 
> Is there any way for the mapserver to know that localhost:80 must be replaced
> with the external ip address from the query?

Comment out the ows_onlineresource configuration, and Mapserver will utilize 
whatever hostname you reached it at.
That way, the same mapfile can be used in local development, test/qa and 
production without need for changing
ows_onlineresource when moving between environments.

One caveat we came across, having a reverse proxy in front of our mapserver 
(w/apache).
http->http => wms_onlineresource will use http
https->https => wms_onlineresource will use https
https->http => wms_onlineresource will use http, even though http headers for 
forward port and forward proto is set.

Other than that, you will be fine with not configuring ows/wms_onlineresource 
in your mapfile.

-- 
Kind regards 
 
Bjørn Ove Grøtan
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] readGIF error meaning ?

2022-11-25 Thread Jean-Christophe Bastin
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 
> 
> 
> 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
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


[MapServer-users] Mapserver x k8s issue

2022-11-25 Thread Marcin Niemyjski via MapServer-users
Hello,

I'm involved in the development of a project connecting Mapserver with 
capabilities of Kubernetes like scalability, load balancing etc.

We've run into problem wich I think can be solved on the side o Mapserver, 
namely:

The k8s external IP cannot immediately be placed in "wms_onlineresource" 
because it takes time to generate it. Up to now I have checked the WMS 
operation by GetCapabilites, GetMap queries, and set "wms_onlineresource" to 
http://localhost:80/?map=/etc/mapserver/map1-test.map. I've made requests 
(GetMap GetCapabilites) via http:///?map=/etc/mapserver/map1-test.map - everything was working. However, 
when loading the layer into QGIS nothing happened. I believe this is because 
even though the queries work using url with external IP, the information that 
comes in the XML file contains localhost:80 and QGIS is trying to connect to a 
layer that does not exist locally.

Is there any way for the mapserver to know that localhost:80 must be replaced 
with the external ip address from the query?

Best,
Marcin

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