Skip to content

Create a custom Google Map using Google Sheets in seconds

Notifications You must be signed in to change notification settings

PickledChris/simple-country-mapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Country Mapper

Make simple country maps quickly using Google Sheets and My Maps

Quick start

Steps

  1. Clone the example spreadsheet
  2. Fill in the first (Country) column with your countries
  3. Go to Google My Maps and create a new map
  4. On a new layer, select Import -> Google Drive -> Navigate to the spreadsheet you copied
  5. Select "WKT" for your Placemarks, and "Country" to title your markers

Gif

Create the spreadsheet

Import it into My Maps

Customisation

Steps

  1. Add another column showing data you want to represent
  2. Reimport the layer.
    1. Press the 3 dots on the layer
    2. Reimport and merge - Reimport - Replace all items
    3. Reselect your file
  3. Style your countries by the imported columns

Gif

Add a column to your spreadsheet

Reimport your data and style your map

NB: Your data has to be the first sheet in the spreadsheet. There's no option to select a sheet.

FAQ

How does this work?

Google Sheets supports WKT format for displaying polygons. For convenience, I created a sheet called AllCountries, which has a list of countries and their corresponding WKT.

The first sheet just does a VLOOKUP and puts the data into a hidden column called "WKT". It has to be called exactly that for some reason 🤷

The borders are wrong!

The borders are derived from here
Google Sheets only supports 50,000 characters in a cell, so larger countries are lower resolution.

Why not just use <webapp / GIS / my favourite mapping library>

It seems to me that maps are simple, reproducible and accurate, choose 2:

  • There are a few simple webapps for this, but it's usually not easy to import from an easily editable file
  • GIS tools are accurate and reproducible, but too complex for personal use

This aims to be simple and reproducible, but not worrying about things like borders being exactly right

I get an error "1 row couldn't be shown on the map"

You're probably using the wrong country name, click the "open data table" button to see what one(s) are wrong.
They are highlighted in red.
Then look for the name in the AllCountries sheet (or country-wkt.csv.)
Either use the name in there, or change it in AllCountries if you prefer another name.

Why did you remap some of the country names from the ISO 3166-2 names?

Because this is designed to be simple. There may be a better source of short names, but this was a quick remapping to be closer to their Wikipedia names (generated using ChatGPT).
If you don't like it, you can change the mappings and regenerate the output file yourself.

How can I customise this?

Clone the repo and use a different .geojson file if you want to use different areas.
Or edit the mapping file to use different names.
Then go into the AllCountries tab on Google Sheets and reimport:

  • Import
  • Upload (select your new output/country-wkt.csv file)
  • Import location: replace current sheet and press Import data

Your code is bad!

Probably! This was a relatively quick and dirty attempt to tidy up an open source an even hackier version that I've been using for a while.
Open an issue or better yet, a Pull Request!

Gallery

//TODO

About

Create a custom Google Map using Google Sheets in seconds

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages