Updated Shapefile Plugin (markdown)
parent
9b588dd349
commit
90f51aa64c
1 changed files with 6 additions and 7 deletions
13
ShapeFile.md
13
ShapeFile.md
|
@ -4,8 +4,6 @@
|
||||||
<!-- Author: springmeyer -->
|
<!-- Author: springmeyer -->
|
||||||
# Shapefile Plugin
|
# Shapefile Plugin
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
This plugin supports reading shapefiles. They can also be read using the [[OGR]] Plugin, but the *shape* plugin is better tested and more mature.
|
This plugin supports reading shapefiles. They can also be read using the [[OGR]] Plugin, but the *shape* plugin is better tested and more mature.
|
||||||
|
|
||||||
The shapefile plugin will run fastest if you build indexes for your shapefiles using the 'shapeindex' command line tool installed when you build Mapnik.
|
The shapefile plugin will run fastest if you build indexes for your shapefiles using the 'shapeindex' command line tool installed when you build Mapnik.
|
||||||
|
@ -16,10 +14,11 @@ For other plugins see: PluginArchitecture
|
||||||
|
|
||||||
To check if the raster plugin built and was installed correctly you can do:
|
To check if the raster plugin built and was installed correctly you can do:
|
||||||
|
|
||||||
|
```python
|
||||||
>>> from mapnik import DatasourceCache as c
|
>>> from mapnik import DatasourceCache as c
|
||||||
>>> 'shape' in c.plugin_names()
|
>>> 'shape' in c.plugin_names()
|
||||||
True
|
True
|
||||||
|
```
|
||||||
|
|
||||||
# Parameters
|
# Parameters
|
||||||
|
|
||||||
|
@ -41,8 +40,7 @@ Plugin datasource initialization example code can be found on PluginArchitecture
|
||||||
|
|
||||||
A Shapefile datasource may be created as follows:
|
A Shapefile datasource may be created as follows:
|
||||||
|
|
||||||
|
```cpp
|
||||||
#!C
|
|
||||||
{
|
{
|
||||||
parameters p;
|
parameters p;
|
||||||
p["type"]="shape";
|
p["type"]="shape";
|
||||||
|
@ -54,11 +52,11 @@ A Shapefile datasource may be created as follows:
|
||||||
lyr.add_style("vector");
|
lyr.add_style("vector");
|
||||||
m.addLayer(lyr);
|
m.addLayer(lyr);
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
== XML ==
|
== XML ==
|
||||||
|
|
||||||
|
```xml
|
||||||
#!xml
|
|
||||||
<Layer name="vector" srs="+init=epsg:4236">
|
<Layer name="vector" srs="+init=epsg:4236">
|
||||||
<StyleName>polygon</StyleName>
|
<StyleName>polygon</StyleName>
|
||||||
<Datasource>
|
<Datasource>
|
||||||
|
@ -67,5 +65,6 @@ A Shapefile datasource may be created as follows:
|
||||||
<Parameter name="file">/path/to/your/shapefile.shp</Parameter>
|
<Parameter name="file">/path/to/your/shapefile.shp</Parameter>
|
||||||
</Datasource>
|
</Datasource>
|
||||||
</Layer>
|
</Layer>
|
||||||
|
```
|
||||||
|
|
||||||
## Further References
|
## Further References
|
||||||
|
|
Loading…
Reference in a new issue