Instructions on how to upload your working file to Google Drive#

Once you have created the working file from your data report you can upload it to Google Drive using the procedure outlined below. The procedure utilizes the package gdown (so do not forget to ‘pip install’ it. I am using the guerry.zip file here, so all of the names can be tweaked according to whatever names you are using.

Then follow the instructions below:

  1. Zip your working file (guerry.zip)

  2. Upload the file to your Google Drive. Right click the file > Share > General Access (Anyone with the link) > Viewer > Copy Link.

  3. Paste the link below for your convenience

https://drive.google.com/file/d/1DN2jTDbwdGhyIoR1YKkFZrEbode77_VF/view?usp=sharing
  1. Copy only file id from the link above (all symbols bewteen ‘file/d/’ and ‘/view?’

1DN2jTDbwdGhyIoR1YKkFZrEbode77_VF
  1. Paste copied file id into URL below, like so

https://drive.google.com/uc?id=1DN2jTDbwdGhyIoR1YKkFZrEbode77_VF
  1. Use gdown to download the file to content/ directory by copying the link from ‘5’

!gdown https://drive.google.com/uc?id=1DN2jTDbwdGhyIoR1YKkFZrEbode77_VF
  1. Unzip the file using CLI. You will need to change the filename here with your own.

!unzip guerry.zip
  1. Finally, read your data using pandas or geopandas depending on the type of your data.

import geopandas as gpd
guerry = gpd.read_file('guerry/guerry.shp')
guerry.plot()
!pip install gdown geopandas fiona rtree shapely pyproj
Requirement already satisfied: gdown in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (4.5.3)
Requirement already satisfied: geopandas in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (0.11.1)
Requirement already satisfied: fiona in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (1.8.21)
Requirement already satisfied: rtree in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (0.9.7)
Requirement already satisfied: shapely in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (1.8.4)
Requirement already satisfied: pyproj in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (3.4.0)
Requirement already satisfied: requests[socks] in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from gdown) (2.28.1)
Requirement already satisfied: tqdm in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from gdown) (4.64.1)
Requirement already satisfied: six in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from gdown) (1.16.0)
Requirement already satisfied: filelock in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from gdown) (3.8.0)
Requirement already satisfied: beautifulsoup4 in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from gdown) (4.11.1)
Requirement already satisfied: packaging in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from geopandas) (21.3)
Requirement already satisfied: pandas>=1.0.0 in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from geopandas) (1.4.4)
Requirement already satisfied: attrs>=17 in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from fiona) (21.4.0)
Requirement already satisfied: certifi in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from fiona) (2022.9.24)
Requirement already satisfied: click>=4.0 in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from fiona) (8.0.4)
Requirement already satisfied: cligj>=0.5 in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from fiona) (0.7.2)
Requirement already satisfied: click-plugins>=1.0 in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from fiona) (1.1.1)
Requirement already satisfied: munch in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from fiona) (2.5.0)
Requirement already satisfied: setuptools in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from fiona) (65.5.0)
Requirement already satisfied: colorama in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from click>=4.0->fiona) (0.4.5)
Requirement already satisfied: numpy>=1.21.0 in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from pandas>=1.0.0->geopandas) (1.23.3)
Requirement already satisfied: python-dateutil>=2.8.1 in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from pandas>=1.0.0->geopandas) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from pandas>=1.0.0->geopandas) (2022.1)
Requirement already satisfied: soupsieve>1.2 in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from beautifulsoup4->gdown) (2.3.2.post1)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from packaging->geopandas) (3.0.9)
Requirement already satisfied: idna<4,>=2.5 in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from requests[socks]->gdown) (3.4)
Requirement already satisfied: charset-normalizer<3,>=2 in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from requests[socks]->gdown) (2.0.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from requests[socks]->gdown) (1.26.12)
Requirement already satisfied: PySocks!=1.5.7,>=1.5.6 in c:\users\barguzin\anaconda3\envs\geo_env\lib\site-packages (from requests[socks]->gdown) (1.7.1)
! gdown https://drive.google.com/uc?id=1DN2jTDbwdGhyIoR1YKkFZrEbode77_VF

#https://drive.google.com/file/d/1DN2jTDbwdGhyIoR1YKkFZrEbode77_VF/view?usp=sharing
Downloading...
From: https://drive.google.com/uc?id=1DN2jTDbwdGhyIoR1YKkFZrEbode77_VF
To: C:\Users\barguzin\Documents\Github\ucsb_geog172\notebooks\guerry.zip

  0%|          | 0.00/572k [00:00<?, ?B/s]
100%|##########| 572k/572k [00:00<00:00, 16.2MB/s]
!ls
'ls' is not recognized as an internal or external command,
operable program or batch file.
!unzip guerry.zip
^C
replace guerry/guerry.dbf? [y]es, [n]o, [A]ll, [N]one, [r]ename: 
Archive:  guerry.zip
import geopandas as gpd
guerry = gpd.read_file('guerry/guerry.shp')
guerry.plot();
../_images/gdown_5_0.png