Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Ejemplo python-mapnik
FROM ubuntu:20.04
RUN apt-get update -y && apt-get install -y apt-utils
RUN apt-get install -y python3-mapnik
COPY . .
<Map background-color="blue" srs="+init=epsg:4326">
<Style name="My Style">
<PolygonSymbolizer fill="#f2eff9" />
<LineSymbolizer stroke="rgb(50%,50%,50%)" stroke-width="0.1" />
<Layer name="world" srs="+init=epsg:4326">
<StyleName>My Style</StyleName>
<Parameter name="type">postgis</Parameter>
<Parameter name="host"></Parameter>
<Parameter name="dbname">curso</Parameter>
<Parameter name="user">curso</Parameter>
<Parameter name="password">curso</Parameter>
<Parameter name="table">(select geom from countries) as "table"</Parameter>
import mapnik
m = mapnik.Map(1024, 1024)
mapnik.load_map(m, "map.xml")
mapnik.render_to_file(m, "map.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment