Cường Văn kirjoitti 2017-03-01 10:56:
> Thank you Jukka, let's me clarify what I understand from your answer:
>
> - Mapnik does not even try to read data: for example, postgis return
> some data, which includes some redundant value from Norway, and I
> define extent value belong to Switzerland, the area I want tiles are
> rendered, so mapnik will base on extent value and skip reading data
> from Norway.
Not quite so. Mapnik will never read data (features) from Norway if you
render Switzerland because it knows by the spatial index which features
it must read for rendering the desired tile. But if you define that
extent is bounding box of Switzerland and you render tiles from Norway,
then Mapnik skips the whole layer without communicating with PostGIS at
all. The saving is that there is no need to make a query from spatial
index which is fast but still takes some time.
Actually, by reading the documentation Mapnik is using the default
extent "determined by querying the metadata for the table" so not even a
query from the spatial index is performed. Thus the saving that is left
comes from taking a connection from pool and readin one line from the
metadata which means that it is very fast. I would guess that in normal
cases it is not worth the trouble to play with extent setting at all.
Rendering itself is the heavy part and most time is spent for that.
> - Extent value is defined to limit the area on map for rendering tile,
> so it just affects on rendering time, not fetching data from db time.
> It leads to that if I do not provide extent value, mapnik will draw
> whole map, even if some tiles is transparent due to no data. so I
> should provide suitable extent value to optimize rendering time.
Extent has no effect on what area will be rendered. It is only a
shortcut for Mapnik to deside if it simply skips the layer or if it will
try to find data for the tile from the database. It is a layerwise
setting, so if you have some global layers like shoreline they will be
rendered to the tiles of Norway even if some layer containing data
merely from Switzerland is skipped.
-Jukka-
>>>
https://github.com/mapnik/mapnik/wiki/PostGIS [1] is insufficient
>> for me
>>> (a newbie to geographic area), whether this property affect to
>>> rendering performance or not and how I can get the suitable value
>> for
>>> extent, in my case, I just render tile for specific area on the
>> map.
>>>
>>> Really appreciate to receive any feedback from you guys, Thank you
>> in
>>> advance.
>>>
>>> Regard.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>
>>> Groups "mapnik" group.
>>> To unsubscribe from this group and stop receiving emails from it,
>> send
>>> an email to
mapnik+un...@googlegroups.com.
>>> For more options, visit
https://groups.google.com/d/optout [2].
> Links:
> ------
> [1]
https://github.com/mapnik/mapnik/wiki/PostGIS
> [2]
https://groups.google.com/d/optout