From 3e7c66315b28ce46751e61df1013ee9cf8f644df Mon Sep 17 00:00:00 2001 From: carmengg Date: Sun, 22 Oct 2023 18:03:58 -0700 Subject: [PATCH] before adding dataset --- ...das-intro.qmd => lesson-8-vector-data.qmd} | 0 lectures/lesson-9-geopandas-intro.qmd | 47 +++++++++++++++++++ 2 files changed, 47 insertions(+) rename lectures/{lesson-7-geopandas-intro.qmd => lesson-8-vector-data.qmd} (100%) create mode 100644 lectures/lesson-9-geopandas-intro.qmd diff --git a/lectures/lesson-7-geopandas-intro.qmd b/lectures/lesson-8-vector-data.qmd similarity index 100% rename from lectures/lesson-7-geopandas-intro.qmd rename to lectures/lesson-8-vector-data.qmd diff --git a/lectures/lesson-9-geopandas-intro.qmd b/lectures/lesson-9-geopandas-intro.qmd new file mode 100644 index 0000000..ee8b60b --- /dev/null +++ b/lectures/lesson-9-geopandas-intro.qmd @@ -0,0 +1,47 @@ +# `geopandas` + +GeoPandas is a Python library that extends the `pandas` library by adding support for geospatial data. In this lesson we will introduce the `geopandas` library to work with vector data. We will also make our first map. + +To begin with, let's import `geopandas` with its standard abbreviation `gpd`: + +```{python} +import geopandas as gpd +``` + +## Data + +In this lesson we will use with point data about wild pigs (*Sus scrofa) sightings in Santa Barbara county from the [Global Biodiversity Information Facility](https://www.gbif.org). + +```{python} + +``` + +## `GeoSeries` and `GeoDataFrame` + +The core data structure in GeoPandas is the `geopandas.GeoDataFrame`. +We can think of it as a `pandas.DataFrame` with a dedicated geometry column that can perform spatial operations. + +The **geometry column** in a `gpd.GeoDataFrame` holds the geometry (point, polygon, etc) of each spatial feature. Columns in the `gpd.GeoDataFrame` with attributes about the features are `pandas.Series` like in a regular `pd.DataFrame`. + +![Image source: GeoPandas documentation](/images/lesson-8-geopandas/dataframe.svg) + +**Example** + +## Geometric information + + +## Data wrangling + + +## Plotting + + +## Simple map + + \ No newline at end of file