On Oct 7, 2009, at 11:19 PM, Balram wrote:

>
> Hi Dane,
> Thanks for your reply.
>
> I have tried with estimate_extent & extent parameter.
>
> Now my average rendering time is decreased to 20 sec.

Great, thats better than 5-6 minutes :)

> For all layers in my python script I am using following stuff:
>
> Power_lyr.datasource = PostGIS(host='localhost',  
> dbname='postgis_europe',
> user='balram', password='decos', table="(select way from  
> planet_osm_line
> where power='line') as
> power 
> ",estimate_extent 
> ='false',extent='-20037508,-19929239,20037508,19929239')
>
> Power_lyr.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 +nadgri...@null +no_defs +over"
>
> and after that I am doing
>
> m 
> .zoom_to_box 
> (Envelope(3.06293548889,51.1743208093,6.5670669221,52.4263865259))
>

Interesting. So your data is stored in mercator and your map is long/ 
lat? That will require reprojection of the geometries during rendering  
and will be much slower that if you have your Map projection the same  
as your input data.

> to zoom to netherlands map.
>
> Being honest, I don't know exact meaning of value passed to "extent"
> parameter. I have supplied this value which I found on mapnik forum.
>

That is the extent of your layer's features in the coordinates of the  
input geometry. Those ones you pulled from the mapnik forum are the  
extent of (nearly) the whole world in spherical mercator  
(+proj=merc....).

To understand more about this try: 
http://weait.com/content/map-tiles-and-bounding-boxes

> Could you please explain me in more detail "extent" parameter? What  
> extent
> value shall I specify for europe data for each layer?
>

Also, try seeing the extent of the planet_osm_line by doing:

$ psql postgis_europe
# select ST_Extent(way) from planet_osm_line;

... which is essentially what PostGIS will do in the background if you  
have 'estimate_extent'=False and do not provide the 'extent' parameter.

Dane

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to