Skip to content

Instantly share code, notes, and snippets.

@maptastik
Last active October 1, 2023 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maptastik/682d8aba9d539aca165e to your computer and use it in GitHub Desktop.
Save maptastik/682d8aba9d539aca165e to your computer and use it in GitHub Desktop.
Constructing the URL for files on Google Drive

First things first, you'll need to make sure your data are in a folder within your Google Drive rather than the root directory. Once you've added your data file to that folder, make sure that folder and the file are shareable.

These steps assume you're working through Google Drive in your browser:

  1. Navigate to the folder in your Google Drive.
  2. Examine the URL of the folder. It should look something like https://drive.google.com/drive/u/0/folders/<folder ID>. The folder ID should be a string of numbers and letter rather than the name you gave the folder.
  3. Generate the URL of your file. The URL consists of three (3) parts that you'll put together:
  4. https://googledrive.com/host/
  5. folder ID
  6. /your file

For example, if you have data.geojson in a folder with an of ID a1B2c3defg456, the your URL to access that data would be https://googledrive.com/host/a1B2c3defg456/data.geojson.

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