Hot answers tagged

6

Mapfiles are good for making standard WMS, WFS and WCS services. They are mostly stable even some limited set of the mapfile parameters can be changed on-the-fly by using the variable substitution mechanism. Static mapfiles are enough for serving data to GIS clients like ArcGIS, QGIS, OpenJUMP etc. and also for browser applications made with OpenLayers or ...


6

You can set up GeoWebCache to request WMS layers from any WMS server. This may be easiest with a standalone install of GWC but should be possible in the integrated version too. You need to edit the configuration file, see the manual for more detail. Alternatively you can use the GeoServer WMS datastores to cascade requests to the MapServer instance and the ...


4

place this in your map file under MAP > WEB: METADATA WMS_ENABLE_REQUEST "*" END


4

You can setup OUTPUTFORMAT declarations which leverage MapServer's use of OGR for custom output formats (including CSV, GeoJSON). See the documentation for further details. Update: this does not appear to be the case for GetPropertyValue requests, only GetFeature requests.


4

The map file is an internally referenced parameter, it should only be referenced using a file path, not a URL. On Apache, you can use SetEnvIf to remove it from your URL, something like: SetEnvIf Request_URI "/cgi-bin/mapserver/mapserv.exe" MS_map file=C:/mapserver/umbe/mapfile/test7.map


4

The mapfile exporter plugin https://plugins.qgis.org/plugins/rt_mapserver_exporter/ is deprecated so unfortunately you can't create mapfiles with QGIS. It might be possible if you can install some very old QGIS version, like 2.6 or less but even then the plugin does not make mapfiles which work with MapServer versions 7.x without some manual fixes. Other ...


4

You can't use SLD to internally style a MapServer WMS map, you'll have to use the STYLE directives. However MapServer will take an SLD as part of a GetMap request, either by reference (you link to a URL of the SLD), using the SLD=[your link to your SLD]& parameter or directly as part of the SLD_BODY=[your SLD]& parameter. You can review this in a ...


3

The plugin is still alive, now named RT mapserver exporter: https://plugins.qgis.org/plugins/rt_mapserver_exporter/ To get it, you need to allow for experimental plugins, and you need the python-mapscript package on Linux (part of the ubuntugis mapserver package), or the mapscript-python package from OSGEO4W on Windows. If you run into troubles, see QGis ...


3

I am in a similar situation. I don´t need to hide or show the different rasters separately. If that's OK for you, this is what I did: As far as I know, in the mapfile - Layer - Data you can only specify one file, but you can create several identical layers with the very same name, each one of them pointing to a different raster. Loading this WMS layer shows ...


3

Looks like there's no current indent implementation for map files so you'll most likely have to write your own. However, if you're not already aware mapserver.org provides both syntax coloring and folding vim plugins. The files were written a while ago, so you may need to tweak it or find a newer one. To install: mkdir ~/.vim/syntax/ cd ~/.vim/syntax ...


3

This is WKB (Well known binary). You can read the definition here: https://en.wikipedia.org/wiki/Well-known_text#Well-known_binary For use in Postgis, see PostGIS: parse geometry wkb with OGR


3

As MapServer doesn't deal internally with SLD's, any SLD's given to it externally have to be parsed before being applied, unless you already have a tool for creating SLD, using SLD's with MapServer for providing the default styling is probably not the way to go. I would just use SLD's just for creating custom maps as the result of some on-the-fly query only....


2

Add the following to your mapfile. It should work. LAYER ------- POSTLABELCACHE FALSE PROCESSING "LABEL_NO_CLIP=ON" LABELCACHE ON ----- LABEL ------- PARTIALS TRUE MINDISTANCE 50 REPEATDISTANCE 9999 -------- END END


2

You can send a new request with parameters that override the symbol color. See here Changing map file parameters via a form or a URL You can also highlight one ore more features. See here SLD based selection on WMS layers


2

You can change the projection of the mouse coordinates very simply using the OpenLayers.Control.MousePosition 'displayProjection' parameter (see the documentation). For example, I have a map in EPSG900913 but can display my coordinates in EPSG:4326 like this: new OpenLayers.Control.MousePosition({ prefix: 'You are here: ', separator: ' | ', ...


2

Your layer names specification is wrong, try it this way: var mslayer = new OpenLayers.Layer.MapServer ( "MapServer Layer", "http://localhost/cgi-bin/mapserv?map=/var/www/osm-demo/mapserver-utils-svn/osm-google_test.map&", {'layers': ["land0","borders0","places0","land1"]} ); Basically it is an array of strings, not a single string. In ...


2

I don't know why you have set EPSG:42304 as projection. This value is not defined in the SRS list or the EPSG registry. EPSG:3059 has the same parameters as your WKT definition. You have to add it to your list of wms_srs to allow requests in that srs. EDIT Looking at your WMS request: Why do you send &SRS=EPSG:3059%20 ? Can you try without %20?


2

Where did you get the FEATURE POINTS 1 1 END END from? This draws a point at x=1 y=1, and not at the coordinates from your shapefile:


2

You'll want to do a spatial join in the DATA statemet DATA "geom from (SELECT poly.gid, poly.geom, Count(gid) AS ptcount FROM poly JOIN pts ON ST_Intersects(poly.geom, pts.com) GROUP BY poly.gid, poly.geom) using unique gid" If your data aren't changing very often, doing this for every map draw is probably not a good ...


2

for ubuntu users : open software center and search "python-mapscript" and install "python library for MapServer" and enjoy using "RT mapserver exporter".


2

Ok, this is not really a GIS related but rather a programming related question. Anyway, for your intended purpose you can use almost any language you like. Here is a very, very simple PHP script based on the example Mapfile from the documentation at http://www.mapserver.org/mapscript/php/by_example.html. In this script only the variable DATA is altered: <...


2

In MapServer you can group layers together using the GROUP directive in the LAYER part of your map file. So for an India service, you might have MAP NAME "India" LAYER NAME "Andhra_Pradesh" END LAYER NAME "Arunachal_Pradesh" END LAYER NAME "Assam" END LAYER NAME "Bihar" END # etc......


2

With MapServer the pixel value of a raster layer that should be interpreted as "nodata" and which should therefore be transparent is defined in the LAYER section of mapfile with the OFFSITE parameter. This is explained in MapServer documention at http://mapserver.org/mapfile/layer.html?highlight=offsite%20raster.


2

Expressions in MapServer are rather messy from users point of view even the documentation at http://www.mapserver.org/mapfile/expressions.html may feel fine for MapServer developers. What user must know is that datatypes matter and syntax is different for numbers and strings. For strings both the attribute name and its value must be quoted EXPRESSION ('[...


2

No. You may create a form for file upload from the browser, but you need server side script to process uploaded data or you can use ftp/scp to upload files to the server.


2

MapServer supports LAYERS=all as CGI parameter, but not in the WMS interface. But you can use the name of the root layer, which is "MS" by default, and can be set with the wms_rootlayer_name metadata property.


2

As far as I can see MapManager doesn't really handle INCLUDE files. You can open a map file with INCLUDES if you supply full paths like below (no relative paths worked for me) "C:\\apps\\MapManager\\templates\\symbols.sym" BUT Once opened the resultant map file used by MapManager includes all the included content. That is you have one map file, ...


2

@david-osipyan I used your question as the excuse needed to create new documentation for GeoJSON access in MapServer, with a new page visible now at: https://mapserver.org/input/vector/geojson.html I hope that helps the next person coming along, in the MapServer community :) By the way, it was so nice to read here in an earlier comment from you that MS4W is ...


1

Here is the solution, found myself, and not obvious at all in the documentation: add a OUTLINECOLOR to the LABEL tags! CLASS NAME "myLayer" EXPRESSION ([code] = 1) STYLE SYMBOL "STD_circle" COLOR 0 255 0 END LABEL FONT "vera" TYPE TRUETYPE SIZE 3 COLOR 0 0 0 ...


1

It's weird because I never had any problem with this feature. If you take a look at https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&outputFormat=geojson&typename=pvo_patrimoine_voirie.pvostationvelov you will notice MapServer produces geojson with double-quoted strings which can handle single ...


Only top voted, non community-wiki answers of a minimum length are eligible