0

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>
3
  • how does the code you post relate to the issue? Do you get any errors, which python libraries are you using? Please edit the question to add more detail
    – nmtoken
    Commented Dec 23, 2018 at 8:38
  • can not load any data ?
    – amin
    Commented Dec 23, 2018 at 9:48
  • i was created table spatial_ref_sys and geometry_columns
    – amin
    Commented Dec 23, 2018 at 9:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.