Hot answers tagged

5

There are two mode in MapServer in fact and it can be confusing for end users without knowledge about the project history. The first one, the now mostly outdated mode cgi (the url contains mode=browse) way where you don't rely on standards OGC webservices. It was supported in OpenLayers 2 by default because of history (more Mapserver instances not using ...


4

You can render your data from PostgreSQL directly. Documentation here. PostgreSQL layer example: LAYER NAME "province" STATUS ON TYPE POLYGON CONNECTIONTYPE POSTGIS CONNECTION "host=127.0.0.1 port=5432 dbname=xyz user=postgres password=postgres" DATA "the_geom from xyz" CLASS STYLE COLOR 128 128 128 ANTIALIAS true END ...


4

According to a recent comparison of different mapping engines in performing tile seeding (see Section 4.3), MapServer should be much faster than GeoServer. Is there any re-projection of geometries in your rendering stack? An old version of MapServer might have the same issue with proj4 lib as Mapnik had.


3

Kaarel´s answer should be marked as the correct answer. You need to call the loadFeatures function from the AJAX call. I created three jsfiddle to demonstrate ol 3.5.0 calls via AJAX for ol.format.GeoJSON (JSON and JSONP) as well as ol.format.WFS. WFS http://jsfiddle.net/goldrydigital/9d3jzpna/ JSON http://jsfiddle.net/goldrydigital/ucspgvx0/ JSONP ...


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

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.


2

Found one on GitHub : MapserverSyntaxHighlighting It adds a user defined language in N++ (check this, if you want to create your own). Just put the two files given here : userDefineLang.xml -> %appdata%\Notepad++ mapfile.xml -> %programfiles(x86)%\Notepad++\plugins\APIs You may need to restart N++ or reopen the mapfile.


2

I just faced the same problem and solved it by copy the mapscript.py and _mapscript.so into my virtual env. cd venv/lib/python2.7/site-packages cp /usr/lib/python2.7/dist-packages/_mapscript.so . cp /usr/lib/python2.7/dist-packages/mapscript.py . At least the following script in a python web-app worked fine, based on the mapserver demo files I got here. ...


2

Gery, 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 ...


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

I think you mix up OSGEo4W and MS4W. These are different packages for Windows. OSGeo4W is a source for several FOSS4G project, among other MapServer and QGIS. MS4W contains programs, tools necessary to run/maintain a MapServer instance on Windows (Apache, Mapserver, Mapserver utilities, several libraries). You can use any of them but do not mix them up.


2

I just remembered the last time I used 8-bit signed for anything, and now I feel very old! :) QGIS doesn't appear to support 8-bit signed (nor does gdal) - see the list of supported types here. The byte type is unsigned, so will be interpreted as such. Not familiar with Mapserver, but I imagine the issue is the same. I think you might need to write some ...


2

You can´t use the files you got there directly since they are not supported in Qgis or by MapServer. The Styling informations are within the .lyr and .lyr.xml files. There are Export-Tools that you can export the styling to .sld format which is readable by the umn-mapserver. (for example: arcmap2sld.i3mainz.hs-mainz.de) Not sure if the tools work without ...


1

The mapserv binary created needs to have —rwxr-xr-x permissions to be able to execute so if needed you can change permissions using: #chmod 755 mapserv To test you have compiled mapserv with all appropriate options you can check the version: #./mapserv —v you should get an output like: MapServer version 5.6.4 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG ...


1

Always study the manual (I have to repeat it twice everyday to myself) http://openlayers.org/en/v3.7.0/apidoc/ol.source.ImageWMS.html In ol.source.ImageWMS(opt_options) parameter ratio does the trick. As stated 1 means image requests are the size of the map viewport, 2 means twice the size of the map viewport, and so on. Default is 1.5.


1

I have used an arrow symbol as: SYMBOL NAME "arrow" TYPE vector FILLED true POINTS 0 0.4 3 0.4 3 0 5 0.8 3 1.6 3 1.2 0 1.2 0 0.4 END # POINTS ANCHORPOINT 1 0.5 END # SYMBOL This style adds an arrowhead to endpoints of lines ...


1

I actually found that by using GAP -20 instead of INITIAL GAP 20, the symbols are not cut... The sign « - » allows symbols to follow lines orientation. But the spacing between symbols is not regular at all. I will post another question on this topic specifically.


1

As one last check I set selinux to Permissive and was able to connect. This is not how I want to leave it, so now to the selinux logs to get the proper context for apache and map server.


1

I not an expert on the internal workings of MapServer, but basically as I understand it you use a single .map configuration file as the basis of multiple service types; so you can in theory have one input data source, one .map file and from this provide a WMS, WFS, SOS, WCS (in multiple different versions) and also use the CGI variables to provide some ...


1

This is not exactly what you asked for, but it could be a suitable starting point for your heatmap. I created a simple python script for converting geohashes to 3d Google Earth representations. This isn't exactly what you asked for, but if you'd like to create a cool looking thematic map (based on geohash) this will get you started. You can get the code ...


1

The topology extension has to be CREATEd separately: CREATE EXTENSION postgis_topology; As to why also your raster functions fail: could you verify you are trying to use a version of PostGIS with raster support compiled in? (see http://www.postgis.net/docs/RT_FAQ.html#idp61635392)


1

You have done right way because you got this message. mapserv(): Web application error. Traditional BROWSE mode requires a TEMPLATE in the WEB section, but none was provided. You just need to add some GET parameter in url... like this (depend on your mapfile content): ...


1

Separate multiple layers in your request with a comma: http://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getfeature&TYPENAME=continents,cities&MAXFEATURES=500


1

If you want to cache tiles from the backend WMS without having to know the layer names beforehand use either "combined_mirror" or "split_mirror" mode. This doesn't seem to be properly documented, but it is mentioned in this issue "combined_mirror" makes a tileset for each combination of layers encountered. "split_mirror" will make a tileset for each layer ...


1

Here's an example of a MapServer service (version 7.1-dev) providing a WCS 2.0 service using GeoTiffs as the data source. Here we have a GetCoverage request for an image/png output format: ...


1

You try to add an image layer, but your request states getCapabilities (the service description document). You probably mean GetMap ? I don´t understand your url (It does not look standard WMS to me), but I would try something like url : 'http://localhost/cgi-bin/mapserv.exe', layers: 'villages' parameters:{service:"WMS", version:"1.1.1", ...


1

This is a feature of the Web Map Service (WMS) interface standard through the use of a GetFeatureInfo request. In your web server software, you need to make the layer queryable.


1

Yes you can configure multiple projections that your service will support in your map file, as part of the METADATA block of either your MAP in which case the projections apply to all layers, or in your LAYER in which case the projections apply to just that layer. METADATA ... "WMS_SRS" “EPSG:4326 EPSG:3857 EPSG:27700 EPSG:4258” # Change above to meet ...


1

MapServer is software for creating services that create maps on request by a client. In other words you can't display a map IN MapServer, you can only get MapServer to provide a map for a some client, such as a JavaScript web based map client built using OpenLayers, or a Desktop client like QGIS.


1

I suggest you to use MapProx (http://mapproxy.org/) which does what you need. Alternatively, see this answer which develops your procedure a bit further: How do I create a mapserver config file for tiles downloaded from WMTS service? .



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