Geo::OGC::Service::WMTS - Perl extension to create geospatial web map tile services
The process_request method of this module is called by the Geo::OGC::Service framework.
In a psgi script write something like
use Geo::OGC::Service::WMTS; my $ogc = Geo::OGC::Service->new({ config => '/var/www/etc/OGC-services.conf', services => { 'WFS' => 'Geo::OGC::Service::WFS', 'WMTS' => 'Geo::OGC::Service::WMTS', 'WMS' => 'Geo::OGC::Service::WMTS', 'TMS' => 'Geo::OGC::Service::WMTS', }}); builder { mount "/WFS" => $ogc->to_app; mount "/WMTS" => $ogc->to_app; mount "/TMS" => $ogc->to_app; mount "/" => $default; };
This module aims to provide the operations defined by the Open Geospatial Consortium's Web Map Tile Service standard.
This module is a plugin for the Geo::OGC::Service framework.
Additionally, this module aims to support WMS used as WMTS and TMS.
The configuration is defined similarly as to other services under Geo::OGC::Service, either as a file or as a variable in the call to Geo::OGC::Service->new.
The file must be JSON and either have top level key WMTS, WMS, or TMS if more than one service is defined. The value of the key must be a hash, or the name of a key, which has a hash value.
Known top level keys in the hash are 'resource', 'blank', 'debug', and 'TileSets'. TileSets is an array of hashes. The keys of a TileSet hash are Layers, Format, Resolutions, SRS, BoundingBox, path, and ext.
None by default.
The entry method into this service. Calls RESTful if there is no request parameter, otherwise dispatches the call to WMSGetCapabilities, GetCapabilities, GetTile, GetMap, or FeatureInfo depending on service and request. If request is not recognized, returns an error XML with exceptionCode => 'InvalidParameterValue'.
Sends a capabilities document according to WMTS standard.
Sends a capabilities document according to WMS standard.
Serves the tile request if WMS is used.
Sends the requested tile based on parameters BBOX and LAYERS.
The tiles should be in a tile map resource type of directory structure (z/y/x.png). The value of the 'path' key in the TileSet config element should point to the directory.
Serves the tile request if WMTS is used.
Sends the requested tile based on parameters Layer, Tilerow, Tilecol, Tilematrix, Tilematrixset, and Format.
The tile is served from a tile map directory or it is made on the fly from a GDAL data source (the value of the 'file' key in the TileSet). In addition, processing may be applied to the data source (the 'processing' key). The processing may be one of those implemented in GDAL.
Using the 'file' keyword requires GDAL 2.1.
Keyword RESTful (0/1) controls the ResourceURL element in the capabilities XML. Default is false.
RESTful service. The URL should have the form <service>/layer/<TileMatrixSet>/<TileMatrix>/<TileCol>/<TileRow>.<ext>. TileMatrixSet is optional. Compare this to the template in capabilities.
Sends TileMapService response if the layer is not in the URL, TileMap response if the layer is in the URL but zoom, row, and col are not, or the requested tile based on layer, zoom, row, and column in the URL.
Not yet implemented.
Currently only EPSG 3067 (ETRS-TM35FIN) and 3857 (Google Mercator) are supported. To support other tile matrix sets add them to %Geo::OGC::Service::WMTS::projections.
Discuss this module on the Geo-perl email list.
https://list.hut.fi/mailman/listinfo/geo-perl
For the WMTS standard see
http://www.opengeospatial.org/standards/wmts
https://github.com/ajolma/Geo-OGC-Service-WMTS
Ari Jolma, <ari.jolma at gmail.com>
Copyright (C) 2015 by Ari Jolma
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.22.0 or, at your option, any later version of Perl 5 you may have available.
To install Geo::OGC::Service::WMTS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Geo::OGC::Service::WMTS
CPAN shell
perl -MCPAN -e shell install Geo::OGC::Service::WMTS
For more information on module installation, please visit the detailed CPAN module installation guide.