Skip to content

Instantly share code, notes, and snippets.

@ryanbaumann
Last active July 9, 2024 11:09
Show Gist options
  • Save ryanbaumann/e5c7d76f6eeb8598e66c5785b677726e to your computer and use it in GitHub Desktop.
Save ryanbaumann/e5c7d76f6eeb8598e66c5785b677726e to your computer and use it in GitHub Desktop.
Install Tippecanoe to make Mapbox Vector Tiles on a Windows 10 OS machine

Problem

Tippecanoe is an open source command line tool for creating Mapbox Vector Tiles. It runs only on unix environments like MacOS and Linux - so if you need to make maps with large vector data from geojson, shapefiles, or similar - you're hosed if you're on Windows.

Goals

  1. Create vector tiles of massive vector data on a Windows 10 machine

Requirements

  1. Windows 10 personal, pro, or server OS
  2. Admin rights on the machine you're installing on
  3. Install Ubuntu 14.04+ or more recent

Tutorial

  1. Install the Ubuntu Linux Bash shell from the Microsoft Store. Follow the tutorial here.
    • Make sure to setup your UNIX username and password to something that you'll remember. Store it in your password manager!
  2. Open the Ubuntu Bash terminal on your Windows machine once everything is installed.
  3. Change directory to your C:/ drive in your Ubuntu shell - cd ../../mnt/c. This should put you in the directory /mnt/c on your Windows C:/ drive.
  4. Install git to download the latest Tippecanoe
    • sudo apt-get install software-properties-common
    • sudo apt-add-repository ppa:git-core/ppa
    • sudo apt-get update
    • sudo apt-get install git
    • sudo apt-get install unzip
    • sudo apt-get install wget
    • (if for some reason you have issues with git, you can download the Tippecanoe code to use in the next step directly for version 1.34.0 using wget https://github.com/mapbox/tippecanoe/archive/1.34.0.zip && unzip 1.34.0.zip
  5. Install Tippecanoe
    • Prereqs
      • sudo apt-get install build-essential libsqlite3-dev zlib1g-dev
      •  sudo apt-get update -y
         sudo apt-get install -y g++-5
         export CXX=g++-5```
        
    • git clone https://github.com/mapbox/tippecanoe.git
    • cd tippecanoe
    • make
    • sudo make install
  6. Check your install was successful
    • tippecanoe --version
  7. Now Tippecanoe is installed, and you can run it from your Ubuntu bash terminal on any files you have on your Windows machine.
    • EX I have a geojson file containing polygons representing US ACLU districts in Flordia. I can now tile it using this command: tippecanoe -P -ab -o out.mbtiles --coalesce-densest-as-needed --extend-zooms-if-still-dropping -zg --generate-ids -f -l "districts" Florida_63_to_63.geojson
@Mike-Honey
Copy link

Before this was published, I found steps to do something similar using cygwin64 in place of Ubuntu:

https://github.com/GISupportICRC/ArcGIS2Mapbox#installing-tippecanoe-on-windows

I then found that if you leave the folder C:\cygwin64\home{your username}\tippecanoe in place, and also add C:\cygwin64\home to your System PATH environment variable, you can then run tippecanoe directly from the windows command line, e.g.

C:\cygwin64\home{your username}\tippecanoe\tippecanoe

This can be useful for integration with other tools e.g. command scripts, python.

But the bigger issue is - this is all too hard for even a somewhat technical windows user: too many steps and easy to trip up along the way. Given the widespread use of Windows, and the common need for tippecanoe to get usable results in Mapbox, this seems a limiting factor to the uptake of Mapbox.

@eldang
Copy link

eldang commented Mar 31, 2020

Thank you posting this! I just did the same with Debian 10 and tippecanoe 1.35.0, and the only change I had to make was that the g++ step is no longer necessary with that setup.

@DarinMacRae
Copy link

Outstanding! Thank you @ryanbaumann.

@Chaitu15
Copy link

Chaitu15 commented Nov 6, 2020

I am getting g++5 package not found error. Can you please help

@Mike-Honey
Copy link

I fInally got through setting up a machine this way for Windows Server 2019 (essentially the same as Windows 10). Every step was like crawling over broken glass for me.

But now I'm observing that tippecanoe runs about 10x faster, compared to the Cygwin architecture I described above on similar hardware.

@sebastian-ch
Copy link

Thank you! This worked for me. I had issues with g++5 but used this answer to install it: https://askubuntu.com/questions/1223550/g-5-on-ubuntu-19-10

@egml
Copy link

egml commented Dec 6, 2021

Thanks! This really helped! 👏👍

@Q0paz
Copy link

Q0paz commented Jul 6, 2022

I got the g++5 errors :

Package g++-5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
gcc-10-test-results gcc-11-test-results gcc-9-test-results gcc-8-test-results gcc-7-test-results

E: Package 'g++-5' has no installation candidate

but ignored. It built fine.

@leegee
Copy link

leegee commented Jul 7, 2022

Thanks! Works just fine on Windows 10 WSL Debian, provided you get the gcc version recommended by the system as you run the commands.

@7cats
Copy link

7cats commented Sep 25, 2023

Thanks! works perfect for me! Only gcc-5 is not supported anymore. I did with gcc-9

@chiubaca
Copy link

Great write up, very useful! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment