Skip to main content

DRB WMS OGC Service implementation

Project description

WMS implementation

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-impl-wms

Examples

from drb.factory import DrbFactoryResolver

from drb_impl_wms import WmsServiceNode

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


resolver = DrbFactoryResolver()

service_wms = WmsServiceNode(url_wms)

list_cap = service_wms.children

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

print(list_cap)

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

#=> <drb_impl_wXs.wXs_node.WXSNodeOperation object at 0x7fc2cb0aeaf0>
#=> GetCapabilities
#=> <drb_impl_wXs.wXs_node.WXSNodeOperation object at 0x7fc2cb0ae520>
#=> GetMap
#=> <drb_impl_wXs.wXs_node.WXSNodeOperation object at 0x7fc2cb0a2460>
#=> GetFeatureInfo
#=> <drb_impl_xml.xml_node.XmlNode object at 0x7fc2cb0aefd0>
#=> Exception
#=> <drb_impl_xml.xml_node.XmlNode object at 0x7fc2cb0aed30>
#=> Layer
    
    
get_map = service_wms['GetMap']

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

print(get_map.get_attribute('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_impl_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-impl-wms-1.0.0.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

drb_impl_wms-1.0.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file drb-impl-wms-1.0.0.tar.gz.

File metadata

  • Download URL: drb-impl-wms-1.0.0.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for drb-impl-wms-1.0.0.tar.gz
Algorithm Hash digest
SHA256 bfc37a37495d5af1103d11473efd0ed2b954b870a85dd97e00fb03a2131e38a4
MD5 efe6f7efadee471f942cdbaa735e7746
BLAKE2b-256 4a04c7dd3ff36f5b03d2127d860f410216e7d3d25e2efb2db97ca22010cfbc28

See more details on using hashes here.

File details

Details for the file drb_impl_wms-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for drb_impl_wms-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f012ea2e8e5b1e7b1ac8b54466cf3b299a830f5cf60dcf75d650ac3bad9aace6
MD5 60388c861695ded34bd003bedc101737
BLAKE2b-256 89aeaf3c4cc8bdc53fe4fbdc32b81201abfaa1fd8ecb0b3b741c03c4873c69ce

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