maptastik
8/19/2015 - 12:56 PM

Constructing the URL for files on Google Drive

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.