Automate SHP to JPG creation

There are many free tools like:

  • gdal rasterize
  • Map Tyler
  • it is easy to do with Python and modules like Shapely and a simple for loop: enter image description here

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

enter image description here

selection of a country (Angola) in the shapefile:

enter image description here

Another example from Mapniks Maps

enter image description here


You could add all of the layers to a mxd, then loop through them and run

arcpy.mapping.ExportToJPEG(map_document, out_jpeg, {data_frame}, {df_export_width}, {df_export_height}, {resolution}, {world_file}, {color_mode}, {jpeg_quality}, {progressive})

for each layer in the map.


This similar question has answers that use FME to convert DWG to JPG. The process will be similar for converting shapefiles.

This example has example workspaces you can download.

FME is well suited to handling batch processes. For example, you can point the reader to a folder and it will include all shapefiles in the folder.

I created a simple workflow which reads all the shapefiles in a folder and writes them out to separate JPGs.

workflow