Skip to content

Commit

Permalink
new dataset to replace kosovo places, extends #140
Browse files Browse the repository at this point in the history
  • Loading branch information
pvgenuchten committed Apr 5, 2024
1 parent 5e7d46a commit f29384b
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 43 deletions.
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
12 changes: 6 additions & 6 deletions workshop/exercises/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ This directory provides sample data to demonstrate functionality.
- 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
### 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
Binary file removed workshop/exercises/data/osm_places_kosovo.gpkg
Binary file not shown.
2 changes: 1 addition & 1 deletion workshop/exercises/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ services:

volumes:
- ./pygeoapi.config.yml:/pygeoapi/local.config.yml
# - ./data:/data # Exercise 1 - First - Ready to pull data from here
- ./data:/data # Exercise 1 - First - Ready to pull data from here
- ./plugins/process/squared.py:/pygeoapi/pygeoapi/process/squared.py # Exercise 8
30 changes: 15 additions & 15 deletions workshop/exercises/pygeoapi.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,32 +224,32 @@ resources:
# y_field: y
### END - EXERCISE 1 - Your First Collection

## START - EXERCISE 2 - osm_places
# osm_places-vec:
## START - EXERCISE 2 - cadastral parcels Tartu
# 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
# href: https://metadata.geoportaal.ee/geonetwork/srv/metadata/9949ec81-f758-42e6-9c1c-6fb604a3f053
# hreflang: EE
# extents:
# spatial:
# bbox: [20,41.9,21.7,43.2]
# 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
## END - EXERCISE 2 - osm_places
# data: /data/cptartu2.gpkg # place correct path here
# id_field: nationalca
# title_field: label
# table: cptartu2 # table name within gpkg
## END - EXERCISE 2 - cadastral parcels Tartu

## START - EXERCISE 3 - Coverages
# firenze-terrains:
Expand Down

0 comments on commit f29384b

Please sign in to comment.