Tag Info

Hot answers tagged

5

The best by far is to use one main mapfile and with the INCLUDE directive call other mapfiles (all of them being "simple and specific Map Files" btw). This will speed things up definitely, I tested that and the result is quite impressive. This idea comes from here: http://mapserver.org/es/optimization/mapfile.html "If you have a complex application, ...


4

I was looking for exactly the same thing some time ago. I did find some tools, but most of them are out of active development and only support old version of mapfile syntax. But anyway here is what I've found. Sribe UI: this is a very new project and looks promising (only support mapserver 6.0+). It is under active development but still in early phase, ...


3

Your configuration looks good. Now you need a Mapnik-looking-like style file for your server. Maybe this can help you with Geoserver: http://osgeo-org.1560.x6.nabble.com/OSM-style-SLD-files-for-GeoServer-td5015615.html A working set of sld files can be found in the osminabox sources: https://git.hsr.ch/api/rest/help/repository-root/git.html Source -> ...


3

The answer to your question is subjective (a matter of opinion) so it might be voted down (-1). Since your new to this site, I will go ahead and answer -- mapserver, open layers and postgis sql would be a very good combination for an open source solution. Geoserver is also an option instead of mapserver -- it is java based. There are also other javascript ...


3

I think this is the very example you are looking for: http://openlayers.org/dev/examples/getfeatureinfo-control.html The example is using GeoServer, but the same applies for MapServer. You may just serve the data as WMS in MapServer, and on client side create a OpenLayers.Layer.WMS layers instead of OpenLayers.Layer.MapServer, then just do as the sample ...


3

ST_Intersects checks if 2 geometry really intersects && checks if the BBox of both geometries intersect. This use only the index if available. That's why it is really really fast. For the SRID error look at this answer: http://gis.stackexchange.com/a/12082/22703


3

The most common way to style OpenStreetMap data is with a Mapnik stylesheet. I'm going to assume you're doing so here. There are a number of different pieces of software that handle rendering tiles with Mapnik and could meet your needs. Three popular ones are Tilemill Tilemill is designed for developing map styles, but also allows you export tiles for a ...


3

This is a comparison between multiple tiles and single tile using WMS in OpenLayers: var map = new OpenLayers.Map({ div: "mapDiv", layers: [ new OpenLayers.Layer.WMS( "Single Tile", "http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: "basic"}, {singleTile: true, ratio: 1} ), ...


2

I am not aware that you have a converter from Mapnik to Mapserver mapfile styles. You will really need a lot of tools for what you expect. OSM world has his own set of tools because of their DB complexity and storage (XML) I don't recommend to use Shapefile for rendering OSM data. If you need lot of custom styles, the shp don't give you all the attributes ...


2

If you are a first time user, you should definitely install mapserver using provided packages rather than compiling from source. sudo apt-get install mapserver is what you need. If you want a more recent version of mapserver, you should consider adding the ubuntugis repository first: sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable sudo apt-get ...


2

probably what you need is to set both OFFSITE and TRANSPARENCY in the layer section, something like this: LAYER NAME 'Raster' TYPE RASTER CONNECTIONTYPE postgis CONNECTION "user=postgres password=... dbname=... host=..." DATA "bytea FROM rasters" STATUS OFF OFFSITE 0 0 0 TRANSPARENCY 100 END being OFFSITE the color you want to be transparent and ...


2

map.setCenter( new OpenLayers.LonLat(1.147, 52.472).transform( new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject() ), 5 ); you're mixing things like above. If Mapserver is serving your Postgis data set in EPSG:3857, you don't need EPSG:4326 in your mapfile. The EPSG:4326, ...


2

Update: Found one for Notepad++. You might have to tweak it a bit as it might be for an old version of Mapserver. Cheers! You'd have to create your own definition if you insist on using Notepad++. You might want to check mscompanion though. It has a WYSIWYG mapfile editor and you can instantly visualize your changes. You can find the installer at Google ...


2

Looking at your call to L.tilelayer.WMS(), i'm noticing that you're passing an option with a key of 'SRS'. The leaflet docs list an option 'CRS': http://leafletjs.com/reference.html#tilelayer-wms-crs You may be attempting passing in an option that doesn't exist. That being said, you're trying to overlay a WMS in geographic unprojected 4326 against an OSM ...


2

Thanks to your hints I found the solution elsewere. Maybe it also helps others: If OSM data is imported into PostGIS with osm2pgsql the resulting attribute names containing colons (addr:streetname etc.) must be renamed. Otherwise WFS server is creating invalid XML. osm2pgsql is converting some tags into attributes, and WFS server is converting attributes ...


2

Since you already have solution 2 (Mapserver+OpenLayers) working I will just suggest how to improve the performance. The key is to add a caching subsystem between mapserver and Open Layers so that when the same imagine is retrieved twice from Mapserver the caching subsystem will return the previously generated one, saving lots of cpu and disk time. With ...


2

To my knowledge, there is no way to do that directly with mapserver. I have not tested this, but given you are using postgis you can probably get something close to what you want by creating a POINT layer and a specially crafted postgis query to extract the first point of each linestring. This would be something like: layer type point name ...


2

You cannot get information for features within a bbox using a WMS getFeatureInfo. Please have a look at the WMS reference for getFeatureInfo. You will see that according to the standards, you can only pass in points, not a bbox. Instead, you could use a getFeature Operation on the WFS service. The BBOX parameter allows you to search for features ...


2

As Julien pointed out in a comment, you should make sure you have defined a valid FONTSET and reference one of its fonts in your layer. Indeed, the images you are showing are using BITMAP labels (which are the default if not overridden in the mapfile), which do not support rotation. Here's a minimal set of keywords you might want to try: map ... fontset ...


2

This might help you move forward: by default, MapServer uses "ms:" as a prefix, and http://mapserver.gis.umn.edu/mapserver as a namespace: featurePrefix: "ms", featureNS: "http://mapserver.gis.umn.edu/mapserver" OpenLayers might/did have some quirks when specifying both of these, so you might want to try setting only one of those at a time, c.f. ...


2

In MapServer, your PostGIS LAYER can contain a subquery. This is the recommended way to do it. Note that your subquery must return all fields you are using in your layer label, class, etc. CONNECTIONTYPE POSTGIS CONNECTION "dbname=yourdatabasename user=yourdbusername" DATA "geom from (SELECT geom, attr1, attr2 FROM country WHERE country = 'usa') as subquery ...


2

Try removing the 'as FOO' statement at the end of the select statement, it is not needed. As a reference this is the template for an Oracle Spatial DATA definition with a select instruction: 'geometry_column FROM (SELECT stmt) [USING UNIQUE <column> SRID srid# FUNCTION]' the parts in square parenthesis are optional. Reference retrieved straight ...


1

I just tried your configuration and it worked for me, both the mapfile and the mapcache config. I suspect that your mapcache is not configured properly with the mapcache.xml. Since you did get an error message, the request is sent to MapServer and it simply doesn't find your layer in the mapfile. Please make sure you point to the right mapfile in the ...


1

Variable substitution works with WMS, it is however not compliant with the WMS spec itself. Given you want to show all species in your capabilities document, i.e. be somewhat compliant with the WMS spec, you either have the option of, as you said, creating your hundred layers, or using the "dimension" support that was added in version 6.2, c.f. ...


1

you can use PRIORITY in LABEL: For LABEL (http://mapserver.org/es/mapfile/label.html): PRIORITY [integer]|[item_name]|[attribute] The priority parameter takes an integer value between 1 (lowest) and 10 (highest). The default value is 1. It is also possible to bind the priority to an attribute (item_name) using square brackets around the ...


1

There is a new functionality in QGIS Desktop > 1.8 (you need to download the master). You can add a HTML map tip or just choose one of the field to display. I also installed the nightly build of QGIS Server on my ubuntu server and I set "useGetProjectSettings" to true in GlobalOption.js in QGIS Web Client. I now can see the value of a chosen field in QGIS ...


1

Set UNITS dd in the MAP level. Big thank you to fellow user from MapServer mailing list. He was saying UNITS dd is automatically set using WMS, but not MapServer. Good to know. "You are probably missing a "UNITS dd" at the map level. It works with WMS because the SRS included in the WMS call will set the map.units to dd automatically."


1

Not sure what you mean by "And see multyple layer images on map" but for a start you are creating a Leaflet WMS tile layer, without having a WMS service setup in your mapserver configuration. See docs and the example in @sunil link for more info.


1

Mapserver needs the explained below to work correctly with SQL Server 2008. This is the code from MapServer. FLT_MAX is const and FLT_MAX=3.40282e+038 /* Get the layer extent as specified in the mapfile or a largest area */ /* covering all features */ int msMSSQL2008LayerGetExtent(layerObj *layer, rectObj *extent) { if(layer->debug) { ...


1

I solve this problem. But i cant paste all configuration files here becouse too much text lines. I post in here: http://dotrem.blogspot.ru/2013/06/mapservernginxfastcgi-on-ubuntu.html. Maybe its help to someone.



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