[mapserver-users] Usage: PROCESSING FORCE_DRAW_LABEL_CACHE=FLUSH

lars.schylberg at blixtmail.se lars.schylberg at blixtmail.se
Mon Oct 26 15:25:00 PDT 2015


				
Some more things that I just remembered: 


Certain rules that You should have think about when You are flushing the label cache.  The automatic label placement will be final for the underlying layers when the label cache is flushed.  You have to be sure that new labels in the following layers have polygon features underneath.  If You are using GROUP for the WMS layers, be sure to have the command PROCESSING "FORCE_DRAW_LABEL_CACHE=FLUSH"  in a GROUP that is always drawn.




/ Lars Schylberg


-----Originalmeddelande-----
Från: lars.schylberg at blixtmail.se
Till: mapserver-users at lists.osgeo.org
Datum: 2015-10-26 22:54
Ämne: [mapserver-users] Usage: PROCESSING FORCE_DRAW_LABEL_CACHE=FLUSH


Since I mentioned the command "PROCESSING FORCE_DRAW_LABEL_CACHE=FLUSH" in a previous entry I thought it could be good to describe how it is used. Maybe this could be the basis for some description in the manual.

In my mind this is best improvement in Mapserver 7.0


The use case:

To produce a WMS service where You could zoom in from a very small scale like Europe down to a very detailed city map. You only have detailed data in certain parts.

One data set larger area like the Nordic countries 1:1M, one data set a nation like Sweden 250K and one detailed data set over one town 50K. I don't have detailed data in the other countries and I only have town data covering one town.

The usage is like this:

Draw all layers in the small scale data set without any MAXSCALEDENOM.

Do a FORCE DRAW LABEL CACHE

Draw all layer in the 250k data set on top with a MAXSCALEDENOM=500000, or whatever is good for each layer when You would like to turn on your data.

Do another FORCE DRAW LABEL CACHE

Draw all the layers in the 50k town data set on top of that with a MAXSCALEDENOM=70000

The following mapfile shows the principle for using the command. The example shows the effect of using and not using the FORCE DRAW LABEL CACHE command. Just run the example with shp2img.

----------------------------------------------------------------------------------------------------------------------------------------

MAP
 NAME FDLC

# Author: Lars Schylberg,  2015-09-26
#
# Requires Mapserver 7-0
#
# shp2img -m force_draw_label_cache.map -o without_force_label_cache.png -s 500 300 -e -80 42 -74 46 -l "towns big_city"
#
# Result is that the unwanted red Big City label is showing up on top of the Big city polygon.
#
# shp2img -m force_draw_label_cache.map -o with_force_label_cache.png -s 500 300  -e -80 42 -74 46 -l "towns force_cache big_city"
#
# Result is the wanted, label cache is drawn after the towns layer and the big_city polygon can draw its new label.
#
 PROJECTION
  "init=epsg:4326"
 END

 SYMBOL
  NAME "circle"
  TYPE ellipse
  FILLED true
  POINTS
    1 1
  END
 END

 WEB
  METADATA
   "ows_enable_request" "*"
   "ows_title" "foo server"
  END
 END

 LAYER
  NAME "towns"
  STATUS ON
  TYPE POINT
  FEATURE
    POINTS -75 45 END
    TEXT "Village"
  END
  FEATURE
    POINTS -79 43 END
    TEXT "Town"
  END
  FEATURE
    POINTS -77 44 END
    TEXT "Big City"
  END
  FEATURE
    POINTS -75 43 END
    TEXT "Village2"
  END 
  FEATURE
    POINTS -79 45 END
    TEXT "Town2"
  END
  CLASS
   NAME "PopulatedPlaces"
   STYLE
    SYMBOL "circle"
    SIZE 10
    COLOR 10 10 0
   END
   LABEL
     SIZE large
     COLOR 255 0 0
     POSITION AUTO
     FORCE TRUE
   END
  END
 END # Layer
 
 LAYER
    NAME "force_cache"
    TYPE POINT
    PROCESSING "FORCE_DRAW_LABEL_CACHE=FLUSH"
    TRANSFORM FALSE
    STATUS ON
    FEATURE
      POINTS 1 1 END
    END
 END  # Layer
 
 LAYER
    NAME "big_city"
    TYPE POLYGON
    FEATURE
       POINTS
        -78 44.5 
        -76 44.5 
        -76 43.5 
        -78 43.5  
        -78 44.5
       END
       TEXT 'Big City'
    END
    CLASS
       STYLE
          COLOR 255 250 0
       END
       LABEL
        SIZE giant
        COLOR 0 0 0
        POSITION AUTO
        FORCE TRUE
      END 
    END
  END # Layer
END # Map








_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

-- 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20151026/e433b7d7/attachment-0001.html>


More information about the mapserver-users mailing list