Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepy
titlesimple syntax to get list of available layers offered by WFS server
# carry out necessary import (to install OWSLib, pip install owslib)
from owslib import wfs,wms

# give URL, this is the URL of Deltares Data Portal
url = 'http://deltaresdata.openearth.nl/geoserver/ows?'

# construct wfs
awfs = wfs.WebFeatureService(url,version='1.0.0')

# print available layers
for layer in awfs.contents.keys():
    print layer

This example is based on the Deltares Data Portal geoserver contents. Every known URL can be used, like the 'http://geo.vliz.be/geoserver/wfs?' as used in the above primer examples.
Off course more information can be retrieved. Basic documentation on OWSLib can be found on geopython page and more detailed on the doctest section of this github repository.

...