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 3000 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  support@datawrapper.de if you would like a specific map to be added to the list.

Index

Prerequisites

To upload your map in Datawrapper, it needs to...
  • 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).
Also, make sure that...
  • 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).
We will walk through all the steps together. To do so, you can use  an editor capable of working with geodata such as QGISWe will use the online tool Mapshaper. But first, we need some data:

1. Find geodata

If you're reading this article, you might already have some geodata. If not, a simple online search can lead you to a government site, OpenStreetMap data, or an open data portal, which often offers geo data for their country or city. For example:
Geodata comes in many formats like Shapefiles, GeoJSON, or TopoJSON. The latter is rare on government sites and open data portals, but Shapefiles or GeoJSON will work well for preparing and exporting the map too. So finding geo data is as simple as typing "Shapefile municipalities Mordor" or "GeoJSON regions death star" (or whichever area you're interested in) into your favorite search engine.
If you are confronted with multiple download options, try to find a "clipped" version of the data: that's the one without the water areas (e.g., a lake or a coast). You might also be able to download data of different sizes (1m, 5m, etc.). Go ahead and  download the smallest one. We will need to reduce the file size of 95% of the maps anyway.
For inspiration and data sources, visit the article How to find geodata

2. Load the data into Mapshaper & check your IDs

If you downloaded a Shapefile, you would get a whole folder with four to seven files. Go to mapshaper.org and upload (or drag) all the files from your folder there – or your GeoJSON, if you downloaded that one instead:
With a click on the  i-Button at the right, you can check the IDs behind all your areas. If you don't see any IDs in the infobox on the left, your geo data will not work as an upload. 
In most cases, you will find more than one ID in the infobox. Your data should have at least one ID that's unique for all your regions (e.g. a ZIP code for ZIP areas or a census tract code for census tracts). If you have IDs that are the same for the different regions, then you will not be able to assign different data for values for these regions. 
A map can have more than one  layer (a layer is a group of regions). Your map must contain at least one such layer to plot your data. You can also include multiple layers and assign each layer different widths.

👉 To learn how to include outer borders, inner borders, and disputed borders, follow our Academy article How to create a custom basemap with different borders or multiple layers.

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

WGS-84 is a Geographic Coordinate System (a system that defines real-world location points on a 3-dimensional digital surface) that uses longitude and latitude units of decimal degrees.  WGS-84 is the current standard specification of GeoJSON format
When you upload your TopoJSON or GeoJSON to Datawrapper, it must be in the WGS-84 coordinate system. 
To make sure your map uses WGS-84, open the  console in Mapshaper (either by clicking on "Console" in the top right corner or pressing your spacebar). Then type " proj wgs84" in the console and press Enter. 
Your map might look a bit different now. To ensure that the projection changed successfully, you can type " info" into the console. It should give you back lots of information, among others: " Proj.4: +proj=longlat +datum=WGS8 4"
When converting to WGS-84 in the Mapshaper console, you might get an error that says,    "Unable to project -- source coordinate system is unknown ". This means that Mapshaper can not recognize the original coordinate system, and you will need to specify it yourself to convert. For this, you will need to check the source of where you downloaded the geodata.
⚠️ After converting your map to WGS-84, check your latitudes and longitudes in the bottom left corner of Mapshaper while hovering over your map. If they are way too small (e.g. 0.000383473) or too big (e.g. 3834.73384), Datawrapper won't be able to display the map.

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.
This WGS-84 "projection" might look weird in Mapshaper, but don't worry: Datawrapper will automatically change the projection once you upload it. This means that your map will look better (= not as stretched) in Datawrapper than it does in Mapshaper now.

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). 

  1. "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".
  2. "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!
These are just two of many possible ways to use the Console in Mapshaper. There are many more commands, that can for example help you to delete/filter certain areas or merge layers.  Visit Mapshaper's command reference to learn more.

5. Simplify the data & export

The TopoJSON or GeoJSON that you upload to Datawrapper needs to be smaller than 2MB. We recommend a size below 500KB. The smaller your map, the faster it will load for your readers. Here's how we decrease the file size in Mapshaper:
Find the button " Simplify" on the top right. You will get some options. Definitely choose " prevent shape removal" – you can play around with the rest of the options (or use the defaults). Once you click "Apply," you will get a slider at the top of the window. Drag it to simplify your map.
You will find that your map appearance doesn't really change until you simplify it to around 75%. That's great news for us! It means that our file is smaller, while the appearance is almost the same. 
After simplifying, you might have some " line  intersections". Click " Repair".
So how large is your file after simplifying? You'll only find out when you export the map. Click on "Export" on the top right and export as TopoJSON. 

Note on TopoJSON and GeoJSON files

Depending on the source and type of your original geodata, you may get an exported map that will not be recognized by Datawrapper. Here are the requirements that you can check by looking at your exported file in a text editor:
  • 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.

Additional options

Once a map is uploaded, it's also possible to change its  projection.

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.

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.