SETUP:
Import Modules
Python install packages into our Colab Virtual Enviornment using inline terminal commands (prefixed with an ! )
Now that the libraries have been installed. import them into our script here.
Configure Enviornment
This just makes things nice to look at
(Optional) Local File Access
We uploaded our shapefile into google drive. this will give us file access to the drive.?
Go to this URL in a browser: https://accounts.google.com/o/oauth2/auth?client_id=947318989803-6bn6qk8qdgf4n4g3pfee6491hc0brc4i.apps.googleusercontent.com&redirect_uri=urn%3aietf%3awg%3aoauth%3a2.0%3aoob&response_type=code&scope=email%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdocs.test%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive.photos.readonly%20https%3a%2f%2fwww.googleapis.com%2fauth%2fpeopleapi.readonly Enter your authorization code: ¡¡¡¡¡¡¡¡¡¡ Mounted at /content/driveNow that we have access to the drive, lets change our file path to the location where our data is stored. (change directory = cd )
/content/drive/My Drive/colabs/DATA/naomilist file contents in this directory to ensure we have what we need.
Capa.cpg Capa.dbf Capa.prj Capa.shp Capa.shx [0m[01;34mimages[0m/Retrieve GIS Data
Import the data using Geopandas.
Observe the first few records
name | desc | TimeStamp | Photos | sym_name | geometry | |
---|---|---|---|---|---|---|
0 | I-1a | Rules & regs | 2020-03-18 | images/I-1a.jpg | Red Pin | POINT Z (-77.243... |
1 | I-2a | Welcome to your ... | 2020-03-18 | images/I-2a.jpg | Red Pin | POINT Z (-77.242... |
2 | I-3a | Directions | 2020-03-18 | images/I-3a.jpg | Red Pin | POINT Z (-77.238... |
3 | I-4a | Wildlife drive | 2020-03-18 | images/I-4a.jpg | Red Pin | POINT Z (-77.237... |
4 | I-5a | No digging | 2020-03-18 | images/I-5a.jpg | Red Pin | POINT Z (-77.236... |
Ensure the data can be plotted
Great. We just converted the shapefile to csv to remove any metadata that may be attached.
This approach loads a map using a geometry column
Unnamed: 0 | name | desc | TimeStamp | Photos | sym_name | geometry | |
---|---|---|---|---|---|---|---|
0 | 0 | I-1a | Rules & regs | 2020-03-18 | images/I-1a.jpg | Red Pin | POINT Z (-77.243... |