[mapserver-users] Using different datasets at different scales in the same layer

lars.schylberg at blixtmail.se lars.schylberg at blixtmail.se
Mon Oct 26 14:39:18 PDT 2015


				
Hi Andrea,

There are several ways to think about this. I had about the same issue two years ago. 




One way to get organized is to use ScribeUI (http://mapgears.github.io/scribeui/) or only the scribe preprocessor. Julien-Samuel Lacroixgave a good  talk about this at FOSS4G in Portland and I talked about this in my presentation at FOSS4G in Portland. The videos is available online.


That gives You the possibility to define different cartography in different zoom levels and even use different data sets in different zoom level.  It is like SCALETOKENs but even more sophisticated.




Another way is to use separate WMS layers for different zoom levels and assemble everything with cascading WMS calls. There is good description in the German Mapserver Pro TIPPS  from this year and last year (German FOSS4G) how this is done.  There are performance penalties for using this method.




A third option is to use brute force and draw small scale cartographic layers first then just continue to draw larger scale layers on top based on MAXSCALEDENOM.  This requires that You have areas that are covering.  This is a good approach if You have a national data set and then larger scale regional data set that is just patches, i.e. covering parts of the small scale national data set.  Using this method, you could still show the national large scale data where no regional data is available.




This is the method I prefer right now.  There WAS a problem with this approach before that labels in the label cache could get mixed up.  That was that labels from the national data set could show up in the larger scale presentation since the label cache is drawn last.  But with Mapserver 7.0 there is a new processing command called “PROCESSING FORCE_DRAW_LABEL_CACHE=FLUSH”.




The usage is that I draw all layers in the national data set, then I include a dummy layer that flushes the label cache and then I continue to draw the more detailed data on top.




This is in my mind the biggest improvement in Mapserver 7.0 !!!!! Thanks to Daniel and all the other developers.




In my current use case I have 6 different sets of cartography (more and more detailed) with about 20 – 50 layers in each set.  I am doing label cache flush in between each set of layers.  I get excellent performance with this method.




A fourth option would be to use the the brute force method but to preprocess all your labeling layers and mask out the labels with holes in the large scale data set where the more detailed data comes on top.  This is quite complicated to do,. so I prefer the third method with flushing the cache. 




A fifth option to organize things is to use an approach like the “basemap example” (https://github.com/mapserver/basemaps)  to combine a lot of layers. 


Have fun

Lars Schylberg



-----Originalmeddelande----- 
> Från: "Andrea Peri" <aperi2007 at gmail.com> 
> Till: mapserver-users at lists.osgeo.org 
> Datum: 2015-10-22 22:14 
> Ämne: [mapserver-users] Using different datasets at different scales in the same layer 
> 
> Hi,
> 
> Often we serve huge datasets in our wms services.
> To have a faster response, we usually done a secondary hidden layer
> with a simplified dataset and
> serve both using a group of two layers with complementary scales.
> 
> This allow the serve to use the simplified dataset for lower scale and
> detailed dataset for higher scales.
> 
> But this structure is boring and error prone to configure.
> 
> I guess more better should be if possible
> have one only layer and declare in it two distinct datasets.
> One for lower scale and the other for higher scale.
> 
> Is possible to do something like this in mapserver ?
> 
> Thx.
> 
> -- 
> -----------------
> Andrea Peri
> . . . . . . . . .
> qwerty àèìòù
> -----------------
> _______________________________________________
> 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/28715b6d/attachment.htm>


More information about the MapServer-users mailing list