Hi Nguyen,

>>
>> If you do not set the projection Mapnik assumes it is in WGS84 or  
>> epsg 4326,
>> which is the projection of the world_borders shapefile.
> I've change the structure and put it here:
> http://aoclife.ddo.jp/~vuhung/foss/mapnik/mapnik-vietnam.2008-11-21.tar.gz
> just download and run make( hopefully it work!).
>

Yes, it does work. Although I noticed that you need to associate a  
style with the 'national_roads'  layer that only contains a  
LineSymbolizer since the PolygonSymbolizer applied to this line  
dataset creates some odd results :)

Try this:

s,r = Style(),Rule()
r.symbols.append(LineSymbolizer(Color('red'),0.5))
s.rules.append(r)
m.append_style('national_roads',s)
lyr2 = Layer('national_roads')
lyr2.datasource = Shapefile(file='../shp/national_roads')
lyr2.styles.append('national_roads')
m.layers.append(lyr2)

>> You'll also notice that the code snippet you are using saves the XML
>> representation of the map you are creating in python. Taking a look  
>> at the
>> XML output can often help catch typos that prevent a style or layer  
>> from
>> being properly added to the map.
> XML file is included in
> http://aoclife.ddo.jp/~vuhung/foss/mapnik/mapnik-vietnam.2008-11-21.tar.gz
>

Right. Also be aware that the save_map() function cannot overwrite the  
previous xml output, so make sure to delete the XML each time your run  
your Makefile so that you can see the change in the XML from your  
script.  Looks like you could modify your makefile to be:

all:
        rm map/hello_vietnam.xml
        cd py; /usr/bin/python vietnam.py


> I have no idea if the shp data I am using is of WGS84. How can I  
> check?
>

You can either download QGIS and then click on the layer properties  
(of your loaded data) where you can find projection information. Or  
you can use the ogrinfo tool:

http://www.gdal.org/ogr/ogrinfo.html

Essentially both those programs will do their best to read the  
projection information from the .prj file that accompanies the other  
files making up the shapefile.

However, it looks to me like your layers .prj are hand edited and  
perhaps a bit messed up.

Can I ask, where did you get these files?

Dane


>
> -- 
> Best Regards,
> Nguyen Hung Vu ( Nguyễn Vũ Hưng )
> [EMAIL PROTECTED] , YIM: vuhung16 , Skype: vuhung16dg
> A brief profile: http://www.hn.is.uec.ac.jp/~vuhung/ 
> Nguyen.Vu.Hung.html

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

Reply via email to