How to upload your own map
In Datawrapper choropleth and symbol maps, you can upload and use your own custom maps. You might want to visualize data on a map that is highly tailored to your needs, for example, to show your regional administrative areas which are not available as a map in our collection. In this article, we explain how to create and prepare your map and then upload it in Datawrapper.
⚠️ This article is for advanced users.
If you've never worked with geodata such as Shapefiles or GeoJSON before, this article might be a bit tricky. Even if you have relevant experience, preparing maps can take some time. We already offer more than 2000 maps, so make sure that your map does not yet exist in Datawrapper before creating it.
Our map creator Anna is also happy to upload a map for you (if we think that this map would be useful for other Datawrapper users as well.) You can get in touch with her at email@example.com if you would like a specific map to be added to the list.
- 1. Find geodata
- 2. Load the data into Mapshaper & check your IDs
- 3. Bring the data into WGS-84
- 4. Aggregate polygons & set interior points
- 5. Simplify the data & export
- be in the TopoJSON or GeoJSON format (we recommend TopoJSON) and be a valid JSON file (check validity with this online tool).
- be smaller than 2MB. The larger your file, the longer it takes for your map to load for those who are viewing your map. We recommend simplifying the map until it's smaller than 500KB.
- have at least one layer with at least one region.
- have regions as polygons (for example, administrative boundaries).
- have IDs for these regions.
- use the WGS-84 coordinate system (EPSG:4326 projection).
- polygons with the same ID are aggregated.
- you set the central points as the interior point (that's only necessary if you want to make use of labels).
1. Find geodata
2. Load the data into Mapshaper & check your IDs
3. Bring the data into WGS-84
Also watch out for values that are extremely similar across all regions, for example, regions that have latitude values of 13.418139, 13.418150, 13.418152, and so on. These will most likely not get displayed properly when uploaded to Datawrapper.
4. Aggregate polygons & set interior points
You're almost done! Before simplifying and exporting your map, these two steps might be necessary for you, but they can also be skipped (depending on your needs).
- "Aggregating polygons" is important if you have a country with one ID (e.g. "Denmark"), that's scattered across several regions (e.g. five islands). In this case, you want all the islands to have the same color in a Cholropleth map. But if the polygons of the five islands are not connected, Datawrapper will show you five times the same ID for the five islands; instead of just showing you one ID for the five islands. To avoid that, we can "dissolve" the polygons.
To do so, open the console and type " dissolve" followed by the name of the ID that you want to dissolve (e.g "country"): "dissolve country". If you do so, all other IDs will disappear. To avoid that, add a "copy-fields=", for example for your country code ID. The whole console command would look like this: "dissolve country copy-fields=country-code".
- "Setting interior points" is only important if you want to use labels on your map. When you set interior points, your TopoJSON will include the information where that label should be placed. Interior points are very similar to centroid points, but in contrast to centroid points, interior points will be surrounded by as much space as possible in your regions. That's great for labels. To set these interior points, open the console and type "each "cx=$.innerX, cy=$.innerY". That's it!
5. Simplify the data & export
Note on TopoJSON and GeoJSON files
- A TopoJSON file must have the root "type" property value of "Topology".
- If you are uploading a GeoJSON file, it must have the root "type" property value of "FeatureCollection". This is because the expected input is a collection of regions with named properties. Other values such as "Geometry", "Feature" and "GeometryCollection" will not be accepted.
6. Upload the map to Datawrapper
Now that you have your map, it's time to upload it to Datawrapper.
In Datawrapper, click on "New Map", then choose the map type you want to create. Then select your map file by clicking on the "Upload Map" button. Once uploaded, the map will appear in the preview on the right side.
Once a map is uploaded, it's also possible to change its projection.
The most likely use case for changing a projection is when you upload a map showing a very large region, such as a world map. In this case changing the projection to Natural Earth is advisable, since it was designed specifically for maps of the whole world.
Another example of a projection that you might want to choose is the Conic Equidistant projection, which is suitable for maps of Australia.
Including additional borders
It is possible to upload a TopoJSON file with multiple layers, and to get Datawrapper to display these on top of your map. This is a feature that can be used to display disputed borders, as well as additional inner or outer borders that help with the contextualization of more fine-grain administrative regions. In order to display additional layers in your map, chose which layer should be shown as what layer type, you will have the option to select the following layer.
When uploading multiple layers,
|Name||Appearance & Function|
|Regions||This is the layer that will be used to map your data to if you're creating a choropleth map. These borders will have the standard line width.|
|Outer borders||Thicker than the region borders, for when you want to display additional higher-level borders to provide context.|
|Inner borders|| Thinner than the region borders. For when you want to show the subdivisions of the region you're mapping.
|Disputed borders||Dashed, ideal for when you need to indicate a disputed border.|
|Background||Gray background, shown behind the map as an outline|
In this particular example, you can see that the map is colored by Regions (NUTS 2) with thick outer borders (country borders) and thin inner borders (NUTS 3). Because the NUTS regions don't extend to some countries like Belarus and Ukraine, they are shown as a light-colored Background.
For the vast majority of maps, the default projection will be sufficient, so you won't need to change it. Only change the projection if your map appears distorted or if you explicitly know that you need to use a specific projection.
From here on you can proceed to the next step to fill the map with data, then refine it, and finally publish it in the same way as you would with one of our built-in maps. See our tutorials on working with maps.
One more thing. You might be asking yourself: will the uploaded map be automatically added to the public list of Datawrapper maps? The answer is: No. If you upload your own map file, only you will be able to use it. The next time you want to create a map using the same map file, upload the TopoJSON or GeoJSON again.