Add ESRI Service provider for OGC API - Features (#954)

This commit is contained in:
Benjamin Webb
2022-08-15 09:44:13 -04:00
committed by GitHub
parent eaf11ef7ad
commit 5a6fdd2bed
8 changed files with 788 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
# pygeoapi with ESRI Map and Feature Services
This folder contains the docker-compose configuration necessary to setup an example
`pygeoapi` server using a remote ESRI Service endpoint.
This config is only for example purposes.
## Hosting features with ArcGIS
Many ArcGIS layers are hosted as Feature Services. A collection of publically available
layers can be found in the [ArcGIS Living Atlas of the World](https://livingatlas.arcgis.com/en/browse/#d=2&q=Feature%20Service).
The ESRI feature provider creates pygeoapi feature collections from hosted layers. In addition to
hosting data from distributed data providers in one place, pygeoapi creates landing pages for
individual features in the layer.
## Building and Running
To build and run the [Docker compose file](docker-compose.yml) in localhost:
```
docker compose up [--build] [-d]
```
Navigate to `localhost:5000`.
+42
View File
@@ -0,0 +1,42 @@
# =================================================================
#
# Authors: Benjamin Webb <bwebb@lincolninst.edu>
#
# Copyright (c) 2022 Benjamin Webb
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following
# conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
# =================================================================
services:
pygeoapi:
image: geopython/pygeoapi:latest
# build:
# context: ../../..
container_name: pygeoapi_esri
ports:
- 5000:80
volumes:
- ./esri.config.yml:/pygeoapi/local.config.yml
+160
View File
@@ -0,0 +1,160 @@
# =================================================================
#
# Authors: Benjamin Webb <bwebb@lincolninst.edu>
#
# Copyright (c) 2022 Benjamin Webb
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following
# conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
# =================================================================
server:
bind:
host: 0.0.0.0
port: 80
url: http://localhost:5000
mimetype: application/json; charset=UTF-8
encoding: utf-8
gzip: false
language: en-US
cors: true
pretty_print: true
limit: 10
# templates: /path/to/templates
map:
url: https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png
attribution: '<a href="https://wikimediafoundation.org/wiki/Maps_Terms_of_Use">Wikimedia maps</a> | Map data &copy; <a href="https://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
ogc_schemas_location: /schemas.opengis.net
logging:
level: ERROR
#logfile: /tmp/pygeoapi.log
metadata:
identification:
title: ESRI pygeoapi demo instance
description: pygeoapi for ESRI Feature and Map Services
keywords:
- geospatial
- esri
- api
keywords_type: theme
terms_of_service: https://creativecommons.org/licenses/by/4.0/
url: https://github.com/geopython/pygeoapi
license:
name: CC-BY 4.0 license
url: https://creativecommons.org/licenses/by/4.0/
provider:
name: Center for Geospatial Solutions
url: https://www.lincolninst.edu/center-geospatial-solutions
contact:
name: Webb, Benjamin
position: Softare Developer
address: Mailing Address
city: City
stateorprovince: Administrative Area
postalcode: Zip or Postal Code
country: Canada
phone: +xx-xxx-xxx-xxxx
fax: +xx-xxx-xxx-xxxx
email: you@example.org
url: Contact URL
hours: Hours of Service
instructions: During hours of service. Off on weekends.
role: pointOfContact
resources:
counties:
type: collection
title: Counties
description: USA counties generalized boundaries
keywords:
- counties
- featureserver
links:
- type: text/html
rel: canonical
title: data source
href: https://www.arcgis.com/home/item.html?id=7566e0221e5646f99ea249a197116605
hreflang: en-US
extents:
spatial:
bbox: [-159.8, 19.6, -67.6, 65.5]
crs: http://www.opengis.net/def/crs/OGC/1.3/CRS84
providers:
- type: feature
name: ESRI
data: https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/USA_Counties_Generalized/FeatureServer/0
id_field: OBJECTID
title_field: NAME
states:
type: collection
title: States
description: USA states generalized boundaries
keywords:
- states
- featureserver
links:
- type: text/html
rel: canonical
title: data source
href: https://esri.maps.arcgis.com/home/item.html?id=8c2d6d7df8fa4142b0a1211c8dd66903
hreflang: en-US
extents:
spatial:
bbox: [-178.2, 18.9, -66.9, 71.4]
crs: http://www.opengis.net/def/crs/OGC/1.3/CRS84
providers:
- type: feature
name: ESRI
data: https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/USA_States_Generalized_Boundaries/FeatureServer/0
id_field: OBJECTID
title_field: STATE_NAME
covid:
type: collection
title: Covid
description: New York Times daily cumulative cases (per 100,000) by county
keywords:
- covid
- mapserver
links:
- type: text/html
rel: canonical
title: data source
href: https://www.arcgis.com/home/item.html?id=628578697fb24d8ea4c32fa0c5ae1843
hreflang: en-US
extents:
spatial:
bbox: [-159.8, 19.6, -67.6, 65.5]
crs: http://www.opengis.net/def/crs/OGC/1.3/CRS84
temporal:
begin: 2020-03-20T00:00:00Z
end: null
providers:
- type: feature
name: ESRI
data: https://services1.arcgis.com/0MSEUqKaxRlEPj5g/arcgis/rest/services/ncov_cases_US/FeatureServer/0
id_field: OBJECTID
time_field: Last_Update
title_field: Combined_Key