-
Notifications
You must be signed in to change notification settings - Fork 120
Add OWSLib overview and quickstart #893
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8dab0d0
Add OWSLib overview and quickstart
geographika 5025f92
Add in suggested feedback
geographika eadaed0
Locale update: for commit 5025f92
github-actions[bot] 96e161b
Add owslib
geographika e4c5d51
Locale update: for commit 96e161b
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
:Author: OSGeoLive | ||
:Author: Seth Girvin | ||
:Version: osgeolive17.0 | ||
:License: Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) | ||
|
||
@LOGO_owslib@ | ||
@OSGEO_KIND_owslib@ | ||
|
||
|
||
@NAME_owslib@ | ||
================================================================================ | ||
|
||
Open Geospatial Web Services Library | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
OWSLib is a `Python`_ package for client programming with `Open Geospatial Consortium`_ (OGC) web service (hence OWS) interface standards, | ||
and their related content models. | ||
|
||
OWSLib is Open Source, released under an BSD 3-Clause License, and runs on any platform that supports Python (Windows, Linux, Mac OS X). | ||
|
||
@SCREENSHOT_owslib@ | ||
|
||
Core Features | ||
------------- | ||
|
||
* easily connect to WMS, WFS, WCS, WPS, CSW services using Python (and many more) | ||
* support for the new `OGC APIs`_ | ||
* easy to install with ``pip3 install OWSLib`` | ||
* also available with Conda, and as a Debian package | ||
* an `OSGeo Community Project`_ | ||
* detailed log output | ||
* support for proxies | ||
|
||
Implemented Standards | ||
--------------------- | ||
|
||
OGC Standards | ||
+++++++++++++ | ||
|
||
+-----------------------+----------------+-----------------------+----------------+ | ||
| **Standard** | **Version(s)** | **Standard** | **Version(s)** | | ||
+=======================+================+=======================+================+ | ||
| `OGC WMS`_ | 1.1.1, 1.3.0 | `OGC WFS`_ | 1.0.0, 1.1.0, | | ||
| | | | 2.0.0, 3.0 | | ||
+-----------------------+----------------+-----------------------+----------------+ | ||
| `OGC WCS`_ | 1.0.0, 1.1.0, | `OGC WMC`_ | 1.1.0 | | ||
| | 2.0, 2.0.1 | | | | ||
+-----------------------+----------------+-----------------------+----------------+ | ||
| `OGC SOS`_ | 1.0.0, 2.0.0 | `OGC SensorML`_ | 1.0.1 | | ||
+-----------------------+----------------+-----------------------+----------------+ | ||
| `OGC CSW`_ | 2.0.2 | `OGC WPS`_ | 1.0.0 | | ||
+-----------------------+----------------+-----------------------+----------------+ | ||
| `OGC Filter`_ | 1.1.0 | `OGC OWS Common`_ | 1.0.0, 1.1.0, | | ||
| | | | 2.0 | | ||
+-----------------------+----------------+-----------------------+----------------+ | ||
| `OGC OWS Context`_ | 1.0.0 (alpha) | `NASA DIF`_ | 9.7 | | ||
+-----------------------+----------------+-----------------------+----------------+ | ||
| `FGDC CSDGM`_ | 1998 | `ISO 19139`_ | 2007 | | ||
+-----------------------+----------------+-----------------------+----------------+ | ||
| `ISO 19139-2`_ | 2012 | `Dublin Core`_ | 1.1 | | ||
+-----------------------+----------------+-----------------------+----------------+ | ||
| `Swiss GM03`_ | 2.3 | `OGC WMTS`_ | 1.0.0 | | ||
+-----------------------+----------------+-----------------------+----------------+ | ||
| `WaterML`_ | 1.0, 1.1, 2.0 | `OpenSearch`_ | 1.1 | | ||
+-----------------------+----------------+-----------------------+----------------+ | ||
|
||
OGC API Support | ||
+++++++++++++++ | ||
|
||
+--------------------------------------------------------------------+-------------+------------------------------------------------------------+-------------+ | ||
| **Standard** | **Version** | **Standard** | **Version** | | ||
+====================================================================+=============+============================================================+=============+ | ||
| `OGC API - Features - Part 1: Core`_ | 1.0 | `OGC API - Coverages - Part 1: Core`_ | draft | | ||
+--------------------------------------------------------------------+-------------+------------------------------------------------------------+-------------+ | ||
| `OGC API - Features - Part 3: Filtering`_ | draft | `OGC API - Processes - Part 1: Core`_ | 1.0 | | ||
+--------------------------------------------------------------------+-------------+------------------------------------------------------------+-------------+ | ||
| `OGC API - Features - Part 4: Create, Replace, Update and Delete`_ | draft | `OGC API - Connected Systems - Part 1: Feature Resources`_ | draft | | ||
+--------------------------------------------------------------------+-------------+------------------------------------------------------------+-------------+ | ||
| `OGC API - Records - Part 1: Core`_ | draft | `OGC API - Connected Systems - Part 2: Dynamic Data`_ | draft | | ||
+--------------------------------------------------------------------+-------------+------------------------------------------------------------+-------------+ | ||
|
||
Details | ||
-------------------------------------------------------------------------------- | ||
|
||
**Website:** @WEB_owslib@ | ||
|
||
**Licence:** `BSD 3-Clause License`_ | ||
|
||
**Software Version:** |version-owslib| | ||
|
||
**Supported Platforms:** Windows, Linux, Mac | ||
|
||
**API Interfaces:** Python | ||
|
||
**Support:** |SUPPORT| | ||
|
||
.. _`Open Geospatial Consortium`: https://ogc.org | ||
.. _`OGC APIs`: https://ogcapi.ogc.org | ||
.. _`Python`: https://www.python.org/ | ||
.. _`OSGeo Community Project`: https://www.osgeo.org/projects/owslib/ | ||
.. _`BSD 3-Clause License`: https://owslib.readthedocs.io/en/stable/license.html | ||
|
||
.. _`OGC WMS`: https://www.opengeospatial.org/standards/wms | ||
.. _`OGC WFS`: https://www.opengeospatial.org/standards/wfs | ||
.. _`OGC WCS`: https://www.opengeospatial.org/standards/wcs | ||
.. _`OGC WMC`: https://www.opengeospatial.org/standards/wmc | ||
.. _`OGC WPS`: https://www.opengeospatial.org/standards/wps | ||
.. _`OGC SOS`: https://www.opengeospatial.org/standards/sos | ||
.. _`OGC O&M`: https://www.opengeospatial.org/standards/om | ||
.. _`OGC WaterML2.0`: https://www.opengeospatial.org/standards/waterml | ||
.. _`OGC SensorML`: https://www.opengeospatial.org/standards/sensorml | ||
.. _`OGC CSW`: https://www.opengeospatial.org/standards/cat | ||
.. _`OGC WMTS`: https://www.opengeospatial.org/standards/wmts | ||
.. _`OGC Filter`: https://www.opengeospatial.org/standards/filter | ||
.. _`OGC OWS Common`: https://www.opengeospatial.org/standards/common | ||
.. _`OGC OWS Context`: https://www.opengeospatial.org/standards/owc | ||
.. _`NASA DIF`: https://earthdata.nasa.gov/esdis/eso/standards-and-references/directory-interchange-format-dif-standard | ||
.. _`FGDC CSDGM`: https://www.fgdc.gov/metadata/csdgm-standard | ||
.. _`ISO 19115`: https://www.iso.org/standard/26020.html | ||
.. _`ISO 19139`: https://www.iso.org/standard/32557.html | ||
.. _`ISO 19139-2`: https://www.iso.org/standard/57104.html | ||
.. _`Dublin Core`: https://www.dublincore.org/ | ||
.. _`CIA.vc`: http://cia.vc/stats/project/OWSLib | ||
.. _`WaterML`: http://his.cuahsi.org/wofws.html#waterml | ||
.. _`Swiss GM03`: https://www.geocat.admin.ch/en/dokumentation/gm03.html | ||
.. _`OGC API - Features - Part 1: Core`: https://docs.ogc.org/is/17-069r4/17-069r4.html | ||
.. _`OGC API - Features - Part 3: Filtering`: https://docs.ogc.org/is/19-079r2/19-079r2.html | ||
.. _`OGC API - Features - Part 4: Create, Replace, Update and Delete`: https://docs.ogc.org/DRAFTS/20-002r1.html | ||
.. _`OGC API - Coverages - Part 1: Core`: https://docs.ogc.org/DRAFTS/19-087.html | ||
.. _`OGC API - Maps - Part 1: Core`: https://docs.ogc.org/is/20-058/20-058.html | ||
.. _`OGC API - Records - Part 1: Core`: https://docs.ogc.org/is/20-004r1/20-004r1.html | ||
.. _`OGC API - Environmental Data Retrieval - Part 1: Core`: https://docs.ogc.org/is/19-086r6/19-086r6.html | ||
.. _`OGC API - Processes - Part 1: Core`: https://docs.ogc.org/is/18-062r2/18-062r2.html | ||
.. _`OGC API - Connected Systems - Part 1: Feature Resources`: https://docs.ogc.org/DRAFTS/23-001r0.html | ||
.. _`OGC API - Connected Systems - Part 2: Dynamic Data`: https://docs.ogc.org/DRAFTS/23-002r0.html | ||
.. _`OpenSearch`: https://github.com/dewitt/opensearch | ||
|
||
|
||
@VMDK_owslib@ | ||
@QUICKSTART_owslib@ | ||
|
||
.. presentation-note | ||
OWSLib is a Python package for client programming with Open Geospatial Consortium (OGC) web service | ||
interface standards, and their related content models. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
:Author: OSGeoLive | ||
:Author: Seth Girvin | ||
:Version: osgeolive17.0 | ||
:License: Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) | ||
|
||
@LOGO_owslib@ | ||
@OSGEO_KIND_owslib@ | ||
@VMDK_owslib@ | ||
|
||
|
||
|
||
******************************************************************************** | ||
@NAME_owslib@ Quickstart | ||
******************************************************************************** | ||
|
||
OWSLib is a Python package for client programming with Open Geospatial Consortium (OGC) web service | ||
interface standards, and their related content models. | ||
|
||
Included with OSGeoLive, OWSLib offers ready-to-use access to OGC services exposed by | ||
other bundled geospatial applications. | ||
|
||
.. contents:: Contents | ||
:local: | ||
|
||
Download a WMS Image from MapServer | ||
----------------------------------- | ||
|
||
An example of connecting to the MapServer demo on OSGeoLive and downloading a WMS image. | ||
|
||
.. code-block:: bash | ||
|
||
$ python3 | ||
>>> from owslib.wms import WebMapService | ||
>>> url = "http://localhost/cgi-bin/mapserv?map=/usr/local/www/docs_maps/mapserver_demos/itasca/itasca.map" | ||
>>> wms = WebMapService(url, version='1.3.0') | ||
>>> wms.identification.title | ||
print(wms.identification.title) | ||
>>> list(wms.contents) | ||
['ITASCA', 'drgs',... | ||
>>> wms['mcd90py2'].title | ||
'Minor Civil Divisions' | ||
>>> wms['mcd90py2'].boundingBox | ||
(393234.0, 5207990.0, 495770.0, 5305370.0, 'EPSG:26915') | ||
>>> wms['mcd90py2'].crsOptions | ||
['EPSG:26915', 'EPSG:3857'] | ||
>>> img = wms.getmap(layers=['ITASCA'], srs='EPSG:26915', bbox=(393234.0, 5207990.0, 495770.0, 5305370.0), | ||
size=(800, 800), format='image/png', transparent=True) | ||
>>> out = open('itasca.png', 'wb') | ||
>>> out.write(img.read()) | ||
>>> out.close() | ||
|
||
.. image:: /images/projects/owslib/itasca.png | ||
:scale: 70 % | ||
:alt: Output image from MapServer WMS | ||
|
||
Inspect PyWPS Processes | ||
----------------------- | ||
|
||
An example of connecting to the PyWPS demo server on OSGeoLive and inspecting the available processes. | ||
|
||
.. code-block:: bash | ||
|
||
$ python3 | ||
>>> from owslib.wps import WebProcessingService | ||
>>> wps = WebProcessingService('http://localhost/pywps/wps.py?') | ||
>>> print(wps.identification) | ||
Service: WPS, title=PyWPS Processing Service | ||
>>> for process in wps.processes: print(f"Identifier: {process.identifier}: Title: {process.title}") | ||
Identifier: say_hello: Title: Process Say Hello | ||
>>> inputs = [("name", "OWSLib")] | ||
>>> execution = wps.execute(say_hello_process.identifier, inputs) | ||
>>> output_data = execution.processOutputs[0].data | ||
>>> print(f"Output data: {output_data}") | ||
Output data: ['Hello OWSLib'] | ||
|
||
Using CSW with pycsw | ||
geographika marked this conversation as resolved.
Show resolved
Hide resolved
|
||
-------------------- | ||
|
||
An example of connecting to the Catalogue Service for the Web (CSW) demo server provided by pycsw on OSGeoLive. | ||
|
||
.. code-block:: bash | ||
|
||
$ python3 | ||
>>> from owslib.csw import CatalogueServiceWeb | ||
>>> csw = CatalogueServiceWeb('http://localhost/pycsw/') | ||
>>> print(f"Title {csw.identification.title} Type: {csw.identification.type}") | ||
Title: pycsw Geospatial Catalogue Type: CSW | ||
>>> [op.name for op in csw.operations] | ||
['GetCapabilities', 'DescribeRecord', 'GetDomain', 'GetRecords', 'GetRecordById', 'GetRepositoryItem'] | ||
>>> from owslib.fes import PropertyIsEqualTo, PropertyIsLike, BBox | ||
>>> query = PropertyIsEqualTo('csw:AnyText', 'Lorem ipsum') | ||
>>> csw.getrecords2(constraints=[query], maxrecords=20) | ||
>>> csw.results | ||
{'matches': 2, 'returned': 2, 'nextrecord': 0} | ||
>>> for rec in csw.records: print(csw.records[rec].abstract) | ||
Quisque lacus diam, placerat mollis, pharetra in, commodo sed, augue. Duis iaculis arcu vel arcu. | ||
None | ||
|
||
Connect to the pygeoapi OGC Features API | ||
---------------------------------------- | ||
|
||
An example of connecting to the pygeoapi demo server on OSGeoLive and retrieving a feature collection, using | ||
the OGC Features API. | ||
|
||
To run the example below on OSGeoLive, first ensure the pygeoapi demo server is | ||
running. From the desktop, choose :menuselection:`Geospatial --> Web Services --> Start pygeoapi`. | ||
Then, in a terminal, run the following commands: | ||
|
||
.. code-block:: bash | ||
|
||
$ python3 | ||
>>> from owslib.ogcapi.features import Features | ||
>>> service = Features("http://localhost:5000/") | ||
>>> feature_collections = service.feature_collections() | ||
>>> print(feature_collections) | ||
['lakes'] | ||
>>> lake = service.collection_items('lakes', name='Lake Victoria') | ||
>>> import json | ||
>>> print(json.dumps(lake, indent=4)) | ||
{ | ||
"type": "FeatureCollection", | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"id": 6, | ||
"scalerank": 0, | ||
"name": "Lake Victoria", | ||
|
||
What next? | ||
---------- | ||
|
||
OSGeoLive includes a set of Jupyter notebooks, including examples of OWSLib usage, and providing more | ||
details on the examples above. From the desktop, choose :menuselection:`Geospatial --> Spatial Tools --> Jupyter Notebook`. | ||
|
||
The `Doing Geospatial in Python`_ workshop also includes several notebooks demonstrating OWSLib usage. | ||
|
||
For more information on OWSLib, please consult the `documentation`_ on the OWSLib website. | ||
|
||
.. _`documentation`: https://owslib.readthedocs.io | ||
.. _`Doing Geospatial in Python` : https://geopython.github.io/geopython-workshop/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.