# pygeoapi-plugins
[pygeoapi](https://pygeoapi.io) plugins developed by the Center for Geospatial Solutions
## OGC API - Features
Additional OGC API - Feature providers are listed below, along with a matrix of supported query parameters.
| Provider | Property Filters/Display | Result Type | BBox | Datetime | Sort By | Skip Geometry | CQL | Transactions | CRS |
| ------------------ | ------------------------ | ------------ | ---- | -------- | ------- | ------------- | --- | ------------ | --- |
| `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.
### CKAN
The CKAN Provider enables OGC API - Feature support at the collection level for a specific resource within the datastore-search endpoints of CKAN instances.
It allows you to integrate CKAN resources into your pygeoapi instance.
The provider definition for the CKAN Provider includes configuration options specific to CKAN.
To use the CKAN Provider, you need to specify `pygeoapi_plugins.provider.ckan.CKANProvider` as the provider's name.
```yaml
providers:
- type: feature
name: pygeoapi_plugins.provider.ckan.CKANProvider
data: https://catalog.newmexicowaterdata.org/api/3/action/datastore_search
resource_id: 08369d21-520b-439e-97e3-5ecb50737887
id_field: _id
x_field: LONDD
y_field: LATDD
```
In this example, the CKAN Provider is configured to work with the specified CKAN resource.
- `data`: The URL endpoint for the datastore search API of the CKAN instance.
- `resource_id`: The identifier of the specific CKAN resource you want to access within the datastore.
- `id_field`: The field that serves as the unique identifier for features in the CKAN resource.
- `x_field`: The field representing the X-coordinate (longitude) for the features in the CKAN resource.
- `y_field`: The field representing the Y-coordinate (latitude) for the features in the CKAN resource.
### PseudoPostgresSQL
The PseudoPostgresSQL Provider adds a simple capacity to the PostgresSQL Provider in pygeoapi core - faster counting.
This is done by performing a pseudo-count on tables exceeding a definable limit.
The limit is defined using the PSEUDO_COUNT_LIMIT environment variable.
To use the PseudoPostgresSQL Provider, you need to specify `pygeoapi_plugins.provider.postgresql.PseudoPostgreSQLProvider` as the provider's name.
### SPARQL
The SPARQL Provider is a wrapper for any pygeoapi feature provider that provides additional context, allowing integration of SPARQL-based data sources into a pygeoapi instance.
By wrapping another feature provider, the SPARQL Provider inherits queryable capacities from the wrapped feature provider - adding SPARQL context to each resulting feature.
The provider definition for the SPARQL Provider is similar to that of the wrapped provider, with the addition of specific SPARQL-related configuration options.
To use the SPARQL Provider, you need to specify `pygeoapi_plugins.provider.sparql.SPARQLProvider` as the provider's name.
```yaml
providers:
- # Normal pygeoapi provider configuration
type: feature
data: /pygeoapi_plugins/tests/data/places.csv
id_field: index
geometry:
x_field: lon
y_field: lat
#
name: pygeoapi_plugins.provider.sparql.SPARQLProvider
sparql_provider: CSV # Name of provider SPARQL is wrapping
sparql_query:
endpoint: https://dbpedia.org/sparql
bind:
name: uri
variable: '?subject'
prefixes:
'': <http://dbpedia.org/resource/>
dbpedia2: <http://dbpedia.org/property/>
dbo: <http://dbpedia.org/ontology/>
where:
- subject: '?subject'
predicate: dbo:populationTotal
object: '?population'
- subject: '?subject'
predicate: dbo:country
object: '?country'
- subject: '?subject'
predicate: '<http://dbpedia.org/property/leaderName>'
object: '?leader'
filter:
- 'FILTER (isIRI(?leader) || isLiteral(?leader))'
```
In this example, the SPARQL Provider wraps the GeoJSON Provider.
The SPARQL Provider only uses variables prefixed with sparql\_ in the configuration.
- `data`: The path to the data file used by the wrapped provider (GeoJSON Provider in this case).
- `id_field`: The field that serves as the unique identifier for features in the data.
- `sparql_provider`: The name of the provider that will handle the SPARQL query results (GeoJSON Provider in this case).
- `sparql_query`: The SPARQL object holding the content of the SPARQL query.
- `endpoint`: The SPARQL variable representing the graph IRI in the query.
- `bind`:
- `name`: Field in the wrapped properties block to query the graph with
- `variable`: The SPARQL variable used for querying (e.g., ?subject).
prefixes:
- `prefixes`: Optional dictionary defining the prefixes used in the SPARQL query.
- `where`: A list of mappings that define the WHERE clause of the SPARQL query. Each mapping includes:
- `subject`: The subject of the triple pattern.
- `predicate`: The predicate of the triple pattern.
- `object`: The object of the triple pattern.
- `filter`: A list of SPARQL filter expressions to apply to the results.
### 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
### Intersector
The intersection process uses OGC API - Features Part 3: Filtering to return CQL intersections of features.
An example configuration in a pygeoapi configuration is below.
```yaml
intersector:
type: process
processor:
name: pygeoapi_plugins.process.intersect.IntersectionProcessor
```
This plugin is used in https:/reference.geoconnex.us/.
### Sitemap Generator
The Sitemap Generator process makes use of the XML formatter and OGC API - Features to generate a sitemap of the pygeoapi instance.
This can be used with the python package [sitemap-generator](https://github.com/cgs-earth/sitemap-generator) to generate a sitemap index.
An example configuration in a pygeoapi configuration is below.
```yaml
sitemap-generator:
type: process
processor:
name: pygeoapi_plugins.process.sitemap.SitemapProcessor
```
## OGC API - Environmental Data Retrieval
### Sensorthings API
The EDR provider is implemented as the default for retrieving environmental data in a compliant manner with the OGC API - EDR specification. This ensures that spatial and temporal queries can be efficiently performed on the sensor data. Additionally, the OGC API - Features (OAF) provider is used to fill in the /items component of the API, allowing access to the Things (sensor devices) from the SensorThings API.
Both providers are configured together to offer a unified interface for sensor data access, while maintaining compliance with OGC standards. The EDR provider is responsible for the core environmental data retrieval, while the OAF provider exposes the sensor entities.
> **Note:** For more information on configuring the OAF provider, refer to the [SensorThings API](https://docs.pygeoapi.io/en/latest/data-publishing/ogcapi-features.html#sensorthings-api) documentation.
```yaml
providers:
# EDR Provider for environmental data retrieval
- type: edr
name: pygeoapi_plugins.provider.sensorthings_edr.SensorThingsEDRProvider
data: https://labs.waterdata.usgs.gov/sta/v1.1/
# OAF Provider for exposing sensor entities (Things)
- type: feature
name: pygeoapi.provider.sensorthings.SensorThingsProvider
data: https://labs.waterdata.usgs.gov/sta/v1.1/
entity: Things
title_field: name
```
Raw data
{
"_id": null,
"home_page": "https://github.com/cgs-earth/pygeoapi-plugins",
"name": "pygeoapi-plugins",
"maintainer": "Benjamin Webb",
"docs_url": null,
"requires_python": null,
"maintainer_email": "bwebb@lincolninst.edu",
"keywords": "cgs pygeoapi geopython",
"author": "Benjamin Webb",
"author_email": "bwebb@lincolninst.edu",
"download_url": "https://files.pythonhosted.org/packages/30/a9/20df75128d359789b0e89f3afe07eb4802e993c78b830608a333fd4e8022/pygeoapi_plugins-0.2.0.tar.gz",
"platform": "all",
"description": "# pygeoapi-plugins\n\n[pygeoapi](https://pygeoapi.io) plugins developed by the Center for Geospatial Solutions\n\n## OGC API - Features\n\nAdditional OGC API - Feature providers are listed below, along with a matrix of supported query parameters.\n\n| Provider | Property Filters/Display | Result Type | BBox | Datetime | Sort By | Skip Geometry | CQL | Transactions | CRS |\n| ------------------ | ------------------------ | ------------ | ---- | -------- | ------- | ------------- | --- | ------------ | --- |\n| `CKAN` | \u2705/\u2705 | results/hits | \u274c | \u274c | \u2705 | \u2705 | \u274c | \u274c | \u2705 |\n| `PsuedoPostgreSQL` | \u2705/\u2705 | results/hits | \u2705 | \u2705 | \u2705 | \u2705 | \u2705 | \u274c | \u2705 |\n| `SPARQL` | \u274c/\u2705 | results/hits | \u274c | \u274c | \u274c | \u274c | \u274c | \u274c | \u274c |\n| `GeoPandas` | \u2705/\u2705 | results/hits | \u2705 | \u2705 | \u2705 | \u2705 | \u274c | \u2705 | \u2705 |\n\nThe provider names listed in the table are only accessible in [internetofwater/pygeoapi](https://github.com/internetofwater/pygeoapi), otherwise the full python path is required.\n\n### CKAN\n\nThe CKAN Provider enables OGC API - Feature support at the collection level for a specific resource within the datastore-search endpoints of CKAN instances.\nIt allows you to integrate CKAN resources into your pygeoapi instance.\nThe provider definition for the CKAN Provider includes configuration options specific to CKAN.\nTo use the CKAN Provider, you need to specify `pygeoapi_plugins.provider.ckan.CKANProvider` as the provider's name.\n\n```yaml\nproviders:\n - type: feature\n name: pygeoapi_plugins.provider.ckan.CKANProvider\n data: https://catalog.newmexicowaterdata.org/api/3/action/datastore_search\n resource_id: 08369d21-520b-439e-97e3-5ecb50737887\n id_field: _id\n x_field: LONDD\n y_field: LATDD\n```\n\nIn this example, the CKAN Provider is configured to work with the specified CKAN resource.\n\n- `data`: The URL endpoint for the datastore search API of the CKAN instance.\n- `resource_id`: The identifier of the specific CKAN resource you want to access within the datastore.\n- `id_field`: The field that serves as the unique identifier for features in the CKAN resource.\n- `x_field`: The field representing the X-coordinate (longitude) for the features in the CKAN resource.\n- `y_field`: The field representing the Y-coordinate (latitude) for the features in the CKAN resource.\n\n### PseudoPostgresSQL\n\nThe PseudoPostgresSQL Provider adds a simple capacity to the PostgresSQL Provider in pygeoapi core - faster counting.\nThis is done by performing a pseudo-count on tables exceeding a definable limit.\nThe limit is defined using the PSEUDO_COUNT_LIMIT environment variable.\nTo use the PseudoPostgresSQL Provider, you need to specify `pygeoapi_plugins.provider.postgresql.PseudoPostgreSQLProvider` as the provider's name.\n\n### SPARQL\n\nThe SPARQL Provider is a wrapper for any pygeoapi feature provider that provides additional context, allowing integration of SPARQL-based data sources into a pygeoapi instance.\nBy wrapping another feature provider, the SPARQL Provider inherits queryable capacities from the wrapped feature provider - adding SPARQL context to each resulting feature.\nThe provider definition for the SPARQL Provider is similar to that of the wrapped provider, with the addition of specific SPARQL-related configuration options.\nTo use the SPARQL Provider, you need to specify `pygeoapi_plugins.provider.sparql.SPARQLProvider` as the provider's name.\n\n```yaml\nproviders:\n - # Normal pygeoapi provider configuration\n type: feature\n data: /pygeoapi_plugins/tests/data/places.csv\n id_field: index\n geometry:\n x_field: lon\n y_field: lat\n #\n name: pygeoapi_plugins.provider.sparql.SPARQLProvider\n sparql_provider: CSV # Name of provider SPARQL is wrapping\n sparql_query:\n endpoint: https://dbpedia.org/sparql\n bind:\n name: uri\n variable: '?subject'\n prefixes:\n '': <http://dbpedia.org/resource/>\n dbpedia2: <http://dbpedia.org/property/>\n dbo: <http://dbpedia.org/ontology/>\n where:\n - subject: '?subject'\n predicate: dbo:populationTotal\n object: '?population'\n - subject: '?subject'\n predicate: dbo:country\n object: '?country'\n - subject: '?subject'\n predicate: '<http://dbpedia.org/property/leaderName>'\n object: '?leader'\n filter:\n - 'FILTER (isIRI(?leader) || isLiteral(?leader))'\n```\n\nIn this example, the SPARQL Provider wraps the GeoJSON Provider.\nThe SPARQL Provider only uses variables prefixed with sparql\\_ in the configuration.\n\n- `data`: The path to the data file used by the wrapped provider (GeoJSON Provider in this case).\n- `id_field`: The field that serves as the unique identifier for features in the data.\n- `sparql_provider`: The name of the provider that will handle the SPARQL query results (GeoJSON Provider in this case).\n- `sparql_query`: The SPARQL object holding the content of the SPARQL query.\n - `endpoint`: The SPARQL variable representing the graph IRI in the query.\n - `bind`:\n - `name`: Field in the wrapped properties block to query the graph with\n - `variable`: The SPARQL variable used for querying (e.g., ?subject).\n prefixes:\n - `prefixes`: Optional dictionary defining the prefixes used in the SPARQL query.\n - `where`: A list of mappings that define the WHERE clause of the SPARQL query. Each mapping includes:\n - `subject`: The subject of the triple pattern.\n - `predicate`: The predicate of the triple pattern.\n - `object`: The object of the triple pattern.\n - `filter`: A list of SPARQL filter expressions to apply to the results.\n\n### GeoPandas\n\nThe 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).\n\n`id_field` is the only field that is required to be labelled.\n\n```yaml\nproviders:\n - type: feature\n name: pygeoapi_plugins.provider.geopandas_.GeoPandasProvider\n # Example data\n data: 'https://www.hydroshare.org/resource/3295a17b4cc24d34bd6a5c5aaf753c50/data/contents/hu02.gpkg'\n id_field: id\n```\n\nYou 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).\n\n## OGC API - Processes\n\nAdditional OGC API - Process are listed below\n\n### Intersector\n\nThe intersection process uses OGC API - Features Part 3: Filtering to return CQL intersections of features.\nAn example configuration in a pygeoapi configuration is below.\n\n```yaml\nintersector:\n type: process\n processor:\n name: pygeoapi_plugins.process.intersect.IntersectionProcessor\n```\n\nThis plugin is used in https:/reference.geoconnex.us/.\n\n### Sitemap Generator\n\nThe Sitemap Generator process makes use of the XML formatter and OGC API - Features to generate a sitemap of the pygeoapi instance.\nThis can be used with the python package [sitemap-generator](https://github.com/cgs-earth/sitemap-generator) to generate a sitemap index.\nAn example configuration in a pygeoapi configuration is below.\n\n```yaml\nsitemap-generator:\n type: process\n processor:\n name: pygeoapi_plugins.process.sitemap.SitemapProcessor\n```\n\n## OGC API - Environmental Data Retrieval\n\n### Sensorthings API\n\nThe EDR provider is implemented as the default for retrieving environmental data in a compliant manner with the OGC API - EDR specification. This ensures that spatial and temporal queries can be efficiently performed on the sensor data. Additionally, the OGC API - Features (OAF) provider is used to fill in the /items component of the API, allowing access to the Things (sensor devices) from the SensorThings API.\n\nBoth providers are configured together to offer a unified interface for sensor data access, while maintaining compliance with OGC standards. The EDR provider is responsible for the core environmental data retrieval, while the OAF provider exposes the sensor entities.\n\n> **Note:** For more information on configuring the OAF provider, refer to the [SensorThings API](https://docs.pygeoapi.io/en/latest/data-publishing/ogcapi-features.html#sensorthings-api) documentation.\n\n```yaml\nproviders:\n # EDR Provider for environmental data retrieval\n - type: edr\n name: pygeoapi_plugins.provider.sensorthings_edr.SensorThingsEDRProvider\n data: https://labs.waterdata.usgs.gov/sta/v1.1/\n\n # OAF Provider for exposing sensor entities (Things)\n - type: feature\n name: pygeoapi.provider.sensorthings.SensorThingsProvider\n data: https://labs.waterdata.usgs.gov/sta/v1.1/\n entity: Things\n title_field: name\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "pygeoapi plugins",
"version": "0.2.0",
"project_urls": {
"Homepage": "https://github.com/cgs-earth/pygeoapi-plugins"
},
"split_keywords": [
"cgs",
"pygeoapi",
"geopython"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f4b80ff2b1fa08a8bc3449ce8f27558d10e61fcd3801aa8d28a38fb29f2eb511",
"md5": "1d3564a7459c12e16340e5fb743e4c92",
"sha256": "a5e4fab2a57100a303a610d7d34c507a0aa2547f91ac25d7510ee3e66441f855"
},
"downloads": -1,
"filename": "pygeoapi_plugins-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1d3564a7459c12e16340e5fb743e4c92",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 37036,
"upload_time": "2024-09-12T22:51:23",
"upload_time_iso_8601": "2024-09-12T22:51:23.775297Z",
"url": "https://files.pythonhosted.org/packages/f4/b8/0ff2b1fa08a8bc3449ce8f27558d10e61fcd3801aa8d28a38fb29f2eb511/pygeoapi_plugins-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "30a920df75128d359789b0e89f3afe07eb4802e993c78b830608a333fd4e8022",
"md5": "c09c60429b85a78b0a2f8349425f55a0",
"sha256": "71da514e775994c9c037da16ccb6d48b2e7e60baeb5b2786bb57f7ff9fa3a239"
},
"downloads": -1,
"filename": "pygeoapi_plugins-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "c09c60429b85a78b0a2f8349425f55a0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 37210,
"upload_time": "2024-09-12T22:51:24",
"upload_time_iso_8601": "2024-09-12T22:51:24.934870Z",
"url": "https://files.pythonhosted.org/packages/30/a9/20df75128d359789b0e89f3afe07eb4802e993c78b830608a333fd4e8022/pygeoapi_plugins-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-12 22:51:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cgs-earth",
"github_project": "pygeoapi-plugins",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "pygeoapi-plugins"
}