Skip to content

Commit a81f7c9

Browse files
authored
Merge pull request #893 from geographika/owslib
Add OWSLib overview and quickstart
2 parents 7d1e615 + e4c5d51 commit a81f7c9

File tree

17 files changed

+1524
-237
lines changed

17 files changed

+1524
-237
lines changed

doc/images/projects/owslib/itasca.png

317 KB
Loading
25 KB
Loading
57.2 KB
Loading

doc/overview/owslib_overview.rst

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
:Author: OSGeoLive
2+
:Author: Seth Girvin
3+
:Version: osgeolive17.0
4+
:License: Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
5+
6+
@LOGO_owslib@
7+
@OSGEO_KIND_owslib@
8+
9+
10+
@NAME_owslib@
11+
================================================================================
12+
13+
Open Geospatial Web Services Library
14+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15+
16+
OWSLib is a `Python`_ package for client programming with `Open Geospatial Consortium`_ (OGC) web service (hence OWS) interface standards,
17+
and their related content models.
18+
19+
OWSLib is Open Source, released under an BSD 3-Clause License, and runs on any platform that supports Python (Windows, Linux, Mac OS X).
20+
21+
@SCREENSHOT_owslib@
22+
23+
Core Features
24+
-------------
25+
26+
* easily connect to WMS, WFS, WCS, WPS, CSW services using Python (and many more)
27+
* support for the new `OGC APIs`_
28+
* easy to install with ``pip3 install OWSLib``
29+
* also available with Conda, and as a Debian package
30+
* an `OSGeo Community Project`_
31+
* detailed log output
32+
* support for proxies
33+
34+
Implemented Standards
35+
---------------------
36+
37+
OGC Standards
38+
+++++++++++++
39+
40+
+-----------------------+----------------+-----------------------+----------------+
41+
| **Standard** | **Version(s)** | **Standard** | **Version(s)** |
42+
+=======================+================+=======================+================+
43+
| `OGC WMS`_ | 1.1.1, 1.3.0 | `OGC WFS`_ | 1.0.0, 1.1.0, |
44+
| | | | 2.0.0, 3.0 |
45+
+-----------------------+----------------+-----------------------+----------------+
46+
| `OGC WCS`_ | 1.0.0, 1.1.0, | `OGC WMC`_ | 1.1.0 |
47+
| | 2.0, 2.0.1 | | |
48+
+-----------------------+----------------+-----------------------+----------------+
49+
| `OGC SOS`_ | 1.0.0, 2.0.0 | `OGC SensorML`_ | 1.0.1 |
50+
+-----------------------+----------------+-----------------------+----------------+
51+
| `OGC CSW`_ | 2.0.2 | `OGC WPS`_ | 1.0.0 |
52+
+-----------------------+----------------+-----------------------+----------------+
53+
| `OGC Filter`_ | 1.1.0 | `OGC OWS Common`_ | 1.0.0, 1.1.0, |
54+
| | | | 2.0 |
55+
+-----------------------+----------------+-----------------------+----------------+
56+
| `OGC OWS Context`_ | 1.0.0 (alpha) | `NASA DIF`_ | 9.7 |
57+
+-----------------------+----------------+-----------------------+----------------+
58+
| `FGDC CSDGM`_ | 1998 | `ISO 19139`_ | 2007 |
59+
+-----------------------+----------------+-----------------------+----------------+
60+
| `ISO 19139-2`_ | 2012 | `Dublin Core`_ | 1.1 |
61+
+-----------------------+----------------+-----------------------+----------------+
62+
| `Swiss GM03`_ | 2.3 | `OGC WMTS`_ | 1.0.0 |
63+
+-----------------------+----------------+-----------------------+----------------+
64+
| `WaterML`_ | 1.0, 1.1, 2.0 | `OpenSearch`_ | 1.1 |
65+
+-----------------------+----------------+-----------------------+----------------+
66+
67+
OGC API Support
68+
+++++++++++++++
69+
70+
+--------------------------------------------------------------------+-------------+------------------------------------------------------------+-------------+
71+
| **Standard** | **Version** | **Standard** | **Version** |
72+
+====================================================================+=============+============================================================+=============+
73+
| `OGC API - Features - Part 1: Core`_ | 1.0 | `OGC API - Coverages - Part 1: Core`_ | draft |
74+
+--------------------------------------------------------------------+-------------+------------------------------------------------------------+-------------+
75+
| `OGC API - Features - Part 3: Filtering`_ | draft | `OGC API - Processes - Part 1: Core`_ | 1.0 |
76+
+--------------------------------------------------------------------+-------------+------------------------------------------------------------+-------------+
77+
| `OGC API - Features - Part 4: Create, Replace, Update and Delete`_ | draft | `OGC API - Connected Systems - Part 1: Feature Resources`_ | draft |
78+
+--------------------------------------------------------------------+-------------+------------------------------------------------------------+-------------+
79+
| `OGC API - Records - Part 1: Core`_ | draft | `OGC API - Connected Systems - Part 2: Dynamic Data`_ | draft |
80+
+--------------------------------------------------------------------+-------------+------------------------------------------------------------+-------------+
81+
82+
Details
83+
--------------------------------------------------------------------------------
84+
85+
**Website:** @WEB_owslib@
86+
87+
**Licence:** `BSD 3-Clause License`_
88+
89+
**Software Version:** |version-owslib|
90+
91+
**Supported Platforms:** Windows, Linux, Mac
92+
93+
**API Interfaces:** Python
94+
95+
**Support:** |SUPPORT|
96+
97+
.. _`Open Geospatial Consortium`: https://ogc.org
98+
.. _`OGC APIs`: https://ogcapi.ogc.org
99+
.. _`Python`: https://www.python.org/
100+
.. _`OSGeo Community Project`: https://www.osgeo.org/projects/owslib/
101+
.. _`BSD 3-Clause License`: https://owslib.readthedocs.io/en/stable/license.html
102+
103+
.. _`OGC WMS`: https://www.opengeospatial.org/standards/wms
104+
.. _`OGC WFS`: https://www.opengeospatial.org/standards/wfs
105+
.. _`OGC WCS`: https://www.opengeospatial.org/standards/wcs
106+
.. _`OGC WMC`: https://www.opengeospatial.org/standards/wmc
107+
.. _`OGC WPS`: https://www.opengeospatial.org/standards/wps
108+
.. _`OGC SOS`: https://www.opengeospatial.org/standards/sos
109+
.. _`OGC O&M`: https://www.opengeospatial.org/standards/om
110+
.. _`OGC WaterML2.0`: https://www.opengeospatial.org/standards/waterml
111+
.. _`OGC SensorML`: https://www.opengeospatial.org/standards/sensorml
112+
.. _`OGC CSW`: https://www.opengeospatial.org/standards/cat
113+
.. _`OGC WMTS`: https://www.opengeospatial.org/standards/wmts
114+
.. _`OGC Filter`: https://www.opengeospatial.org/standards/filter
115+
.. _`OGC OWS Common`: https://www.opengeospatial.org/standards/common
116+
.. _`OGC OWS Context`: https://www.opengeospatial.org/standards/owc
117+
.. _`NASA DIF`: https://earthdata.nasa.gov/esdis/eso/standards-and-references/directory-interchange-format-dif-standard
118+
.. _`FGDC CSDGM`: https://www.fgdc.gov/metadata/csdgm-standard
119+
.. _`ISO 19115`: https://www.iso.org/standard/26020.html
120+
.. _`ISO 19139`: https://www.iso.org/standard/32557.html
121+
.. _`ISO 19139-2`: https://www.iso.org/standard/57104.html
122+
.. _`Dublin Core`: https://www.dublincore.org/
123+
.. _`CIA.vc`: http://cia.vc/stats/project/OWSLib
124+
.. _`WaterML`: http://his.cuahsi.org/wofws.html#waterml
125+
.. _`Swiss GM03`: https://www.geocat.admin.ch/en/dokumentation/gm03.html
126+
.. _`OGC API - Features - Part 1: Core`: https://docs.ogc.org/is/17-069r4/17-069r4.html
127+
.. _`OGC API - Features - Part 3: Filtering`: https://docs.ogc.org/is/19-079r2/19-079r2.html
128+
.. _`OGC API - Features - Part 4: Create, Replace, Update and Delete`: https://docs.ogc.org/DRAFTS/20-002r1.html
129+
.. _`OGC API - Coverages - Part 1: Core`: https://docs.ogc.org/DRAFTS/19-087.html
130+
.. _`OGC API - Maps - Part 1: Core`: https://docs.ogc.org/is/20-058/20-058.html
131+
.. _`OGC API - Records - Part 1: Core`: https://docs.ogc.org/is/20-004r1/20-004r1.html
132+
.. _`OGC API - Environmental Data Retrieval - Part 1: Core`: https://docs.ogc.org/is/19-086r6/19-086r6.html
133+
.. _`OGC API - Processes - Part 1: Core`: https://docs.ogc.org/is/18-062r2/18-062r2.html
134+
.. _`OGC API - Connected Systems - Part 1: Feature Resources`: https://docs.ogc.org/DRAFTS/23-001r0.html
135+
.. _`OGC API - Connected Systems - Part 2: Dynamic Data`: https://docs.ogc.org/DRAFTS/23-002r0.html
136+
.. _`OpenSearch`: https://github.com/dewitt/opensearch
137+
138+
139+
@VMDK_owslib@
140+
@QUICKSTART_owslib@
141+
142+
.. presentation-note
143+
OWSLib is a Python package for client programming with Open Geospatial Consortium (OGC) web service
144+
interface standards, and their related content models.

doc/quickstart/owslib_quickstart.rst

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
:Author: OSGeoLive
2+
:Author: Seth Girvin
3+
:Version: osgeolive17.0
4+
:License: Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
5+
6+
@LOGO_owslib@
7+
@OSGEO_KIND_owslib@
8+
@VMDK_owslib@
9+
10+
11+
12+
********************************************************************************
13+
@NAME_owslib@ Quickstart
14+
********************************************************************************
15+
16+
OWSLib is a Python package for client programming with Open Geospatial Consortium (OGC) web service
17+
interface standards, and their related content models.
18+
19+
Included with OSGeoLive, OWSLib offers ready-to-use access to OGC services exposed by
20+
other bundled geospatial applications.
21+
22+
.. contents:: Contents
23+
:local:
24+
25+
Download a WMS Image from MapServer
26+
-----------------------------------
27+
28+
An example of connecting to the MapServer demo on OSGeoLive and downloading a WMS image.
29+
30+
.. code-block:: bash
31+
32+
$ python3
33+
>>> from owslib.wms import WebMapService
34+
>>> url = "http://localhost/cgi-bin/mapserv?map=/usr/local/www/docs_maps/mapserver_demos/itasca/itasca.map"
35+
>>> wms = WebMapService(url, version='1.3.0')
36+
>>> wms.identification.title
37+
print(wms.identification.title)
38+
>>> list(wms.contents)
39+
['ITASCA', 'drgs',...
40+
>>> wms['mcd90py2'].title
41+
'Minor Civil Divisions'
42+
>>> wms['mcd90py2'].boundingBox
43+
(393234.0, 5207990.0, 495770.0, 5305370.0, 'EPSG:26915')
44+
>>> wms['mcd90py2'].crsOptions
45+
['EPSG:26915', 'EPSG:3857']
46+
>>> img = wms.getmap(layers=['ITASCA'], srs='EPSG:26915', bbox=(393234.0, 5207990.0, 495770.0, 5305370.0),
47+
size=(800, 800), format='image/png', transparent=True)
48+
>>> out = open('itasca.png', 'wb')
49+
>>> out.write(img.read())
50+
>>> out.close()
51+
52+
.. image:: /images/projects/owslib/itasca.png
53+
:scale: 70 %
54+
:alt: Output image from MapServer WMS
55+
56+
Inspect PyWPS Processes
57+
-----------------------
58+
59+
An example of connecting to the PyWPS demo server on OSGeoLive and inspecting the available processes.
60+
61+
.. code-block:: bash
62+
63+
$ python3
64+
>>> from owslib.wps import WebProcessingService
65+
>>> wps = WebProcessingService('http://localhost/pywps/wps.py?')
66+
>>> print(wps.identification)
67+
Service: WPS, title=PyWPS Processing Service
68+
>>> for process in wps.processes: print(f"Identifier: {process.identifier}: Title: {process.title}")
69+
Identifier: say_hello: Title: Process Say Hello
70+
>>> inputs = [("name", "OWSLib")]
71+
>>> execution = wps.execute(say_hello_process.identifier, inputs)
72+
>>> output_data = execution.processOutputs[0].data
73+
>>> print(f"Output data: {output_data}")
74+
Output data: ['Hello OWSLib']
75+
76+
Using CSW with pycsw
77+
--------------------
78+
79+
An example of connecting to the Catalogue Service for the Web (CSW) demo server provided by pycsw on OSGeoLive.
80+
81+
.. code-block:: bash
82+
83+
$ python3
84+
>>> from owslib.csw import CatalogueServiceWeb
85+
>>> csw = CatalogueServiceWeb('http://localhost/pycsw/')
86+
>>> print(f"Title {csw.identification.title} Type: {csw.identification.type}")
87+
Title: pycsw Geospatial Catalogue Type: CSW
88+
>>> [op.name for op in csw.operations]
89+
['GetCapabilities', 'DescribeRecord', 'GetDomain', 'GetRecords', 'GetRecordById', 'GetRepositoryItem']
90+
>>> from owslib.fes import PropertyIsEqualTo, PropertyIsLike, BBox
91+
>>> query = PropertyIsEqualTo('csw:AnyText', 'Lorem ipsum')
92+
>>> csw.getrecords2(constraints=[query], maxrecords=20)
93+
>>> csw.results
94+
{'matches': 2, 'returned': 2, 'nextrecord': 0}
95+
>>> for rec in csw.records: print(csw.records[rec].abstract)
96+
Quisque lacus diam, placerat mollis, pharetra in, commodo sed, augue. Duis iaculis arcu vel arcu.
97+
None
98+
99+
Connect to the pygeoapi OGC Features API
100+
----------------------------------------
101+
102+
An example of connecting to the pygeoapi demo server on OSGeoLive and retrieving a feature collection, using
103+
the OGC Features API.
104+
105+
To run the example below on OSGeoLive, first ensure the pygeoapi demo server is
106+
running. From the desktop, choose :menuselection:`Geospatial --> Web Services --> Start pygeoapi`.
107+
Then, in a terminal, run the following commands:
108+
109+
.. code-block:: bash
110+
111+
$ python3
112+
>>> from owslib.ogcapi.features import Features
113+
>>> service = Features("http://localhost:5000/")
114+
>>> feature_collections = service.feature_collections()
115+
>>> print(feature_collections)
116+
['lakes']
117+
>>> lake = service.collection_items('lakes', name='Lake Victoria')
118+
>>> import json
119+
>>> print(json.dumps(lake, indent=4))
120+
{
121+
"type": "FeatureCollection",
122+
"features": [
123+
{
124+
"type": "Feature",
125+
"properties": {
126+
"id": 6,
127+
"scalerank": 0,
128+
"name": "Lake Victoria",
129+
130+
What next?
131+
----------
132+
133+
OSGeoLive includes a set of Jupyter notebooks, including examples of OWSLib usage, and providing more
134+
details on the examples above. From the desktop, choose :menuselection:`Geospatial --> Spatial Tools --> Jupyter Notebook`.
135+
136+
The `Doing Geospatial in Python`_ workshop also includes several notebooks demonstrating OWSLib usage.
137+
138+
For more information on OWSLib, please consult the `documentation`_ on the OWSLib website.
139+
140+
.. _`documentation`: https://owslib.readthedocs.io
141+
.. _`Doing Geospatial in Python` : https://geopython.github.io/geopython-workshop/

licenses.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"osm_dataset_overview","","","Creative Commons Attribution 3.0 Unported (CC BY 3.0)"
3434
"osm_overview","Hamish Bowman","Cameron Shorter, Jirotech; Angelos Tzotsos, OSGeo","Creative Commons"
3535
"otb_overview","OSGeoLive","Cameron Shorter, Jirotech","Creative Commons Attribution 3.0 Unported (CC BY 3.0)"
36+
"owslib_overview","OSGeoLive; Seth Girvin, Tom Kralidis","","Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)"
3637
"pgrouting_overview","Daniel Kastl","Cameron Shorter, Jirotech; Angelos Tzotsos, OSGeo","Creative Commons Attribution 3.0 Unported (CC BY 3.0)"
3738
"postgis_overview","OSGeoLive; Barry Rowlingson","Cameron Shorter, Jirotech; Angelos Tzotsos, OSGeo","Creative Commons Attribution 3.0 Unported (CC BY 3.0)"
3839
"proj4_overview","OSGeoLive; Mike Adair, Julien Moquet","Cameron Shorter, Jirotech","Creative Commons Attribution 3.0 Unported (CC BY 3.0)"
@@ -75,6 +76,7 @@
7576
"osgeolive_quickstart","OSGeoLive; Cameron Shorter, Hamish Bowman","Cameron Shorter, Jirotech","Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)"
7677
"osm_quickstart","Hamish Bowman","","Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)"
7778
"otb_quickstart","OSGeoLive; Manuel Grizonnet","","Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)"
79+
"owslib_quickstart","OSGeoLive; Seth Girvin, Tom Kralidis","","Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)"
7880
"pgrouting_quickstart","Daniel Kastl; Regina Obe","Angelos Tzotsos, OSGeo","Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)"
7981
"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)"
8082
"proj4_quickstart","OSGeoLive; Julien Moquet","Vicky Vergara","Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)"

locale/en/LC_MESSAGES/copyright.po

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: OSGeoLive 14.0\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-04-29 18:41+0000\n"
11+
"POT-Creation-Date: 2025-06-02 19:24+0000\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -475,6 +475,14 @@ msgstr ""
475475
msgid "otb_overview"
476476
msgstr ""
477477

478+
#: ../../build/licenses.csv:1
479+
msgid "owslib_overview"
480+
msgstr ""
481+
482+
#: ../../build/licenses.csv:1
483+
msgid "OSGeoLive; Seth Girvin, Tom Kralidis"
484+
msgstr ""
485+
478486
#: ../../build/licenses.csv:1
479487
msgid "pgrouting_overview"
480488
msgstr ""
@@ -783,6 +791,10 @@ msgstr ""
783791
msgid "OSGeoLive; Manuel Grizonnet"
784792
msgstr ""
785793

794+
#: ../../build/licenses.csv:1
795+
msgid "owslib_quickstart"
796+
msgstr ""
797+
786798
#: ../../build/licenses.csv:1
787799
msgid "pgrouting_quickstart"
788800
msgstr ""

0 commit comments

Comments
 (0)