Skip to content

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 5 commits into from
Jun 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added doc/images/projects/owslib/itasca.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/projects/owslib/logo_owslib.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/projects/owslib/owslib_screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
144 changes: 144 additions & 0 deletions doc/overview/owslib_overview.rst
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.
141 changes: 141 additions & 0 deletions doc/quickstart/owslib_quickstart.rst
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
--------------------

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/
2 changes: 2 additions & 0 deletions licenses.csv
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"osm_dataset_overview","","","Creative Commons Attribution 3.0 Unported (CC BY 3.0)"
"osm_overview","Hamish Bowman","Cameron Shorter, Jirotech; Angelos Tzotsos, OSGeo","Creative Commons"
"otb_overview","OSGeoLive","Cameron Shorter, Jirotech","Creative Commons Attribution 3.0 Unported (CC BY 3.0)"
"owslib_overview","OSGeoLive; Seth Girvin, Tom Kralidis","","Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)"
"pgrouting_overview","Daniel Kastl","Cameron Shorter, Jirotech; Angelos Tzotsos, OSGeo","Creative Commons Attribution 3.0 Unported (CC BY 3.0)"
"postgis_overview","OSGeoLive; Barry Rowlingson","Cameron Shorter, Jirotech; Angelos Tzotsos, OSGeo","Creative Commons Attribution 3.0 Unported (CC BY 3.0)"
"proj4_overview","OSGeoLive; Mike Adair, Julien Moquet","Cameron Shorter, Jirotech","Creative Commons Attribution 3.0 Unported (CC BY 3.0)"
Expand Down Expand Up @@ -75,6 +76,7 @@
"osgeolive_quickstart","OSGeoLive; Cameron Shorter, Hamish Bowman","Cameron Shorter, Jirotech","Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)"
"osm_quickstart","Hamish Bowman","","Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)"
"otb_quickstart","OSGeoLive; Manuel Grizonnet","","Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)"
"owslib_quickstart","OSGeoLive; Seth Girvin, Tom Kralidis","","Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)"
"pgrouting_quickstart","Daniel Kastl; Regina Obe","Angelos Tzotsos, OSGeo","Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)"
"postgis_quickstart","Barry Rowlingson; Astrid Emde; Regina Obe","Argyros Argyridis; Cameron Shorter, Jirotech; Nicolas Roelandt; Angelos Tzotsos, OSGeo","Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)"
"proj4_quickstart","OSGeoLive; Julien Moquet","Vicky Vergara","Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)"
Expand Down
14 changes: 13 additions & 1 deletion locale/en/LC_MESSAGES/copyright.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: OSGeoLive 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-04-29 18:41+0000\n"
"POT-Creation-Date: 2025-06-02 19:24+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -475,6 +475,14 @@ msgstr ""
msgid "otb_overview"
msgstr ""

#: ../../build/licenses.csv:1
msgid "owslib_overview"
msgstr ""

#: ../../build/licenses.csv:1
msgid "OSGeoLive; Seth Girvin, Tom Kralidis"
msgstr ""

#: ../../build/licenses.csv:1
msgid "pgrouting_overview"
msgstr ""
Expand Down Expand Up @@ -783,6 +791,10 @@ msgstr ""
msgid "OSGeoLive; Manuel Grizonnet"
msgstr ""

#: ../../build/licenses.csv:1
msgid "owslib_quickstart"
msgstr ""

#: ../../build/licenses.csv:1
msgid "pgrouting_quickstart"
msgstr ""
Expand Down
Loading