Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am developing a web mapping application based on OpenLayers and using a WMS layer from MapServer (the source data for this layer is stored in PostGIS database) and I am facing the following problem: MapServer eliminates a lot of features at the lowest zoom levels.

Zoom Level 10: Zoom Level 10

Zoom Level 7: Zoom Level 7

Zoom Level 5:
Zoom Level 5

Zoom Level 4:
Zoom Level 4

Zoom Level 3:
Zoom Level 3

I guess it is because MapServer doesn't display features with area less than one pixel. Is it possible to render such features at lowest zoom levels (for example as one pixel features)?

UPD.: I'm talking about orange features, green ones - it is part of OSM tiles.

Here is my mapfile:

MAP
SIZE 800 600
MAXSIZE 4096

IMAGECOLOR 255 255 255
IMAGETYPE PNG

OUTPUTFORMAT
    NAME "png"
    EXTENSION "png"
    MIMETYPE "image/png"
    DRIVER AGG/PNG
    IMAGEMODE RGBA
    FORMATOPTION "INTERLACE=OFF"
END

EXTENT -180 -90 180 90
PROJECTION
    "init=epsg:4326"
END

WEB
    METADATA
        wms_onlineresource "${request.route_url('mapserver.ows')}"
        wfs_onlineresource "${request.route_url('mapserver.ows')}"
        ows_title "mcx_pk"
        wms_enable_request "*"
        # ows_service_onlineresource  "${request.route_url('mapserver.ows')}"
        wms_srs "epsg:4326 epsg:3857 epsg:900913"
    END
END

LAYER
    NAME "fields"
    CONNECTION "user=pk password=******* dbname=pk host=***.info"
    CONNECTIONTYPE postgis
    PROCESSING "CLOSE_CONNECTION=DEFER"
    DATA "wkb_geometry from mask_f using unique ogc_fid using srid=4326"
    TYPE line
    DUMP TRUE
    TEMPLATE dummy.html
    PROJECTION
        "init=epsg:4326"
    END
    EXTENT -180 -90 180 90
    METADATA
        gml_include_items   "all"
        wms_include_items   "all"
    END
    CLASS
        STYLE
            COLOR 255 136 0
        END
    END
END
share|improve this question
    
I think you should clarify your question by pointing out the features in your map that are not drawn (and should be). I.e.: by looking at the images one does not understand whether you're talking about the orange or green ones. –  unicoletti Dec 26 '11 at 21:39
    
Ok, I've modified my question. –  drnextgis Dec 26 '11 at 23:53
    
thanks, do you think you can share the map file? It might have to do with scale-dependent rendering (ie layers hidden at certain scales) –  unicoletti Dec 27 '11 at 7:32
    
I've shared part of my mapfile which contains layer description. –  drnextgis Dec 27 '11 at 8:07
add comment

4 Answers

Try adding WIDTH 1 to your STYLE block.

share|improve this answer
    
While I have no problem with gis.stackexchange, you will get much better support by posting mapserver related questions to the mapserver mailing list. –  Stephen Woodbridge Dec 30 '11 at 18:25
add comment

You could try creating a new POINT layer of the feature centroids, and set this layer to be visible when zoomed out.

You could then also use the new CLUSTERING functions when points are too close together.

share|improve this answer
add comment
up vote 2 down vote accepted

Undocumented feature fixed my problem:

  PROCESSING "APPROXIMATION_SCALE=FULL"

For more details see ticket #4143

share|improve this answer
add comment

OKay so what you need is to use SLD (Styled Layer Descriptors ). These are basicaly xml structured files where you can specify the design and control the rendering of a wms layer. IN context of your question, you can specify which fetures to render at which zoom level. So for the road network layer, in its sld you can specify at which zoom levels you want to render this layer. check this out:

http://mapserver.org/ogc/sld.html

share|improve this answer
    
I'm not sure SLD can help me, because I have features at all zoom levels, but at the lowest zoom levels MapServer doesn't draw many of them. –  drnextgis Dec 27 '11 at 5:43
    
from sld you can make those one pixel features render larger may be assigning image icon (just suggestion) or you can represent the point with more pixels. also you decide pixel sizes on each zoom level. –  Shaunak Dec 27 '11 at 6:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.