Creating maps

We have the data that we need to begin building the map for our report. Our approach will be the following steps:

  • Enhancing the elevation and base map images with filters
  • Blending the images together to provide a hillshaded OSM map
  • Creating a translucent layer to draw the street route
  • Blending the route layer with the hillshaded map

These tasks will all be accomplished using the PIL Image and ImageDraw modules:

# Convert the numpy array back to an image relief = Image.fromarray(shaded).convert("L") # Smooth the image several times so it's not pixelated for i in range(10): relief = relief.filter(ImageFilter.SMOOTH_MORE) log.info("Creating map image") # Increase the hillshade contrast to make # it stand out more e = ImageEnhance.Contrast(relief) ...

Get Learning Geospatial Analysis with Python - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.