Giter Site home page Giter Site logo

davisc / owslib Goto Github PK

View Code? Open in Web Editor NEW

This project forked from geopython/owslib

0.0 1.0 0.0 3.58 MB

OWSLib is a Python package for client programming with Open Geospatial Consortium (OGC) web service (hence OWS) interface standards, and their related content models.

Home Page: http://geopython.github.io/OWSLib

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.01% Python 99.99%

owslib's Introduction

OWSLib

Travis Build

GitHub license

Join the chat at https://gitter.im/geopython/OWSLib

OWSLib is a Python package for client programming with Open Geospatial Consortium (OGC) web service (hence OWS) interface standards, and their related content models.

Full documentation is available at http://geopython.github.io/OWSLib

OWSLib provides a common API for accessing service metadata and wrappers for numerous OGC Web Service interfaces.

Dependencies

OWSLib requires elementtree (standard in 2.5 as xml.etree) or lxml.

Installation

See http://geopython.github.io/OWSLib/#installation

Usage

Find out what a WMS has to offer. Service metadata:

>>> from owslib.wms import WebMapService
>>> wms = WebMapService('http://wms.jpl.nasa.gov/wms.cgi', version='1.1.1')
>>> wms.identification.type
'OGC:WMS'
>>> wms.identification.version
'1.1.1'
>>> wms.identification.title
'JPL Global Imagery Service'
>>> wms.identification.abstract
'WMS Server maintained by JPL, worldwide satellite imagery.'

Available layers:

>>> list(wms.contents)
['us_landsat_wgs84', 'modis', 'global_mosaic_base', 'huemapped_srtm',
'srtm_mag', 'daily_terra', 'us_ned', 'us_elevation', 'global_mosaic',
'daily_terra_ndvi', 'daily_aqua_ndvi', 'daily_aqua_721', 'daily_planet',
'BMNG', 'srtmplus', 'us_colordem', None, 'daily_aqua', 'worldwind_dem',
'daily_terra_721']

Details of a layer:

>>> wms['global_mosaic'].title
'WMS Global Mosaic, pan sharpened'
>>> wms['global_mosaic'].boundingBoxWGS84
(-180.0, -60.0, 180.0, 84.0)
>>> wms['global_mosaic'].crsOptions
['EPSG:4326', 'AUTO:42003']
>>> wms['global_mosaic'].styles
{'pseudo_bright': {'title': 'Pseudo-color image (Uses IR and Visual bands,
542 mapping), gamma 1.5'}, 'pseudo': {'title': '(default) Pseudo-color
image, pan sharpened (Uses IR and Visual bands, 542 mapping), gamma 1.5'},
'visual': {'title': 'Real-color image, pan sharpened (Uses the visual
bands, 321 mapping), gamma 1.5'}, 'pseudo_low': {'title': 'Pseudo-color
image, pan sharpened (Uses IR and Visual bands, 542 mapping)'},
'visual_low': {'title': 'Real-color image, pan sharpened (Uses the visual
bands, 321 mapping)'}, 'visual_bright': {'title': 'Real-color image (Uses
the visual bands, 321 mapping), gamma 1.5'}}

Available methods, their URLs, and available formats:

>>> [op.name for op in wms.operations]
['GetTileService', 'GetCapabilities', 'GetMap']
>>> wms.getOperationByName('GetMap').methods
{'Get': {'url': 'http://wms.jpl.nasa.gov/wms.cgi?'}}
>>> wms.getOperationByName('GetMap').formatOptions
['image/jpeg', 'image/png', 'image/geotiff', 'image/tiff']

That's everything needed to make a request for imagery:

>>> img = wms.getmap(   layers=['global_mosaic'],
...                     styles=['visual_bright'],
...                     srs='EPSG:4326',
...                     bbox=(-112, 36, -106, 41),
...                     size=(300, 250),
...                     format='image/jpeg',
...                     transparent=True
...                     )
>>> out = open('jpl_mosaic_visb.jpg', 'wb')
>>> out.write(img.read())
>>> out.close()

A very similar API exists for WebFeatureService. See tests/wfs_MapServerWFSCapabilities.txt for details.

There is also support for Web Coverage Service (WCS), Catalogue Service for the Web (CSW), Web Processing Service (WPS), and Web Map Tile Service (WMTS). Some of those are beta quality.

Logging

OWSLib logs messages to the 'owslib' named python logger. You may configure your application to use the log messages like so:

>>> import logging >>> owslib_log = logging.getLogger('owslib') >>> # Add formatting and handlers as needed >>> owslib_log.setLevel(logging.DEBUG)

Support

http://lists.osgeo.org/mailman/listinfo/owslib-users http://lists.osgeo.org/mailman/listinfo/owslib-devel

owslib's People

Contributors

bradh avatar cehbrecht avatar cleder avatar cowansm avatar daf avatar dblodgett-usgs avatar dokai avatar drnextgis avatar ict4eo avatar jachym avatar jenselme avatar juergenweichand avatar kalxas avatar kwilcox avatar ldesousa avatar lucacinquini avatar madi avatar menegon avatar micahcochran avatar pmdias avatar qulogic avatar rclark avatar rhattersley avatar roel avatar rsignell-usgs avatar selimnairb avatar severo avatar sgillies avatar tomkralidis avatar vicb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.