[OSM-dev] Using Mapnik to generate tiles from shapefiles

Artem Pavlenko artem at pavlenko.uklinux.net
Fri Jan 5 09:12:54 GMT 2007


HI Nick,

> Have managed to get this working, so hopefully it should be possible to get
> OSM rendering done using shapefiles cutting out the postgresql.
Great!
> At the moment I put all the style rules in the python script (decided to go
> with python in the end) - if I put them in an XML file as you did with the
> Postgresql solution, would I have to write my own parser or is there a
> standard Mapnik xml format?
Yes, there is. It is not documented but you can see all tags/attributes in 
$(mapnik_src)/src/load_map.cpp

Here is _incomplete_ schema : 

# mapnik schema (compact RelaxNG)

start = element Map { 
    attribute bgcolor { xsd:string }?,
    style*, 
    layer* 
}

style = element Style {
    attribute name { xsd:string }, 
    rule*
}
    
rule =  element Rule {
    attribute name { text }?,
    attribute title { text }?,
    ( filter? &            
      element MinScaleDenominator { xsd:double }? &
      element MaxScaleDenominator { xsd:double }? &
      symbolizer* )                                     
}*

filter |= element Filter { xsd:string }
filter |= element ElseFilter { empty }

symbolizer |= point_symbolizer 
symbolizer |= line_symbolizer 
symbolizer |= polygon_symbolizer 
symbolizer |= text_symbolizer 
symbolizer |= raster_symbolizer 
  
point_symbolizer = element PointSymbolizer {      
    css_parameter*      
}

line_symbolizer = element LineSymbolizer {   
    css_parameter*       
}

polygon_symbolizer = element PolygonSymbolizer {
    css_parameter*
}

text_symbolizer = element TextSymbolizer {
    empty
}
  
raster_symbolizer = element RasterSymbolizer {
    empty
}

css_parameter = element CssParameter  {
    attribute name { string },
    string
}

layer = element Layer {
    attribute name { text },
    attribute status { "on"|"off" },
    ( datasource & 
      element StyleName { xsd:string }*)
}

datasource = element Datasource  {
    element Parameter {
        attribute name { xsd:string },
        xsd:string
    }+
}

 
Cheers,
Artem


>
> Nick
>
>
>
>
>
>
> ___________________________________________________________
> Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with
> voicemail http://uk.messenger.yahoo.com




More information about the dev mailing list