4

How can I prevent features being clipped at tile boundaries in an WMS layer as per the picture

enter image description here

The arrow and line segments are being clipped when viewed in openlayers as a WMS layer. The map file is as follows:-

      MAP
              NAME "WMSROUTETEST"
              CONFIG "PROJ_LIB" "/opt/company/servers/halo/company-global/site/web/conf/mapfiles"
              FONTSET "/opt/company/servers/halo/company-global/site/web/conf/resources/fonts/fonts.list"
              SIZE 400 300
              EXTENT 517531.000000071 139263.350999558 566460.000000404 185808.999999165
              STATUS ON
              UNITS METERS
              #RESOLUTION 72
              SIZE 580 400
              MAXSIZE 8192
              IMAGETYPE png
              OUTPUTFORMAT
                      NAME png
                      DRIVER AGG/PNG
                      IMAGEMODE RGB
                      MIMETYPE "image/png"
                      EXTENSION "png"
                      FORMATOPTION "INTERLACE=OFF"
                      FORMATOPTION "QUANTIZE_FORCE=on"
                      FORMATOPTION "QUANTIZE_COLORS=256"
                      FORMATOPTION "COMPRESSION=9"
                      TRANSPARENT ON
              END
              PROJECTION
                      "init=epsg:27700"
              END
              WEB
                  METADATA
                      WMS_TITLE            "department Route"
                      "wms_srs"            "EPSG:27700" 
                      "wms_enable_request" "*" 
                  END
                  IMAGEPATH "/opt/company/servers/halo/company-global/site/web/public/tmp/"
                  IMAGEURL "/tmp/"
              END

              SYMBOL
                      NAME "arrow"
                      TYPE vector
                      FILLED true
                      POINTS
                          0 0.4
                          1 0.4
                          1 0
                          2 0.8
                          1 1.6
                          1 1.2
                          0 1.2
                          0 0.4
                      END # POINTS
                      ANCHORPOINT 1 0.5
              END # SYMBOL

              SYMBOL
                NAME "square"
                TYPE vector
                FILLED true
                POINTS
                  0 4
                  4 4
                  4 0
                  0 0
                END # POINTS
                ANCHORPOINT 0 0.5
              END # SYMBOL



              LAYER
                      NAME "departmentrouteworkerline"
                      GROUP "departmentrouteworker"
                      METADATA
                          WMS_TITLE "department Route"
                      END

                      TYPE LINE
                      CONNECTIONTYPE postgis
                      #EXTENT -6 50 6 60
                      CONNECTION "host=localhost port=5432 dbname=company user=postgres password=GOAWAYNASTYHACKERS"
                      STATUS OFF
                      #Must validate an item if to be used in query
                      VALIDATION
                        'worker' '^[0-9]+$'

                      DATA "wkb_geometry from (SELECT work_item_sequence as seq, count(work_item_sequence), (st_collect(route_line)) as wkb_geometry FROM ng_department.worker_%worker%_route_table GROUP by work_item_sequence ORDER by work_item_sequence ASC ) AS FOO using unique seq using srid=27700"
                      EXTENT 517531.000000071 139263.350999558 566460.000000404 185808.999999165
                      LABELITEM 'seq'
                      #This prevents labesl being repeated across tiles
                      PROCESSING 'LABEL_NO_CLIP=True'
                      PROCESSING 'POLYLINE_NO_CLIP=True'
                      OPACITY 80

                      CLASS
                              #Route Line Style
                               STYLE
                                  COLOR 255 255 255
                                  ANTIALIAS true
                                  WIDTH 8
                                  LINECAP round
                               END 
                               STYLE
                                  COLOR 0 0 0
                                  ANTIALIAS true
                                  WIDTH 3
                                  LINECAP round
                                  PATTERN 40 10 END
                                END 
                              #Route arrows
                              STYLE
                                #GEOMTRANSFORM "start"
                                GAP -300.0
                                COLOR 128 128 128
                                OUTLINECOLOR 0 0 0
                                SYMBOL "arrow"
                                SIZE 18.0
                                ANGLE AUTO
                              END # STYLE

                      END


              END

      END

Additionally I have some symbols like the one below that do not sit perfectly on the line, can these be nudged in some way?

enter image description here

  • I think this is caused by a bounding box issue. The geometry from postgres only exists in the first tile, but widening the line and creating the symbol pushes it into the one above it. Somehow I need to tell the tile about this fact! – user1331131 Mar 13 '14 at 11:34
1

There are two techniques known as Metatiles and Metabuffer for solving such issues. Unfortunately MapServer doesn't support them out of box so you should use intermediate tile server (MapCache, MapProxy, etc.) Also you can use untiled version of your WMS.

  • Cannot be done as the WMS uses HTTP Request parameters which are lost when implementing a proxy such as mapcache – user1331131 Mar 13 '14 at 11:16
  • MapProxy has forward_req_params option for forwarding request parameters to the source server. mapproxy.org/docs/nightly/sources.html#forward-req-params MapCache has the same feature. – drnextgis Mar 14 '14 at 2:02
  • Are you sure mapcache has this facility? It looks to me as if mapcache simply proxies the request to the WMS and hence would not act on the metatiles/metabuffer facilities therefore negating its usefulness. – user1331131 Mar 14 '14 at 11:31
  • MapCache page declares support ability to specify vendor params mapserver.org/mapcache – drnextgis Mar 14 '14 at 13:15
  • Those are fixed parameters I believe not HTTP request params – user1331131 Mar 14 '14 at 17:21
-1

What abput "tile_map_edge_buffer" and "tile_metatile_level" metadata params?

I was able to solve a similar problem, drawing points with png icons. The icons appeared cutted in adjacent tiles, but using "tile_map_edge_buffer" and "tile_metatile_level" metadata params in mapfile was the solution. Also you need to pass the follow request params:

mode=tile
tilemode=gmap (it can be bing too) 
tile=${x}+${y}+${z}

So the better way is using a XYZ Layer instead a WMS Layer (OpenLayers)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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