Skip to main content

WMTS implementation

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

Nodes

WmtsServiceNode

Represents the WMTS service. This node has no attribute and has as children WmtsOperationNode like GetTile. 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.

WmtsOperationNode

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

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_wmts['GetTile'][dict_request]

For mandatory operations GetTile and GetFeatureInfo you can alternatively use Predicate WmtsGetTilePredicate and WmtsGetFeatureInfoPredicate.

Specific class define WXSNodeOperationGetTile and WXSNodeOperationGetFeatureInfo for accept respectively WmtsGetTilePredicate WmtsGetFeatureInfoPredicate.

Example:

predicate = WmtsGetTilePredicate(layer='ORTHOIMAGERY.ORTHOPHOTOS',
                                 tile_matrix_set='PM',
                                 tile_matrix=14, tile_col=8180, tile_row=5905,
                                 style='normal')

get_map = service_wmts['GetTile'][predicate]

Installation

pip install drb-impl-wmts

Examples

from drb.factory import DrbFactoryResolver

from drb_impl_wmts import WmtsServiceNode, WmtsGetTilePredicate

url_wmts='https+wmts://geoserver.swarm.ops.internal.gael.fr/geoserver/demo/wmts?'


resolver = DrbFactoryResolver()

service_wmts = WmtsServiceNode(url_wmts)

list_cap = service_wmts.children

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

print(list_cap)

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

#=>  <drb_impl_wXs.wXs_node.WXSNodeOperation object at 0x7f5403865d90>
#=>  GetCapabilities
#=>  <drb_impl_wmts.wmts_nodes.WmtsNodeOperationGetTile object at 0x7f54047b4700>
#=>  GetTile
#=>  <drb_impl_wmts.wmts_nodes.WmtsNodeOperationGetFeatureInfo object at 0x7f54047b4460>
#=>  GetFeatureInfo
#=>  <drb_impl_xml.xml_node.XmlNode object at 0x7f5402914c70>
#=>  Contents

    
get_map = service_wmts['GetTile']


dict_request = {'layer': 'ORTHOIMAGERY.ORTHOPHOTOS', 'format': 'image/jpeg', 'TILEMATRIXSET': 'PM', 'TILEMATRIX': 14, 'TILECOL': 8180, 'TILEROW': '5905', 'style': 'normal'}


tile_res = service_wmts['GetTile'][dict_request]

print('----------------------------------------')
print('GetTile : with parameter return image')
print(tile_res)
#=>  <drb_impl_image.image_node_factory.DrbImageBaseNode object at 0x7fc2cb23efa0>


predicate = WmtsGetTilePredicate(layer='ORTHOIMAGERY.ORTHOPHOTOS',
                                 tile_matrix_set='PM',
                                 tile_matrix=14, tile_col=8180, tile_row=5905,
                                 style='normal')


print('----------------------------------------')
print('GetTile : with parameter return image')
print(tile_res)
#=>  <drb_impl_image.image_node_factory.DrbImageBaseNode object at 0x7f54047b4970>

Metadata

Release files for drb-impl-wmts 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for drb-impl-wmts 1.0.0
File Size Uploaded
drb-impl-wmts-1.0.0.tar.gz 22.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for drb-impl-wmts 1.0.0
File Interpreter ABI Platform
drb_impl_wmts-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.1 kB

Release files / drb-impl-wmts-1.0.0.tar.gz

Download URL drb-impl-wmts-1.0.0.tar.gz
Size 22.0 kB
Tags Source
SHA-256 checksum
How to use checksums
bb9ccc31f5719eff798941fcf6d5faaa66db9462b5a71223857c308fbaf5a848
BLAKE2b-256 checksum
How to use checksums
8a0bfb8ce1b85447cf8a1d366047cc27c518bb7d84530f0562218022971609e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.15

Release files / drb_impl_wmts-1.0.0-py3-none-any.whl

Download URL drb_impl_wmts-1.0.0-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe8d46e2861415f79a9d4bfc1d67d489914113a75a1367eb07c75fd2d7f20d17
BLAKE2b-256 checksum
How to use checksums
6ad2c22751d8e2f86850188b6eccb245ed0a856697a9315bd093e7253ca179ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.15

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page