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 this map would also be useful for other Datawrapper users.) You can reach her at firstname.lastname@example.org 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 use labels).
1. Find geodata
- geoportal.statistics.gov.uk (for the UK)
- download.geofabrik.de (OpenStreetMap data)
2. Load the data into Mapshaper & check your IDs
You can view layers in Mapshaper by clicking on the button centered on the top. In the same dialog box, you can also delete layers (although the deleted layer might still appear in Mapshaper, it will not be present once you export the map):
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 on a choropleth 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". Other values such as "Geometry", "Feature" and "GeometryCollection" will not be accepted.
A "FeatureCollection" should have a member with the name " features" which is an array of Feature objects. Each Feature object should have a "type" member with the value "Feature", a "geometry" member, and a "properties" member. See details here.
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 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 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 get Datawrapper to display these on top of your map. For details, read this article here.
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.