I want to connect Mapnik to MSSQL Spatial SDE, but I don't know how to do this.
import mapnik
m = mapnik.Map(256,256)
mapnik.load_map(m, "test.xml")
m.zoom_all()
mapnik.render_to_file(m, "2.png")
xml code is:
<Map background-color="#ffffff00" srs="+init=epsg:3857">
<Style name="My Style">
<Rule>
<PolygonSymbolizer fill="blue" />
<LineSymbolizer stroke="red" stroke-width="0.1" />
</Rule>
</Style>
<Layer name="world" srs="+init=epsg:3857">
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">ogr</Parameter>
<Parameter name="string">MSSQL:server=xxxx;database=xxxx;UID=xxxx;PWD=xxxxx</Parameter>
<Parameter name="layer_by_sql"> SELECT top 10 Shape FROM dbo.xxxx</Parameter>
<Parameter name="extent">0 ,0,0, 0</Parameter>
</Datasource>
</Layer>
</Map>