Geo-OGC-Service-WMTS

 view release on metacpan or  search on metacpan

lib/Geo/OGC/Service/WMTS.pm  view on Meta::CPAN

=item tile 

A Geo::OGC::Service::WMTS::Tile object made from the request. The
extent is from projection, which is deduced from the tilematrixset
parameter.

=item service 

The Geo::OGC::Service::WMTS object.

=item headers 

Currently ['Content-Type' => "image/png"]

=back

=head2 EXPORT

None by default. Package globals include

=over

=item $radius_of_earth_at_equator 

6378137

=item $standard_pixel_size 

0.28/1000

=item $tile_width 

256

=item $tile_height 

256

=item $originShift3857 

Math::Trig::pi * $radius_of_earth_at_equator

=item %projections 

Hash of 'EPSG:nnnn' => {identifier => x, crs => x, extent => {SRS =>
x, minx => x, maxx => x, miny => x, maxy => x}}. Currently contains
EPSG:3857 and EPSG:3067.

=back

=head2 METHODS

=cut

package Geo::OGC::Service::WMTS;

use 5.010000; # say // and //=
use feature "switch";
use Carp;
use File::Basename;
use Modern::Perl;
use JSON;
use Geo::GDAL;
use Cwd;
use Math::Trig;
use HTTP::Date;

use Data::Dumper;
use XML::LibXML::PrettyPrint;

use Geo::OGC::Service;
use vars qw(@ISA);
push @ISA, qw(Geo::OGC::Service::Common);

our $VERSION = '0.07';

our $radius_of_earth_at_equator = 6378137;
our $standard_pixel_size = 0.28 / 1000;
our $tile_width = 256;
our $tile_height = 256;
our $originShift3857 = pi * $radius_of_earth_at_equator;

our %projections = (
    'EPSG:3857' => {
        identifier => 'EPSG:3857',
        crs => 'urn:ogc:def:crs:EPSG:6.3:3857',
        extent => {
            SRS => 'EPSG:3857', 
            minx => -1 * $originShift3857,
            miny => -1 * $originShift3857,
            maxx => $originShift3857,
            maxy => $originShift3857  },
    },
    'EPSG:3067' => {
        identifier => 'ETRS-TM35FIN',
        crs => 'urn:ogc:def:crs:EPSG:6.3:3067',
        extent => { 
            SRS => 'EPSG:3067', 
            # JHS180 liite 1:
            minx => -548576,
            miny => 6291456,
            maxx => 1548576,
            maxy => 8388608 }
    }
);

=pod

=head3 process_request

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'.

=cut

sub process_request {
    my ($self, $responder) = @_;
    $self->{debug} = $self->{config}{debug};



( run in 1.619 second using v1.01-cache-2.11-cpan-f0ff5d10edf )