[Tilecache] Tile seeding hardly slow down after projection

Damiano Morosi damiano.morosi at gmail.com
Sat Nov 29 02:34:19 EST 2008


Hi Dane,

I've followed tour suggestions, as that are also my main suspects. I've
dropped the srs = <proj literal> from tilecache config but nothing changed.
The mapnik mapfile seems correct, too:

--

<?xml version="1.0" encoding="utf-8"?>
<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0
+y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs" bgcolor="#F1EEF2">
    <Style name="My Style">
        <Rule>
        <PolygonSymbolizer>
        <CssParameter name="fill">#f2eff9</CssParameter>
        </PolygonSymbolizer>
        <LineSymbolizer>
        <CssParameter name="stroke">#808080</CssParameter>
        <CssParameter name="stroke-width">0.1</CssParameter>
        </LineSymbolizer>
        </Rule>
    </Style>
    <Style name="Green Areas">
        <Rule>
            <PolygonSymbolizer>
                <CssParameter name="fill">#B6FCB6</CssParameter>
            </PolygonSymbolizer>
        </Rule>
    </Style>
    <Style name="Water">
        <Rule>
            <PolygonSymbolizer>
                <CssParameter name="fill">#B5D0D0</CssParameter>
            </PolygonSymbolizer>
        </Rule>
    </Style>
    <Style name="Major Highways">
        <Rule>
            <MaxScaleDenominator>6000000</MaxScaleDenominator>
            <LineSymbolizer>
                <CssParameter name="stroke">#809BC0</CssParameter>
                <CssParameter name="stroke-width">.4</CssParameter>
            </LineSymbolizer>
        </Rule>
    </Style>
    <Style name="Secondary Highways">
        <Rule>
            <MaxScaleDenominator>185000</MaxScaleDenominator>
            <LineSymbolizer>
                <CssParameter name="stroke">#EB9A9B</CssParameter>
                <CssParameter name="stroke-width">.2</CssParameter>
            </LineSymbolizer>
        </Rule>
    </Style>
    <Style name="Streets 4">
        <Rule>
            <MaxScaleDenominator>70000</MaxScaleDenominator>
            <LineSymbolizer>
                <CssParameter name="stroke">#FDCC8B</CssParameter>
                <CssParameter name="stroke-width">.2</CssParameter>
            </LineSymbolizer>
        </Rule>
    </Style>
    <Style name="Streets 5">
        <Rule>
            <MaxScaleDenominator>70000</MaxScaleDenominator>
            <LineSymbolizer>
                <CssParameter name="stroke">#C0C0C0</CssParameter>
                <CssParameter name="stroke-width">.2</CssParameter>
            </LineSymbolizer>
        </Rule>
    </Style>




    <Layer name="green" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0
+lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"
bgcolor="#F1EEF2" status="1" clear_label_cache="0">
        <StyleName>Green Areas</StyleName>
        <Datasource>
            <Parameter name="file">/var/www/shapes/proj/LandUseA</Parameter>
            <Parameter name="type">shape</Parameter>
        </Datasource>
    </Layer>
    <Layer name="water" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0
+lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"
bgcolor="#F1EEF2" status="1" clear_label_cache="0">
        <StyleName>Water</StyleName>
        <Datasource>
            <Parameter
name="file">/var/www/shapes/proj/WaterPoly</Parameter>
            <Parameter name="type">shape</Parameter>
        </Datasource>
    </Layer>
    <Layer name="streets_5" srs="+proj=merc +a=6378137 +b=6378137
+lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null
+no_defs" bgcolor="#F1EEF2" status="1" clear_label_cache="0">
        <StyleName>Streets 5</StyleName>
        <Datasource>
            <Parameter name="file">/var/www/shapes/proj/Streets5</Parameter>
            <Parameter name="type">shape</Parameter>
        </Datasource>
    </Layer>
    <Layer name="streets_4" srs="+proj=merc +a=6378137 +b=6378137
+lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null
+no_defs" bgcolor="#F1EEF2" status="1" clear_label_cache="0">
        <StyleName>Streets 4</StyleName>
        <Datasource>
            <Parameter name="file">/var/www/shapes/proj/Streets4</Parameter>
            <Parameter name="type">shape</Parameter>
        </Datasource>
    </Layer>
    <Layer name="secHigh" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0
+lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"
bgcolor="#F1EEF2" status="1" clear_label_cache="0">
        <StyleName>Secondary Highways</StyleName>
        <Datasource>
            <Parameter name="file">/var/www/shapes/proj/SecHwys</Parameter>
            <Parameter name="type">shape</Parameter>
        </Datasource>
    </Layer>
    <Layer name="majHigh" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0
+lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"
bgcolor="#F1EEF2" status="1" clear_label_cache="0">
        <StyleName>Major Highways</StyleName>
        <Datasource>
            <Parameter name="file">/var/www/shapes/proj/MajHwys</Parameter>
            <Parameter name="type">shape</Parameter>
        </Datasource>
    </Layer>

</Map>

--

If you have any other hints, I'll appreciate them.
Thank you,

Damiano

2008/11/28 Dane Springmeyer <blake at hailmail.net>

> Hello Damiano,
> My first guess would be that Mapnik is attempting to reproject the data,
> not TileCache.
>
> Make sure that the proj.4 string literal you are using to specify the
> projection of your layers and the map in the Mapnik XML mapfile are exactly
> the same otherwise Mapnik will attempt to reproject internally.
>
> It is easy to miss specifying the projection for a layer in the XML and
> Mapnik will assume the proj literal of '+proj=latlong +datum=WGS84' for
> all layers unless specified.
>
> Also, I noticed that you are using the SRS= <proj literal> syntax in your
> tilecache config.  You can probably drop that because it won't affect the
> Mapnik TileCache Layer.  If you truly want to reproject your data when using
> a Mapnik TileCache Layer then you would do:
>
> projection = <proj literal>
>
> Dane
>
> On Nov 28, 2008, at 10:50 AM, Damiano Morosi wrote:
>
> Hi,
>
> I was using the following configuration for tilecache:
>
> --
>
> [cache]
> base = /tmp/tilecache
> type = Disk
>
> [basic]
> type=Mapnik
> mapfile=/var/www/mapfile.xml
> srs = EPSG:4326
>
> #---------------------#
> # Impostazione regione#
> #---------------------#
>
> bbox = 9.7,39.7,15.3,45.3
> size=600, 600
> resolutions =
> 0.0093333330,0.0046666665,0.0023333332,0.0011666666,0.0005833333,0.0002916667,0.0001458333,0.0000729167,0.0000364583,0.0000182292,0.0000091146
>
> --
>
> Now, I've projected all the shapes with ogr2ogr using with the following:
>
> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0
> +k=1.0 +units=m +nadgrids=@null +no_defs
>
> that should be the projection used by Google.
> So I changed the tilecache config:
>
> --
>
> [cache]
> base = /tmp/tilecache-proj
> type = Disk
>
> [basic]
> type=Mapnik
> mapfile=/var/www/mapfile-proj.xml
> srs = +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0
> +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs
>
> #---------------------#
> # Impostazione regione#
> #---------------------#
> bbox = 1079799,4936842,1703799,5560842
> size=600, 600
> resolutions =
> 1040.0000000000,520.0000000000,260.0000000000,130.0000000000,65.0000000000,32.5000000000,16.2500000000,8.1250000000,4.0625000000,2.0312500000,1.0156250000
>
> --
>
> and, of course, the mapnik mapfile. Now the tilecache_seed.py is taking
> about 0.9 seconds for generating a single tile, while before this
> modification the time required was about 0.02 s. All the shapes are indexed
> with shapeindex on 64 levels. It's possible that a change in the projection
> cause such a dramatical performances decrease? Or maybe tilecache is trying
> to "reproject" something?
>
> Thank you all,
>
> Damiano
> _______________________________________________
> Tilecache mailing list
> Tilecache at openlayers.org
> http://openlayers.org/mailman/listinfo/tilecache
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/tilecache/attachments/20081129/bf3da97d/attachment.html


More information about the Tilecache mailing list