Skip to main content

DRB WMS OGC Service driver

Project description

WMS Driver

The web map service driver extends abstracts WxS driver with the getMap feature.

Nodes

WmsServiceNode

Represents the WMS service. This node has no attribute and has as children WmsOperationNode like GetMap. Others children give information about the service like layers, and are XmlNode. Those children are filled in by the information returned from the service's GetCapabilities request.

WmsOperationNode

Represents an operation than can mde on the service. For WMS service, the mandatory operation are GetMap, GetCapabilities, and GetFeatureInfo. Optional operations may be provided by the service and indicated in the possibilities thereof. Those optional operations are also represented as WmsOperationNode.

For perform an operation (mandatory or optional), you can use the operator '[]' with a dict that contains the parameters of the request.

Example:

dict_request = {'layers': 'mgrs_region', 'format': 'image/png', 'height': 256, 'width': 256, 'crs': 'EPSG:3857', 'bbox': '7514065.628545968,7514065.628545967,10018754.171394622,10018754.171394628'}


get_map = service_wms['GetMap'][dict_request]

For mandatory operations GetMap and GetFeatureInfo you can alternatively use Predicate WmsGetMapPredicate and WmsGetFeatureInfoPredicate.

Specific class define WXSNodeOperationGetMap and WXSNodeOperationGetFeatureInfo for accept respectively WmsGetMapPredicate WmsGetFeatureInfoPredicate.

Example:

predicate = WmsGetMapPredicate(layers='mgrs_region', height=256, width=256, bbox='7514065.628545968,7514065.628545967,10018754.171394622,10018754.171394628'}


get_map = service_wms['GetMap'][predicate]

Installation

pip install drb-driver-wms

Examples

from drb.drivers.wms import WmsServiceNode

url_wms='https+wms://geoserver.swarm.ops.internal.gael.fr/geoserver/demo/wms?'


service_wms = WmsServiceNode(url_wms)

list_cap = service_wms.children

print('----------------------------------------')
print('list_cap')

print(list_cap)

for child in service_wms:
    print(child)
    print(child.name)

#=> <drb.drivers.wXs.wXs_node.WXSNodeOperation object at 0x7fc2cb0aeaf0>
#=> GetCapabilities
#=> <drb.drivers.wXs.wXs_node.WXSNodeOperation object at 0x7fc2cb0ae520>
#=> GetMap
#=> <drb.drivers.wXs.wXs_node.WXSNodeOperation object at 0x7fc2cb0a2460>
#=> GetFeatureInfo
#=> <drb.drivers.xml.xml_node.XmlNode object at 0x7fc2cb0aefd0>
#=> Exception
#=> <drb.drivers.xml.xml_node.XmlNode object at 0x7fc2cb0aed30>
#=> Layer


get_map = service_wms['GetMap']

print('----------------------------------------')
print('GetMap : Format')

print(get_map @ 'Format')
#=> ['image/png', 'application/atom+xml', 'application/json;type=geojson', 'application/json;type=topojson', 'application/json;type=utfgrid', 'application/pdf', 'application/rss+xml', 'application/vnd.google-earth.kml+xml', 'application/vnd.google-earth.kml+xml;mode=networklink', 'application/vnd.google-earth.kmz', 'application/vnd.mapbox-vector-tile', 'image/geotiff', 'image/geotiff8', 'image/gif', 'image/jpeg', 'image/png; mode=8bit', 'image/svg+xml', 'image/tiff', 'image/tiff8', 'image/vnd.jpeg-png', 'image/vnd.jpeg-png8', 'text/html; subtype=openlayers', 'text/html; subtype=openlayers2', 'text/html; subtype=openlayers3']

dict_request = {'layers': 'mgrs_region', 'format': 'image/png', 'height': 256, 'width': 256, 'crs': 'EPSG:3857', 'bbox': '7514065.628545968,7514065.628545967,10018754.171394622,10018754.171394628'}


get_map = service_wms['GetMap'][dict_request]

print('----------------------------------------')
print('GetMap : with parameter return image')
print(get_map)
#=>  <drb.drivers.image.image_node_factory.DrbImageBaseNode object at 0x7fc2cb23efa0>

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

drb-driver-wms-1.2.0.tar.gz (30.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

drb_driver_wms-1.2.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file drb-driver-wms-1.2.0.tar.gz.

File metadata

  • Download URL: drb-driver-wms-1.2.0.tar.gz
  • Upload date:
  • Size: 30.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for drb-driver-wms-1.2.0.tar.gz
Algorithm Hash digest
SHA256 8ee82e8eac96988d5f5e5c781c30080178a530c75109509b172602fde59f7729
MD5 a9c6b88d9f20df0bf7954d5e8cb01802
BLAKE2b-256 4af92d70211c583c487cbdc6ceb651f480c29d51f8e5e295d2bf73e7ebd7395f

See more details on using hashes here.

File details

Details for the file drb_driver_wms-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: drb_driver_wms-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for drb_driver_wms-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 df7ca22c1b917f8f21f7fc80d37d3aa1c6e56f05a6bfaf2fc64848622901d746
MD5 fec7643fa6c79617f186f2ef8d6a34ca
BLAKE2b-256 fedf38e9b67e23ac864e02df4d7a520a485dde882ccebfb52d63b46d07d91764

See more details on using hashes here.

Supported by

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