Does anyone know of a way to batch convert shapefiles to jpegs or another common image format?
edit: I should have clarified that I would like to apply a styling to each shapefile, and then export the shapefile with that styling to an image.
For example, I have census tracts in a county, and I want an image of each individual tract highlighted while the other tracts are all the same color.
Answer
There are many free tools like:
But in Python, the reference is Mapnik and Getting Started In Python
- You create a map (width and height in pixels, background color, etc)
- You create Styles which determines how the data is rendered
- You add a datasource (shapefile, etc.) and create a layer from it.
- You render the map
- the same map and styles parameters can be applied to multiple files (via an XML file)
see the examples in Mapniks Maps
Simple Rendered images from TM_WORLD_BORDERS-0.3.shp
selection of a country (Angola) in the shapefile:
Another example from Mapniks Maps
No comments:
Post a Comment