Jon Burgess-2 wrote:
>
> On Wed, 2009-01-14 at 00:09 -0800, NileshPasalkar wrote:
>> I want to zoom map depends upon to Lat long value what I found is only
>> one
>> function take lat long value as param which is Query_Map_point. I don;t
>> found the relevant information for this function so if any body has any
>> idea about what this function does please let me know,
>
> You need to create a bounding box envelope with the map co-ordinates and
> then call the map zoom, for a fairly simple example see:
>
> http://trac.openstreetmap.org/browser/applications/rendering/mapnik/generate_image.py
>
> Jon
>
>
> _______________________________________________
> Mapnik-users mailing list
> [email protected]
> https://lists.berlios.de/mailman/listinfo/mapnik-users
>
>
Hi Jon Burgess,
I have tried with the boundary box but I don;t able to use it. I have out
put with blank image this is the code I have done for it
from mapnik import *
from mapnik import Projection, Coord
m = Map(600,300,"+proj=latlong +datum=WGS84")
m.background = Color('rgb (205, 227, 237)')
s = Style()
s1 = Style()
r=Rule()
r1 = Rule()
r.symbols.append(PolygonSymbolizer(Color('rgb (241, 243, 209)')))
road_stroke = Stroke(Color('brown'), 0.2)
road_stroke.line_cap = line_cap.ROUND_CAP
road_stroke.line_join = line_join.ROUND_JOIN
road_stroke.add_dash = True
road_stroke.width = 1.5
r.symbols.append(LineSymbolizer(Color('red'),0.1))
r1.symbols.append(LineSymbolizer(road_stroke))
s.rules.append(r)
m.append_style('My Style',s)
lyr1 = Layer('Lines')
lyr1.datasource = PostGIS(host='localhost', dbname='template_postgis',
user='nilesh.pasalkar', password='decos',
table='planet_osm_line',estimate_extent='false')
lyr1.clear_label_cache = True
lyr1.styles.append('My Style')
m.layers.append(lyr1)
lyr2 = Layer('Lines')
lyr2.datasource = PostGIS(host='localhost', dbname='template_postgis',
user='nilesh.pasalkar', password='decos',
table='planet_osm_point',estimate_extent='false')
lyr2.styles.append('My Style')
m.layers.append(lyr2)
lyr3 = Layer('Lines')
lyr3.datasource = PostGIS(host='localhost', dbname='template_postgis',
user='nilesh.pasalkar', password='decos', table='planet_osm_polygon',
estimate_extent='false')
lyr3.styles.append('My Style')
m.layers.append(lyr3)
roads34_lyr = Layer('Roads')
# create roads datasource (we're going to re-use it later)
roads34_lyr.datasource = PostGIS(host='localhost',
dbname='template_postgis', user='nilesh.pasalkar', password='decos',
table="planet_osm_roads",estimate_extent='true')
roads34_lyr.queryable= True
roads34_lyr.datasource.filter = Filter("[name] = 'asdasda'")
s1.rules.append(r1)
roads34_lyr.styles.append('RoadStyle')
m.append_style('RoadStyle',s1)
m.layers.append(roads34_lyr)
En = Envelope(-50,-50,1000,1000)
m.zoom_to_box(En)
render_to_file(m,'world.png', 'png')
This is my code but in which i have user Envelope but it doesn't give me the
required out put image.
Can u help me in this
--
View this message in context:
http://www.nabble.com/Query_map_point-tp21451563p21472237.html
Sent from the Mapnik - Users mailing list archive at Nabble.com.
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users