Skip to main content

OWS utilities

Project description

pyows

Build Status PyPI version Documentation Status

pyows is a library to help building an OWS compatible service or client. It helps building requests and parsing them and also provides object types to be serialized and sent as responses.

Installation

Use the package manager pip to install pyows.

pip install pyows

Usage

pyows can be used to both parse/encode OWS requests and to parse/encode objects for the various services.

Example: Parsing a WCS 2.0 GetCoverage request:

>>> from ows.wcs.v20.decoders import xml_decode_get_coverage
>>>
>>> request = b"""<?xml version="1.0" encoding="UTF-8"?>
... <wcs:GetCoverage
...     xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
...     xsi:schemaLocation="http://www.opengis.net/wcs/2.0 http://schemas.opengis.net/wcs/2.0/wcsAll.xsd"
...     xmlns="http://www.opengis.net/wcs/2.0"
...     xmlns:wcs="http://www.opengis.net/wcs/2.0"
...     service="WCS"
...     version="2.0.1">
...     <wcs:CoverageId>a</wcs:CoverageId>
... </wcs:GetCoverage>
... """
>>> print(xml_decode_get_coverage(request))
GetCoverageRequest(coverage_id='a', format=None, mediatype=None, subsetting_crs=None, output_crs=None, subsets=[], scalefactor=None, scales=[], interpolation=None, axis_interpolations=[], range_subset=None)

The other way around:

>>> from ows.wcs.v20 import GetCoverageRequest, Trim, Slice
>>> request = GetCoverageRequest(
...     coverage_id='a',
...     subsets=[
...         Trim(dimension='x', low=1.2, high=2.2),
...         Trim(dimension='y', low=3),
...         Slice(dimension='time', point='2018-05-07')
...     ]
... )
>>> print(xml_encode_get_coverage(request, pretty_print=True).value.decode('utf-8'))
<wcs:GetCoverage xmlns:crs="http://www.opengis.net/wcs/crs/1.0" xmlns:eop="http://www.opengis.net/eop/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:gmlcov="http://www.opengis.net/gmlcov/1.0" xmlns:int="http://www.opengis.net/wcs/interpolation/1.0" xmlns:ogc="http://www.opengis.net/ogc" xmlns:om="http://www.opengis.net/om/2.0" xmlns:ows="http://www.opengis.net/ows/2.0" xmlns:rsub="http://www.opengis.net/wcs/range-subsetting/1.0" xmlns:scal="http://www.opengis.net/wcs/scaling/1.0" xmlns:swe="http://www.opengis.net/swe/2.0" xmlns:wcs="http://www.opengis.net/wcs/2.0" xmlns:wcseo="http://www.opengis.net/wcs/wcseo/1.0" xmlns:xlink="http://www.w3.org/1999/xlink" service="WCS" version="2.0.1">
  <wcs:CoverageId>a</wcs:CoverageId>
  <wcs:DimensionTrim>
    <wcs:Dimension>x</wcs:Dimension>
    <wcs:TrimLow>1.2</wcs:TrimLow>
    <wcs:TrimHigh>2.2</wcs:TrimHigh>
  </wcs:DimensionTrim>
  <wcs:DimensionTrim>
    <wcs:Dimension>y</wcs:Dimension>
    <wcs:TrimLow>3</wcs:TrimLow>
  </wcs:DimensionTrim>
  <wcs:DimensionSlice>
    <wcs:Dimension>time</wcs:Dimension>
    <wcs:SlicePoint>2018-05-07</wcs:SlicePoint>
  </wcs:DimensionSlice>
</wcs:GetCoverage>

Currently supported OWS

  • OWS common
    • 2.0:
      • Capabilities related encoding
  • WCS
    • 2.0:
      • Request encoding/decoding for (both XML/KVP)
        • GetCapabilities
        • DescribeCoverage
        • GetCoverage
      • Response encoding
        • Capabilities
        • CoverageDescriptions
    • 2.1
      • Response encoding for
        • CoverageDescriptions
  • WMS
    • 1.3:
      • Request encoding/decoding KVP
        • GetCapabilities
        • GetMap
        • GetFeatureInfo
      • Response encoding
        • Capabilities

Roadmap

  • Full support of WCS 2.x including EO-WCS application profile and all extensions
  • Support for WPS 2.0 requests and responses
  • Support for WMS request and responses for all versions

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyows-0.2.7.tar.gz (49.4 kB view details)

Uploaded Source

Built Distribution

pyows-0.2.7-py3-none-any.whl (92.2 kB view details)

Uploaded Python 3

File details

Details for the file pyows-0.2.7.tar.gz.

File metadata

  • Download URL: pyows-0.2.7.tar.gz
  • Upload date:
  • Size: 49.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for pyows-0.2.7.tar.gz
Algorithm Hash digest
SHA256 9486234489ad33b9f0deab6169a244c11f85d70766b3dc67a664ab9c188cacb6
MD5 0e8954d0f34d0ca3fc020d948734f1ea
BLAKE2b-256 327e2a37c803e83fce164e554cbd6b83e52da35b982b56e306b4dfb370096e37

See more details on using hashes here.

File details

Details for the file pyows-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: pyows-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 92.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for pyows-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 5432bd3f153df249eb94fab03d898c76fda2c65d38eddd4caea0a7ee70e3d65a
MD5 0386b9eddfa9c0b123c695f03e339c12
BLAKE2b-256 05389f6c937812a7af47e1e5913e5d4dc42cf835e406ffa7d070ad94583e702c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page