Re: [mapserver-users] passing variables to includes
To solve this problem, i've used an scaletoken with multiple parameters (sorted). SCALETOKEN NAME "%f%" VALUES "0" "2|1" "100" "2|1" END END And inside my query string to postgis, I've substitued these sorted value into a sub select and I split with the '|'. DATA "the_geom from (SELECT table.*, d.* FROM table, (select split_part('%f%','|',1)::integer as p1,split_part('%f%','|',2)::integer as p2)as d ) as subquery using unique cod_instl srid=3857" -- Sent from: http://osgeo-org.1560.x6.nabble.com/Mapserver-User-f4226646.html ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Rewrite rule problem
Hi Andreas, As you sugested I have added in* httpd.conf* file following SetEnvIfExpr "%{QUERY_STRING} =~ /^(.*&)?map=([[:alnum:]]+.map)(&.*)?$/" MS_MAPFILE=C:/ms4w/apps/Demo/$2 RewriteRule /cgi-bin/Demo/wms /cgi-bin/Demo/wms?MAP=MS_MAPFILE [PT,QSA] and when I put URL http://localhost:81/cgi-bin/Demo/wms?map=N1.map=GetCapabilities=WMS=1.3.0 I receive the following message: msLoadMap(): Unable to access file. (N1.map) As addition in the C:/ms4w/httpd.d folder I have file httpd_Demo.conf file with following content Alias /Demo/ "/ms4w/apps/Demo/" AllowOverride None Options Indexes FollowSymLinks Multiviews Order allow,deny Allow from all What I'm doing wrong. Best regards, Goran -- Sent from: http://osgeo-org.1560.x6.nabble.com/Mapserver-User-f4226646.html ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] How to control the mime-type of MapCache-WMS outputformats
Hi, We found on issue when updating MapCache to version 1.6 from some ancient version. We have png-format configured to 8-bit by limiting the number of colors like fast 256 Now the WMS service is advertising this format with mime type "image/png; mode=8bit". However, we have existing applications which make GetMaps with plain "=image/png" and that used to work with the old MapCache version. Is there a way to override the mime type with the MapCache config file? I can see a promising section in the RFC 119 http://mapserver.gis.umn.edu/development/rfc/ms-rfc-119.html mvt application/vnd.mapbox-vector-tile However, it is not clear from the documentation if mime_type configuration is supposed to work also for the image formats, and in which MapCache version. -Jukka Rahkonen- ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Rewrite rule problem
Hi, I guess you should use SetEnvIfExpr to test the query string for the MAP parameter and set the environment variable using the value. Wrap it into a block to do this only for a specific URI: SetEnvIfExpr "%{QUERY_STRING} =~ /^(.*&)?map=([[:alnum:]]+.map)(&.*)?$/" MS_MAPFILE=C:/ms4w/apps/Demo/$2 IHMO this won't work though as MapServer's msCGILoadMap() function prefers the MAP param and uses the MS_MAPFILE environment variable only as a fallback. As MS first checks if the MAP parameter points to the name of an environment variable containing the map file and scans the query parameters from left to right you can prepend a fake MAP parameter pointing to MS_MAPFILE. For example a request to /cgi-bin/Demo/wms?map=N1.map=GetCapabilities Needs to be written as /cgi-bin/Demo/wms?map=MS_MAPFILE=N1.map=GetCapabilities You can do this using a RewriteRule like RewriteRule /cgi-bin/Demo/wms /cgi-bin/Demo/wms?MAP=MS_MAPFILE [PT,QSA] HTH > -Ursprüngliche Nachricht- > Von: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] Im > Auftrag von gorank > Gesendet: Samstag, 28. Oktober 2017 16:55 > An: mapserver-users@lists.osgeo.org > Betreff: Re: [mapserver-users] Rewrite rule problem > > Hi Jeff, > > Many thanks for your answer. I test it and works and solve my problem > when > have only one mapfile in the project. But when I have few mapfiles in > the > folder Demo under apps folder (C:/ms4w/apps/Demo) , how should look > statement in SetEnvIf ? > > When i try for different mapfiles > > SetEnvIf Request_URI "/cgi-bin/Demo/wms" > MS_MAPFILE=C:/ms4w/apps/Demo/N1.map > SetEnvIf Request_URI "/cgi-bin/Demo/wms" > MS_MAPFILE=C:/ms4w/apps/Demo/N2.map > > the URL > http://localhost:81/cgi- > bin/Demo/wms?REQUEST=GetCapabilities=WMS=1.3.0 > opens XML for second mapfile - N2.map, and I suppose the second SetEnvIf > statement overwrite the first one. > > So, what is solution, in the URL to be included specific mapfile name, > like > http://localhost:81/cgi- > bin/Demo/wms?*map=N1.map*=GetCapabilities=WMS=1. > 3.0 > for first mapfile and > http://localhost:81/cgi- > bin/Demo/wms?*map=N2.map*=GetCapabilities=WMS=1. > 3.0 > for second mapfile? > > Best regards, > Goran > > > > -- > Sent from: http://osgeo-org.1560.x6.nabble.com/Mapserver-User- > f4226646.html > ___ > 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