Skip to content

Commit

Permalink
Merge pull request #9 from C-Loftus/geopandas
Browse files Browse the repository at this point in the history
Geopandas OGC API Features (OAF) Support (USGS/WMA - 33)
  • Loading branch information
C-Loftus authored Jul 22, 2024
2 parents 4fa9a35 + 1146828 commit aa300a2
Show file tree
Hide file tree
Showing 8 changed files with 991 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
POSTGRESQL_PASSWORD: ${{ env.POSTGRESQL_PASSWORD }}
run: |
pytest tests/test_ckan_provider.py
pytest tests/test_geopandas_provider.py
pytest tests/test_postgresql_provider.py
pytest tests/test_sitemap_process.py
pytest tests/test_sparql_provider.py
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Additional OGC API - Feature providers are listed below, along with a matrix of
| `CKAN` | ✅/✅ | results/hits ||||||||
| `PsuedoPostgreSQL` | ✅/✅ | results/hits ||||||||
| `SPARQL` | ❌/✅ | results/hits ||||||||
| `GeoPandas` | ✅/✅ | results/hits ||||||||

The provider names listed in the table are only accessible in [internetofwater/pygeoapi](https://github.com/internetofwater/pygeoapi), otherwise the full python path is required.

Expand Down Expand Up @@ -78,6 +79,23 @@ The SPARQL Provider only uses variables prefixed with sparql\_ in the configurat
- `sparql_subject`: The SPARQL variable representing the subject URI in the query.
- `sparql_predicates`: A mapping of attribute names to SPARQL predicates. These predicates will be used to query specific attributes in the SPARQL data source.

### GeoPandas

The GeoPandas Provider enables OGC API - Feature support using GeoPandas as the backend. This integration can read in data files in [any of the geospatial formats supported by GeoPandas](https://geopandas.org/en/stable/docs/user_guide/io.html#supported-drivers-file-formats).

`id_field` is the only field that is required to be labelled.

```yaml
providers:
- type: feature
name: pygeoapi_plugins.provider.geopandas_.GeoPandasProvider
# Example data
data: 'https://www.hydroshare.org/resource/3295a17b4cc24d34bd6a5c5aaf753c50/data/contents/hu02.gpkg',
id_field: id
```
You can also use plain CSV and read in points by providing an `x_field` and `y_field` in the config the [same way you would with the default pygeoapi CSV provider](https://github.com/geopython/pygeoapi/blob/510875027e8483ce2916e7cf315fb6a7f6105807/pygeoapi-config.yml#L137).

## OGC API - Processes

Additional OGC API - Process are listed below
Expand Down
Loading

0 comments on commit aa300a2

Please sign in to comment.