Skip to main content
100%

Get a static map from a viz.json using python

✓ Published0🌍 Public
Aandrewxhill
Last edited Apr 14, 2016
Created on Apr 14, 2016

This example generates a static map image from a CartoDB visualization JSON file using Python. It extracts the map’s center, bounds, zoom level, and visible layer definitions from the viz.json, then constructs a new map configuration with a dark basemap. The code uses the `requests` library to fetch the JSON and the CartoDB Maps API to create a named map, ultimately printing a URL for a static center-positioned PNG at 800x500 pixels.

AI-generated description

Similar vizzes