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")
mapnik.render_to_file(m, "2.png")

xml code is:

 <Map background-color="#ffffff00" srs="+init=epsg:3857">
  <Style name="My Style">
      <PolygonSymbolizer fill="blue" />
      <LineSymbolizer stroke="red" stroke-width="0.1" />
  <Layer name="world" srs="+init=epsg:3857">
    <StyleName>My Style</StyleName>
<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>

  • 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 Dec 23 '18 at 8:38
  • can not load any data ? – amin Dec 23 '18 at 9:48
  • i was created table spatial_ref_sys and geometry_columns – amin Dec 23 '18 at 9:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.