Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

this introduces an estonian dataset, and removes some of the kosovo data #138

Merged
merged 3 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 31 additions & 29 deletions workshop/content/docs/publishing/first.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ In this section you are going to publish a vector dataset.
For this exercise, we will use a CSV dataset of [Bathing waters in Estonia](https://github.com/geopython/diving-into-pygeoapi/tree/main/workshop/exercises/data/bathingwater-estonia.csv),
kindly provided by [Estonian Health Board](https://terviseamet.ee).

You can find this dataset in `workshop/exercises/data/osm_poi_kosovo.csv`.
You can find this dataset in `workshop/exercises/data/bathingwater-estonia.csv`.

This exercise consists of two key steps:
This exercise consists of two steps:

* adapt `workshop/exercises/pygeoapi.config.yml` to define this dataset as an OGC API - Features *collection*
* adjust `workshop/exercises/pygeoapi.config.yml` to define this dataset as an OGC API - Features *collection*
* ensure that pygeoapi can find and connect to the data file

We will use the `workshop/exercises/docker-compose.yml` file provided.
Expand Down Expand Up @@ -70,38 +70,40 @@ Make sure that the indentation aligns (hint: directly under `# START ...`)
The config section reads:

``` {.yml linenums="185"}
poi_kosovo:
type: collection
title: Points of Interest Kosovo
description: The dataset shows the location of the places of interest in Kosovo.
keywords:
- places of interest
- kosovo
links:
- type: text/csv
rel: canonical
title: data
href: https://download.geofabrik.de/europe/kosovo.html
hreflang: AL
extents:
spatial:
bbox: [20,41.9,21.7,43.2]
crs: http://www.opengis.net/def/crs/OGC/1.3/CRS84
providers:
- type: feature
name: CSV
data: /data/osm_poi_kosovo.csv
id_field: osm_id
geometry:
x_field: x
y_field: y
Bathing_Water_Estonia:
type: collection
title: Bathing Water Estonia
description: Locations where the Estonian Health Board monitors the bathing water quality
keywords:
- bathing water
- estonia
links:
- type: text/csv
rel: canonical
title: data
href: https://avaandmed.eesti.ee/datasets/joogiveeallikad
hreflang: EE
extents:
spatial:
bbox: [20,57,29,60]
crs: http://www.opengis.net/def/crs/EPSG/0/4326
providers:
- type: feature
name: CSV
data: /data/bathingwater-estonia.csv
id_field: id
title_field: Name
geometry:
x_field: x
y_field: y
storage_crs: http://www.opengis.net/def/crs/EPSG/0/3300
```

The most relevant part is the `providers` section. Here, we define a `CSV Provider`,
pointing the file path to the `/data` directory we will mount (see next) from the local
directory into the Docker container above. Because a CSV is not a spatial file, we explicitly
configure pygeoapi so that the longitude and latitude (x and y) is mapped from the columns `lon`
and `lat` in the CSV file.
and `lat` in the CSV file. Notice the `storage_crs` parameter, which indicates the coordinate system which is used in the source data.

!!! Tip

Expand Down
44 changes: 23 additions & 21 deletions workshop/content/docs/publishing/ogcapi-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,44 +38,46 @@ data source.
It may be helpful to open the dataset in [QGIS](https://qgis.org) while adding and updating your pygeoapi server to easily evaluate table attributes, names, spatial properties and CRS.


Let's add the file `workshop/exercises/data/osm_places_kosovo.gpkg`:
Let's add the file `workshop/exercises/data/cp-tartu2.gpkg.zip`:

!!! question "Update the pygeoapi configuration"

Open the pygeoapi configuration file in a text editor.
Find the line `# START - EXERCISE 2 - osm_places`.
First, let's unzip the file [cptartu2.gpkg.zip](https://github.com/geopython/diving-into-pygeoapi/tree/main/workshop/exercises/data/cptartu2.gpkg.zip) to cptartu2.gpkg.

Add a new dataset section by uncommenting the lines up to `# END - EXERCISE 2 - osm_places`:
Then, open the pygeoapi configuration file in a text editor.
Find the line `# START - EXERCISE 2 - cadastral parcels Tartu`.

Add a new dataset section by uncommenting the lines up to `# END - EXERCISE 2 - cadastral parcels Tartu`:

``` {.yaml linenums="1"}
osm_places-vec:
cp-tartu:
type: collection
title: Places in Kosovo 2023
description: Places in Kosovo as maintained by the Open Street Map Community
title: Tartu Cadastral Parcels
description: Cadasral parcels in downtown Tartu
keywords:
- places
- Kosovo
- Cadastral parcels
- Tartu
links:
- type: text/csv
- type: OGC/WFS
rel: canonical
title: data
href: https://download.geofabrik.de/europe/kosovo.html
hreflang: AL
extents:
spatial:
bbox: [20,41.9,21.7,43.2]
crs: http://www.opengis.net/def/crs/OGC/1.3/CRS84
href: https://metadata.geoportaal.ee/geonetwork/srv/metadata/9949ec81-f758-42e6-9c1c-6fb604a3f053
hreflang: EE
extents:
spatial:
bbox: [26.6, 58.3, 26.8, 58.5]
crs: http://www.opengis.net/def/crs/OGC/1.3/CRS84
providers:
- type: feature
name: SQLiteGPKG
data: /data/osm_places_kosovo.gpkg # place correct path here
id_field: osm_id
title_field: name
table: gis_osm_places_free_1 # table name within gpkg
data: /data/cptartu2.gpkg # place correct path here
id_field: nationalca
title_field: label
table: cptartu2 # table name within gpkg
```

Save the file and restart Docker Compose. Navigate to <http://localhost:5000/collections> to evaluate whether the new dataset with
title *"Places in Kosovo 2023"* has been published.
title *"Tartu Cadastral Parcels"* has been published.

!!! note

Expand Down
27 changes: 14 additions & 13 deletions workshop/exercises/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ This directory provides sample data to demonstrate functionality.

## Sources

### OSM POI Kosovo
- title: [osm_poi_kosovo.csv](osm_poi_kosovo.csv)
- url: https://download.geofabrik.de/europe/kosovo.html
- description: Data coverted to csv from kosovo-latest-free.shp.zip. The file was last modified 23-6-2023
- copyright: OSM Contributors
- license: ODbL

### Places Kosovo
- title: [osm_places_kosovo.gpkg](./osm_places_kosovo.gpkg)
- url: https://download.geofabrik.de/europe/kosovo.html
- description: Data converted to geopackage from kosovo-latest-free.shp.zip. The file was last modified 23-6-2023
- copyright: OSM Contributors
- license: ODbL
### Bathingwater Estonia
- title: [Supluskohad](./bathingwater-estonia.csv) (Bathing places)
- url: https://avaandmed.eesti.ee/datasets/joogiveeallikad
- description: Locations where the Estonian Health Board monitors the bathing water quality
- copyright: [Terviseamet](https://terviseamet.ee)
- license: CC-BY-SA 3.0
- projection: epsg:3300

### Cadastral Parcels Estonia
- title: [cptartu2.gpkg.zip](./cptartu2.gpkg.zip)
- url: https://metadata.geoportaal.ee/geonetwork/srv/metadata/9949ec81-f758-42e6-9c1c-6fb604a3f053
- description: Data converted to geopackage from WFS.
- copyright: [Maa-amet](https://maaamet.ee)
- license: CC BY 4.0

### Cycle Circulation Area in Florence
- title: [cycle-lanes-firenze.geojson](cycle-lanes-firenze.geojson)
Expand Down
Loading
Loading