Updated OsmPlugin (markdown)

tmcw 2011-12-13 08:45:29 -08:00
parent 0a34edfff1
commit 68488c2c8d

@ -1,10 +1,4 @@
<!-- Name: OsmPlugin -->
<!-- Version: 27 -->
<!-- Last-Modified: 2010/11/13 10:24:18 -->
<!-- Author: kunitoki -->
Mapnik's PluginArchitecture supports the use of different input formats.
Mapnik's [[PluginArchitecture]] supports the use of different input formats.
This plugin allows for the direct reading of data from the [OpenStreetMap XML format](http://wiki.openstreetmap.org/wiki/.osm). You can use it in two different ways; you can either render a local file, or connect to a URL which provides OSM XML data within a given bounding box.
@ -34,7 +28,7 @@ Your layer's Datasource must have a "type" parameter with a value of "osm", in a
For example:
#!xml
```xml
<Layer name="roads" status="on" srs="+proj=latlong +datum=WGS84">
<StyleName>residential</StyleName>
<StyleName>unclassified</StyleName>
@ -46,6 +40,7 @@ For example:
<Parameter name="file">test2.osm</Parameter>
</Datasource>
</Layer>
```
## Specifying the data's source
@ -54,7 +49,7 @@ OSM data may be sourced from two different places: a file (as in the example abo
For a web data source, we must provide two parameters: the base URL and the bounding box in WGS84 latitude/longitude. These two parameters are named "url" and "bbox". The full URL of the OSM data server will be constructed from the base URL with the bounding box added as a query string. Here is an example:
#!xml
```xml
<Layer name="roads" status="on" srs="+proj=latlong +datum=WGS84">
<StyleName>residential</StyleName>
<StyleName>unclassified</StyleName>
@ -67,6 +62,7 @@ For a web data source, we must provide two parameters: the base URL and the boun
<Parameter name="bbox">-0.8,51,-0.7,51.1<Parameter>
</Datasource>
</Layer>
```
In the above example, the full URL of the OSM data server would be `http://www.osmdataserver.com/data.php?bbox=-0.8,51,-0.7,51.1`. Data will be downloaded from this URL and rendered according to the rules in the style file.
@ -75,7 +71,7 @@ In the above example, the full URL of the OSM data server would be `http://www.o
Styling the output is done in the same way as for other data sources, with tests for different tags done in the `<Filter>` tag. For example this rule will match OSM ways where the 'highway' tag is equal to 'path' and the 'foot' tag is equal to 'designated':
#!xml
```xml
<Rule>
<Filter>[highway] = 'path' and [foot] = 'designated'</Filter>
<LineSymbolizer>
@ -93,7 +89,7 @@ Styling the output is done in the same way as for other data sources, with tests
<CssParameter name="stroke-linecap">round</CssParameter>
</LineSymbolizer>
</Rule>
```
## Lines or polygons?