[OSM-dev] Many Layers Visible at Low Zoom-Levels for Rendering of Planetfile

Dane Springmeyer dane at dbsgeo.com
Mon Apr 4 07:10:43 BST 2011


Hi Matt,

Thanks, you found a bug :). You can restrict the visibility of layers either by setting scale limits on the actual Layer or by using Min/Max ScaleDenominators in Style Rules. The latter is what is used in osm.xml, and it appears I forgot to add support for this in nik2img. The inspection of every rule for every style in a layer was commented and only the general layer visibility was being reported which is not what you are looking for. So, grab nik2img trunk and this should now be fixed [1].

Dane



[1] http://code.google.com/p/mapnik-utils/source/detail?r=1101

On Apr 3, 2011, at 11:37 PM, Matt Kenny wrote:

> Hello,
> 
> If this isn't the proper mailing list to post this question, I
> apologize in advance.
> 
> I'm currently working with a group of individuals from the Cascadia
> Users of Geospatial Open Source (CUGOS) OS-Geo Chapter on creating our
> own OSM planet server. We currently have the planet file imported and
> updating, and are performing basic rendering using mod_tile + renderd
> with mapnik2.
> 
> I'm experiencing some strange behavior in regards to rendering tiles
> at low zoom-levels (e.g. Zoom Level 4). Specifically, it appears that
> a number of layers are being rendered at these small-scales which
> should actually not be rendered based on the 'MaxScaleDenominator'
> values in my mapnik2 stylesheet. As all these layers are being
> rendered across such a large spatial extent, render times are
> extremely long.
> 
> Utilizing Dane Springmeyer's nik2img.py [1] utility in combination
> with the osm.xml stylesheet [2] (our version is upgraded for mapnik2
> syntax), I've produced the following log file [3]. AFAIK, a number of
> these layers should not be rendering (reported as visible) at
> zoom-scale 4. For example, the reported MapScaleDenominator via the
> nik2img log is, '22363290.3714'. With this in mind, I went ahead and
> searched my osm stylesheet for the 'MaxScaleDenominator' for one of
> the layers I assumed should not be rendering at zoom-scale 4,
> 'piers-area'. The following snippet shows that the MaxScaleDenominator
> parameter has a value much lower then the the reported
> MapScaleDenominator at zoom-scale 4.
> 
> <Style name="piers-area">
>    <Rule>
>      <MaxScaleDenominator>200000</MaxScaleDenominator>
>      <PolygonSymbolizer fill="#f2efe9"/></Rule>
> </Style>
> 
> Additionally, this same behavior is occurring using a different
> stylesheet, the osm-bright style by AJ Ashton of Development Seed. The
> nik2img logfile for the same location and zoom can be found here [4].
> 
> So... after all that, my questions are essentially:
> *    Is it correct in assuming that all these layers should _not_ be
> listed as visible when rendering an image via nik2img at such a low
> zoom-level?
> *    If so, what might be causing the disconnect between the layers
> that nik2img is reporting as visible for this mapscale versus the
> layers' own MaxScaleDenominator values in my stylesheets? Could it be
> a projection issue? Maybe something I'm introducing during the use of
> upgrade_map_xml.py to convert mapnik -> mapnik2 syntax?
> 
> Thanks for any advice. I'd be happy to provide any further
> supplementary/clarifying info.
> 
> -Matt
> 
> [1]: http://code.google.com/p/mapnik-utils/wiki/Nik2Img
> [2]: http://svn.openstreetmap.org/applications/rendering/mapnik
> [3]: http://pastebin.com/QDQ701nZ
> [4]: http://pastebin.com/6HMpMvWb
> --
> m a t t h e w k e n n y
> http://www.mkgeomatics.com
> 
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev




More information about the dev mailing list