mirror of
https://github.com/klokantech/tileserver-php.git
synced 2025-08-23 14:43:30 +02:00
Compare commits
83 Commits
v0.1
...
customtile
Author | SHA1 | Date | |
---|---|---|---|
|
e36a7e6a06 | ||
|
7190e90845 | ||
|
f3f2a995e5 | ||
|
8233047097 | ||
|
46d79107e8 | ||
|
a2162eeb99 | ||
|
27fc9a73ca | ||
|
4ff5d95a38 | ||
|
6da6b13fed | ||
|
0609b25905 | ||
|
ce485c6713 | ||
|
ab7862209a | ||
|
8b49aa2b8c | ||
|
ea100ad8c2 | ||
|
86527eeedb | ||
|
3a9e74e3b0 | ||
|
0446445248 | ||
|
853ca41ce0 | ||
|
5b5f5e7905 | ||
|
b7960baaaa | ||
|
250512168c | ||
|
6b5933e21f | ||
|
f5408fd108 | ||
|
dc26c831f1 | ||
|
28aba6f9e2 | ||
|
8f6a2ced68 | ||
|
79926b92fc | ||
|
3343f80e09 | ||
|
c660ab8f41 | ||
|
21d7a409fe | ||
|
abb4087942 | ||
|
0acdc04e32 | ||
|
f9e801849e | ||
|
e66e577d5d | ||
|
ffedfde75e | ||
|
b783c59585 | ||
|
dd8d884bc6 | ||
|
8b4a5142e8 | ||
|
53b379cd67 | ||
|
2bf8bf6d4b | ||
|
e4454b12be | ||
|
8002dbbb7d | ||
|
d4121d86d5 | ||
|
ea6e176ab3 | ||
|
b13b8d98c8 | ||
|
f08d72262d | ||
|
4250eff554 | ||
|
34ffddb765 | ||
|
5d2662a6a3 | ||
|
8dec7469f1 | ||
|
8170e02397 | ||
|
779e320dec | ||
|
e226ae2cc3 | ||
|
61c866a521 | ||
|
987f01c85e | ||
|
ed19c0a414 | ||
|
04a9abf170 | ||
|
c3e9b41110 | ||
|
6c840820f0 | ||
|
d4c1996815 | ||
|
3181142368 | ||
|
5fca96fd91 | ||
|
08b77f4bf4 | ||
|
cba3048506 | ||
|
ed5618886f | ||
|
cd5cd44e75 | ||
|
4cd86eefc3 | ||
|
c953b0cecb | ||
|
3042384d13 | ||
|
8478f7dc7d | ||
|
656ffba9df | ||
|
4d6ee2c714 | ||
|
0f059f4fb7 | ||
|
2461a184a8 | ||
|
1f1dd22227 | ||
|
9bbb1bce05 | ||
|
b6470bd448 | ||
|
2dfb1952aa | ||
|
4a4a2ee348 | ||
|
f93f5e8b45 | ||
|
56bfb34889 | ||
|
212bc74fed | ||
|
296a752e28 |
137
.htaccess
137
.htaccess
@@ -1,99 +1,78 @@
|
||||
# tileserver.php integration with Apache via .htaccess
|
||||
|
||||
# Restrictions for data crawlers
|
||||
Options -Indexes
|
||||
Options +FollowSymLinks
|
||||
Options -MultiViews
|
||||
#check htaccess functionality
|
||||
DirectoryIndex tileserver.php
|
||||
|
||||
# Optional CORS header for cross-domain origin access to all data
|
||||
RewriteEngine on
|
||||
|
||||
# Option: some hostings require RewriteBase e.g. 1&1.com
|
||||
#RewriteBase /
|
||||
#RewriteBase /directory/
|
||||
|
||||
# Option: some hostings require -MultiViews e.g. 1&1.com
|
||||
#Options -MultiViews
|
||||
|
||||
# Option: Restrictions for data crawlers
|
||||
#Options -Indexes
|
||||
|
||||
# Option: CORS header for cross-domain origin access to all data
|
||||
#<ifModule mod_headers.c>
|
||||
# Header set Access-Control-Allow-Origin *
|
||||
#</ifModule>
|
||||
|
||||
# Mapping of the WMTS standardized URLs to real files and XML capabilities to tileserver.php
|
||||
# Block direct downloading of .mbtiles
|
||||
<FilesMatch "\.mbtiles$">
|
||||
Order Allow,Deny
|
||||
Deny from all
|
||||
</FilesMatch>
|
||||
|
||||
RewriteEngine On
|
||||
# Mapping of the WMTS standardized URLs to real files and XML capabilities to tileserver.php
|
||||
|
||||
# WMTS RESTful
|
||||
# ------------
|
||||
# The file can be accessed directly:
|
||||
# Example: http://www.tileserver.com/grandcanyon/10/192/401.png
|
||||
|
||||
# map /wmts/layer/[ANYTHING]z/x/y.ext -> /layer/z/x/y.ext (WMTS ignoring tilematrixset,style,..)
|
||||
# BTW This is used only by Gaia which ignores the <ResourceURL template="...">
|
||||
RewriteRule ^wmts/([\w\d\._-]+)/.*?(\d+)/(\d+)/(\d+)\.(\w+)$ $1/$2/$4/$3.$5 [L]
|
||||
# Example: http://www.tileserver.com/wmts/grandcanyon/style/tilematrixset/10/192/401.png
|
||||
## map /wmts/layer/[ANYTHING]z/x/y.ext -> /layer/z/x/y.ext (WMTS ignoring tilematrixset,style,..)
|
||||
## BTW This is used only by Gaia which ignores the <ResourceURL template="...">
|
||||
#RewriteRule ^wmts/([\w\d\._-]+)/.+?(\d+)/(\d+)/(\d+)\.(\w+)$ $1/$2/$4/$3.$5 [N]
|
||||
## Example: http://www.tileserver.com/wmts/grandcanyon/style/tilematrixset/10/192/401.png
|
||||
#
|
||||
## map /layer/[ANYTHING]z/x/y.ext -> /layer/z/x/y.ext (WMTS ignoring tilematrix,style,..)
|
||||
#RewriteCond %{REQUEST_FILENAME} !-f
|
||||
#RewriteRule ^([\w\d\._-]+)/.+?(\d+)/(\d+)/(\d+)\.(\w+)$ $1/$2/$3/$4.$5 [N]
|
||||
## Example: http://www.tileserver.com/grandcanyon/style/tilematrixset/10/192/401.png
|
||||
|
||||
# map /layer/[ANYTHING]z/x/y.ext -> /layer/z/x/y.ext (WMTS ignoring tilematrix,style,..)
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^([\w\d\._-]+)/.+?(\d+)/(\d+)/(\d+)\.(\w+)$ $1/$2/$3/$4.$5 [L]
|
||||
# Example: http://www.tileserver.com/grandcanyon/style/tilematrixset/10/192/401.png
|
||||
## WMTS KVP
|
||||
## --------
|
||||
## map the /?key=value&... -> /layer/z/x/y.ext KVP getTile queries directly to files
|
||||
#
|
||||
## format passed as mime-extension, cleaning formats (jpeg->jpg)
|
||||
#RewriteCond %{QUERY_STRING} ^(.*)format=image/jpeg(.*)$ [NC]
|
||||
#RewriteRule ^(.*)$ $1?%1format=jpg%2 [N]
|
||||
#RewriteCond %{QUERY_STRING} ^(.*)format=jpeg(.*)$ [NC]
|
||||
#RewriteRule ^(.*)$ $1?%1format=jpg%2 [N]
|
||||
#RewriteCond %{QUERY_STRING} ^(.*)format=image/png(.*)$ [NC]
|
||||
#RewriteRule ^(.*)$ $1?%1format=png%2 [N]
|
||||
#
|
||||
## variable order of keys: TODO: sort the same way as mime-extension to fixed order
|
||||
#RewriteCond %{QUERY_STRING} ^.*request=gettile.*layer=([\w\d\._-]+).*tilematrix=(\d+).*tilerow=(\d+).*tilecol=(\d+).*format=(\w+).*$ [NC]
|
||||
#RewriteRule ^ %1/%2/%3/%4.%5 [N]
|
||||
#RewriteCond %{QUERY_STRING} ^.*request=gettile.*layer=([\w\d\._-]+).*format=(\w+).*tilematrix=(\d+).*tilerow=(\d+).*tilecol=(\d+).*$ [NC]
|
||||
#RewriteRule ^ %1/%3/%5/%4.%2 [N]
|
||||
#RewriteCond %{QUERY_STRING} ^.*request=gettile.*layer=([\w\d\._-]+).*tilematrix=(\d+).*tilecol=(\d+).*tilerow=(\d+).*format=(\w+).*$ [NC]
|
||||
#RewriteRule ^ %1/%2/%4/%3.%5 [N]
|
||||
## Example: http://www.tileserver.com/wmts?request=getTile&layer=grandcanyon&tileMatrix=10&tilerow=192&tilecol=401&format=png
|
||||
## Example: http://www.tileserver.com/wmts?service=WMTS&request=GetTile&version=1.0.0&layer=ne2geo&style=&format=image/jpeg&TileMatrixSet=WGS84&TileMatrix=1&TileRow=2&TileCol=2
|
||||
|
||||
# rewrite .jpeg -> .jpg
|
||||
RewriteRule ^(.+).jpeg$ $1.jpg [L]
|
||||
|
||||
# MBTiles support at /layer/z/x/y.ext - loads the tile from mbtiles with php
|
||||
# TODO: serve also 404 errors for tiles
|
||||
RewriteRule ^([^\/]+\.mbtiles)\/.*?(\d+)\/(\d+)\/(\d+)\.(\w+)$ tileserver-mbtiles.php?tileset=$1&z=$2&x=$3&y=$4&ext=$5 [L]
|
||||
RewriteRule ^([^\/]+\.mbtiles)\/.*?(\d+)\/(\d+)\/(\d+)\.grid.json?$ tileserver-mbtiles.php?tileset=$1&z=$2&x=$3&y=$4&ext=grid [QSA,L]
|
||||
# TODO: use mod_sqlite if available to map the tiles to URL directly by apache
|
||||
# Not modified HTTP 302
|
||||
RewriteRule .* - [E=HTTP_IF_MODIFIED_SINCE:%{HTTP:If-Modified-Since}]
|
||||
RewriteRule .* - [E=HTTP_IF_NONE_MATCH:%{HTTP:If-None-Match}]
|
||||
|
||||
# WMTS KVP
|
||||
# --------
|
||||
# map the /?key=value&... -> /layer/z/x/y.ext KVP getTile queries directly to files
|
||||
|
||||
# format passed as mime-extension, cleaning formats (jpeg->jpg)
|
||||
RewriteCond %{QUERY_STRING} ^(.*)format=image/jpeg(.*)$ [NC]
|
||||
RewriteRule ^(.*)$ $1?%1format=jpg%2 [N]
|
||||
RewriteCond %{QUERY_STRING} ^(.*)format=jpeg(.*)$ [NC]
|
||||
RewriteRule ^(.*)$ $1?%1format=jpg%2 [N]
|
||||
RewriteCond %{QUERY_STRING} ^(.*)format=image/png(.*)$ [NC]
|
||||
RewriteRule ^(.*)$ $1?%1format=png%2 [N]
|
||||
|
||||
# variable order of keys: TODO: sort the same way as mime-extension to fixed order
|
||||
RewriteCond %{QUERY_STRING} ^.*request=gettile.*layer=([\w\d\._-]+).*tilematrix=(\d+).*tilerow=(\d+).*tilecol=(\d+).*format=(\w+).*$ [NC]
|
||||
RewriteRule ^ %1/%2/%3/%4.%5 [L]
|
||||
RewriteCond %{QUERY_STRING} ^.*request=gettile.*layer=([\w\d\._-]+).*format=(\w+).*tilematrix=(\d+).*tilerow=(\d+).*tilecol=(\d+).*$ [NC]
|
||||
RewriteRule ^ %1/%3/%5/%4.%2 [L]
|
||||
RewriteCond %{QUERY_STRING} ^.*request=gettile.*layer=([\w\d\._-]+).*tilematrix=(\d+).*tilecol=(\d+).*tilerow=(\d+).*format=(\w+).*$ [NC]
|
||||
RewriteRule ^ %1/%2/%4/%3.%5 [L]
|
||||
# Example: http://www.tileserver.com/wmts?request=getTile&layer=grandcanyon&tileMatrix=10&tilerow=192&tilecol=401&format=png
|
||||
# Example: http://www.tileserver.com/wmts?service=WMTS&request=GetTile&version=1.0.0&layer=ne2geo&style=&format=image/jpeg&TileMatrixSet=WGS84&TileMatrix=1&TileRow=2&TileCol=2
|
||||
|
||||
# WMTS ServiceMetadata (GetCapabilities)
|
||||
# --------------------------------------
|
||||
RewriteRule ^.*WMTSCapabilities.xml$ tileserver-wmts.php [QSA,L]
|
||||
RewriteRule ^wmts$ tileserver-wmts.php [QSA,L]
|
||||
RewriteCond %{QUERY_STRING} ^.*request=getcapabilities.*$ [NC]
|
||||
RewriteRule ^ tileserver-wmts.php [L]
|
||||
# Example: http://www.tileserver.com/dev/?service=WMTS&version=1.0.0&request=GetCapabilities
|
||||
|
||||
# TMS XML (ArcBruTile)
|
||||
# --------------------
|
||||
RewriteRule ^tms$ tileserver-tms.php [QSA,L]
|
||||
RewriteRule ^(.+)/tms$ tileserver-tms.php?layer=$1 [QSA,L]
|
||||
# Example: http://www.tileserver.com/dev/?service=WMTS&version=1.0.0&request=GetCapabilities
|
||||
|
||||
# request for non-existent tiles -> layer/none.png or none.png
|
||||
#RewriteCond %{REQUEST_FILENAME} !-f
|
||||
#RewriteRule ^([\w\d\._-]+)/(\d+)/(\d+)/(\d+)\.png$ $1/none.png [L]
|
||||
#RewriteCond %{REQUEST_FILENAME} !-f
|
||||
#RewriteRule ^([\w\d\._-]+)/none\.png$ none.png [L]
|
||||
|
||||
# request for non-existent tiles -> layer/none.jpg or none.jpg
|
||||
#RewriteCond %{REQUEST_FILENAME} !-f
|
||||
#RewriteRule ^([\w\d\._-]+)/(\d+)/(\d+)/(\d+)\.jpg$ $1/none.jpg [L]
|
||||
#RewriteCond %{REQUEST_FILENAME} !-f
|
||||
#RewriteRule ^([\w\d\._-]+)/none\.jpg$ none.jpg [L]
|
||||
|
||||
# TileJSON JSONP wrapper for MapBOX.js API
|
||||
RewriteRule ^maps.jsonp?$ tileserver.php?service=json [QSA,L]
|
||||
RewriteCond %{REQUEST_URI} !\.grid\.json [NC]
|
||||
RewriteRule ^(.+).jsonp?$ tileserver.php?service=json&layer=$1 [QSA,L]
|
||||
|
||||
# If-Modified-Since (if php is not installed as cgi then comment lines below)
|
||||
#RewriteRule .* - [E=HTTP_IF_MODIFIED_SINCE:%{HTTP:If-Modified-Since}]
|
||||
#RewriteRule .* - [E=HTTP_IF_NONE_MATCH:%{HTTP:If-None-Match}]
|
||||
|
||||
# handle all request on the root '/' by tileserver.php
|
||||
RewriteRule ^$ tileserver.php?service=html [QSA,L]
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond $1 !^(tileserver\.php)
|
||||
RewriteRule ^(.*)$ tileserver.php?/$1 [L,QSA]
|
||||
|
9
.travis.yml
Normal file
9
.travis.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
language: php
|
||||
php:
|
||||
- 5.3
|
||||
- 5.4
|
||||
- 5.5
|
||||
- 5.6
|
||||
- hhvm
|
||||
script:
|
||||
- php tileserver.php
|
67
README.md
67
README.md
@@ -1,10 +1,14 @@
|
||||
=================================================
|
||||
TileServer PHP - OGC Web Map Tiling Server (WMTS)
|
||||
=================================================
|
||||
TileServer PHP: MapTiler and MBTiles maps via WMTS
|
||||
==================================================
|
||||
|
||||
[](https://travis-ci.org/klokantech/tileserver-php)
|
||||
[](https://hub.docker.com/r/klokantech/tileserver-php/)
|
||||
|
||||
This server distributes maps to desktop, web, and mobile applications from
|
||||
a standard Apache+PHP web hosting.
|
||||
|
||||
Try a live demo at: http://tileserver.maptiler.com/
|
||||
|
||||
It is a free and open-source project implementing OGC WMTS standard for
|
||||
pre-rendered map tiles made with [MapTiler](http://www.maptiler.com/), GDAL2Tiles,
|
||||
or available as MBTiles files.
|
||||
@@ -13,9 +17,9 @@ It is the easiest and cheapest way how to serve zoomable maps in a
|
||||
standardized way - practically from any ordinary web hosting.
|
||||
|
||||
It is easy to install - just copy the project files to a PHP-enabled
|
||||
directory along with your map data containing metadata.json file.
|
||||
directory along with your map data.
|
||||
|
||||
It comes with an online interface showing the list of the maps and step-by-step guides for desktop GIS software:
|
||||
It comes with an online interface showing the list of the maps and step-by-step guides for online mapping libraries (Google Maps API, Leaflet, OpenLayers, OL3, MapBox JS, ArcGIS JS) and various desktop GIS software:
|
||||
|
||||

|
||||
|
||||
@@ -27,21 +31,24 @@ web hostings.
|
||||
Tiles are served directly by Apache with mod_rewrite rules as static files
|
||||
and therefore are very fast and with correct HTTP caching headers.
|
||||
Only XML metadata are delivered via PHP.
|
||||
MBTiles are served via PHP, unless they are unpacked with mbutil.
|
||||
MBTiles are served via PHP, and are therfore slower, unless they are unpacked with mbutil.
|
||||
|
||||
[MapTiler](http://www.maptiler.com/) can render GeoTIFF, ECW, MrSID, GeoPDF into compatible map tiles. JPEG, PNG, GIF and TIFF with scanned maps or images without geolocation can be turned into standard map layers with the visual georeferencing functionality (http://youtu.be/eJxdCe9CNYg).
|
||||
|
||||
[](http://www.maptiler.com/)
|
||||
|
||||
Requirements:
|
||||
-------------
|
||||
|
||||
- Apache webserver (with mod_rewrite / .htaccess supported)
|
||||
- PHP 5.2+
|
||||
- PHP 5.2+ with SQLite module (php5-sqlite)
|
||||
|
||||
(or anther webserver implementing mod_rewrite rules and PHP)
|
||||
(or another webserver implementing mod_rewrite rules and PHP)
|
||||
|
||||
Installation:
|
||||
-------------
|
||||
|
||||
Download the project files as a zip archive or source code from GitHub and
|
||||
unpack it into a web-hosting of your choice.
|
||||
Download the project files as a [zip archive](https://github.com/klokantech/tileserver-php/archive/master.zip) or source code from GitHub and unpack it into a web-hosting of your choice.
|
||||
|
||||
If you access the web address relevant to the installation directory,
|
||||
the TileServer.php Server should display you a welcome message and further
|
||||
@@ -52,14 +59,12 @@ tiles rendered with [MapTiler](http://www.maptiler.com/).
|
||||
|
||||
Tiles produced by open-source GDAL2Tiles or MapTiler and tiles in .mbtiles
|
||||
files can be easily converted to required structure (XYZ with top-left origin
|
||||
and metadata.json file).
|
||||
|
||||
The OpenSource utility mbutil (https://github.com/mapbox/mbutil) produces
|
||||
and metadata.json file). The open-source utility [mbutil](https://github.com/mapbox/mbutil) produces
|
||||
exactly the required format.
|
||||
|
||||
Direct reading of .mbtiles files is supported, but with decreased performance
|
||||
compared to the static files in a directory. Therefore the data management,
|
||||
especially upload over FTP or similar protocols, is easier.
|
||||
compared to the static files in a directory. The advantage is easier data management,
|
||||
especially upload over FTP or similar protocols.
|
||||
|
||||
Supported protocols:
|
||||
--------------------
|
||||
@@ -109,15 +114,11 @@ Supported protocols:
|
||||
Exposed at http://[...]/layer/z/x/y.grid.json
|
||||
|
||||
|
||||
To use the OGC WMTS services point your client (desktop or web) to the URL
|
||||
To use the OGC WMTS standard point your client (desktop or web) to the URL
|
||||
of 'directory' where you installed tileserver.php project with suffix "wmts".
|
||||
|
||||
For example: http://www.example.com/directory/wmts
|
||||
|
||||
You can also install the project into a root directory of a virtual server:
|
||||
Then the address is: http://www.example.com/wmts
|
||||
|
||||
Similarly for another end points.
|
||||
If you have installed the project into a root directory of a domain, then the address is: http://www.example.com/wmts
|
||||
|
||||
The supported WMTS requests includes:
|
||||
|
||||
@@ -131,7 +132,7 @@ GetTile RESTful/KVP:
|
||||
http://[...]/layer/[ANYTHING-OPTIONAL][z]/[x]/[y].[ext]
|
||||
http://[...]?service=wmts&request=getTile&layer=[layer]&tilematrix=[z]&tilerow=[y]&tilecol=[y]&format=[ext]
|
||||
|
||||
Another example requests are mentioned in the .htaccess.
|
||||
Other example requests are mentioned in the .htaccess.
|
||||
|
||||
Performance from the web clients
|
||||
--------------------------------
|
||||
@@ -178,10 +179,10 @@ Password protection
|
||||
HTTP Simple Authentication can be easily added to the server.
|
||||
Edit the .htaccess and add these lines:
|
||||
|
||||
AuthUserFile /full/path/to/.htpasswd
|
||||
AuthType Basic
|
||||
AuthName "Secure WMTS"
|
||||
Require valid-user
|
||||
AuthUserFile /full/path/to/.htpasswd
|
||||
AuthType Basic
|
||||
AuthName "Secure WMTS"
|
||||
Require valid-user
|
||||
|
||||
Create a file called .htpasswd with user:password format.
|
||||
You can use a command-line utility:
|
||||
@@ -212,9 +213,10 @@ Credits / Contributors
|
||||
Project developed initially by Klokan Technologies GmbH, Switzerland in
|
||||
cooperation with National Oceanic and Atmospheric Administration - NOAA, USA.
|
||||
|
||||
Petr Pridal - Klokan Technologies GmbH <petr.pridal@klokantech.com>
|
||||
Jason Woolard - NOAA <jason.woolard@noaa.gov>
|
||||
Jon Sellars - NOAA <jon.sellars@noaa.gov>
|
||||
- Petr Pridal - Klokan Technologies GmbH <petr.pridal@klokantech.com>
|
||||
- Jason Woolard - NOAA <jason.woolard@noaa.gov>
|
||||
- Jon Sellars - NOAA <jon.sellars@noaa.gov>
|
||||
- Dalibor Janak - Klokan Technologies GmbH <dalibor.janak@klokantech.com>
|
||||
|
||||
Tested WMTS/TMS clients
|
||||
-----------------------
|
||||
@@ -223,18 +225,21 @@ Tested WMTS/TMS clients
|
||||
http://www.qgis.org/
|
||||
- ESRI ArcGIS Desktop 10.1+ - native WMTS implementation supported
|
||||
http://www.esri.com/software/arcgis/arcgis-for-desktop
|
||||
- ESRI ArcGIS Online - loading via WMTS protocol
|
||||
http://www.arcgis.com/
|
||||
- ArcBruTiles plugin for ArcGIS 9.3+ - via TMS endpoint
|
||||
http://arcbrutile.codeplex.com/
|
||||
- OpenLayers WMTS Layer - including parsing GetCapabilities
|
||||
http://www.openlayers.org/
|
||||
- GAIA - native WMTS (issues with 3857 to be fixed)
|
||||
http://www.thecarbonproject.com/gaia.php
|
||||
- MapBox.js - the loading of maps via TileJSON
|
||||
- MapBox.js - the loading of maps via TileJSON, interaction layer supported
|
||||
https://www.mapbox.com/mapbox.js
|
||||
|
||||
BSD License
|
||||
-----------
|
||||
|
||||
Copyright (C) 2012 Klokan Technologies GmbH
|
||||
Copyright (C) 2015 Klokan Technologies GmbH (http://www.klokantech.com/)
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
@@ -1,123 +0,0 @@
|
||||
<?php
|
||||
|
||||
// Based on: https://github.com/Zverik/mbtiles-php
|
||||
// Read: https://github.com/klokantech/tileserver-php/issues/1
|
||||
// TODO: clean the code!!!
|
||||
|
||||
if (!is_file($_GET['tileset'])) {
|
||||
header('HTTP/1.0 404 Not Found');
|
||||
echo "<h1>404 Not Found</h1>";
|
||||
echo "TileServer.php could not found what you requested.";
|
||||
die();
|
||||
// TODO: if ($_GET['ext'] == 'png') { ...
|
||||
// TODO: better image 256x256px !!!
|
||||
// header("Content-type: image/png");
|
||||
//print("\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x06\x00\x00\x00\x1f\x15\xc4\x89\x00\x00\x00\rIDAT\x08\xd7c````\x00\x00\x00\x05\x00\x01^\xf3*:\x00\x00\x00\x00IEND\xaeB`\x82");
|
||||
}
|
||||
$tileset = $_GET['tileset'];
|
||||
|
||||
if (isset($_GET['tileset'])) {
|
||||
|
||||
$tileset = $_GET['tileset'];
|
||||
$flip = true;
|
||||
try {
|
||||
$db = new PDO('sqlite:' . $tileset, '', '', array(PDO::ATTR_PERSISTENT => true));
|
||||
if (!isset($db)) {
|
||||
header('Content-type: text/plain');
|
||||
print 'Incorrect tileset name: ' . $_GET['tileset'];
|
||||
exit;
|
||||
}
|
||||
// http://c.tile.openstreetmap.org/12/2392/1190.png
|
||||
$z = floatval($_GET['z']);
|
||||
$y = floatval($_GET['y']);
|
||||
$x = floatval($_GET['x']);
|
||||
if ($flip) {
|
||||
$y = pow(2, $z) - 1 - $y;
|
||||
}
|
||||
if ($_GET['ext'] != 'grid' && $_GET['ext'] != 'json') {
|
||||
|
||||
|
||||
$result = $db->query('select tile_data as t from tiles where zoom_level=' . $z . ' and tile_column=' . $x . ' and tile_row=' . $y);
|
||||
$data = $result->fetchColumn();
|
||||
if (!isset($data) || $data === FALSE) {
|
||||
// TODO: Put here ready to use empty tile!!!
|
||||
$png = imagecreatetruecolor(256, 256);
|
||||
imagesavealpha($png, true);
|
||||
$trans_colour = imagecolorallocatealpha($png, 0, 0, 0, 127);
|
||||
imagefill($png, 0, 0, $trans_colour);
|
||||
header('Content-type: image/png');
|
||||
imagepng($png);
|
||||
//header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found');
|
||||
} else {
|
||||
$result = $db->query('select value from metadata where name="format"');
|
||||
$resultdata = $result->fetchColumn();
|
||||
$format = isset($resultdata) && $resultdata !== FALSE ? $resultdata : 'png';
|
||||
if ($format == 'jpg')
|
||||
$format = 'jpeg';
|
||||
header('Content-type: image/' . $format);
|
||||
print $data;
|
||||
}
|
||||
} elseif ($_GET['ext'] == 'grid' || $_GET['ext'] == 'json') {
|
||||
//Get and return UTFgrid
|
||||
$result = $db->query('SELECT grid FROM grids WHERE tile_column = ' . $x . ' AND tile_row = ' . $y . ' AND zoom_level = ' . $z);
|
||||
$data = $result->fetchColumn();
|
||||
|
||||
if (!isset($data) || $data === FALSE) {
|
||||
// if not exists grid data return empty json
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
echo 'grid({});';
|
||||
die;
|
||||
} else {
|
||||
$grid = gzuncompress($data);
|
||||
$grid = substr(trim($grid), 0, -1);
|
||||
|
||||
//adds legend (data) to output
|
||||
$grid .= ',"data":{';
|
||||
$result = $db->query('SELECT key_name as key, key_json as json FROM grid_data WHERE zoom_level=' . $z . ' and tile_column=' . $x . ' and tile_row=' . $y);
|
||||
while ($r = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
$grid .= '"' . $r['key'] . '":' . $r['json'] . ',';
|
||||
}
|
||||
$grid = rtrim($grid, ',') . '}}';
|
||||
|
||||
// CORS headers
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
|
||||
if (isset($_GET['callback'])) {
|
||||
header("Content-Type:text/javascript charset=utf-8");
|
||||
echo $_GET['callback'] . '(' . $grid . ');';
|
||||
} else {
|
||||
header("Content-Type:text/javascript; charset=utf-8");
|
||||
echo 'grid(' . $grid . ');';
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
header('Content-type: text/plain');
|
||||
print 'Error querying the database: ' . $e->getMessage();
|
||||
}
|
||||
}
|
||||
/*
|
||||
function getbaseurl() {
|
||||
return 'http://'.$_SERVER['HTTP_HOST'].preg_replace('/\/(1.0.0\/)?[^\/]*$/','/',$_SERVER['REQUEST_URI']);
|
||||
}
|
||||
*/
|
||||
|
||||
function readparams($db) {
|
||||
$params = array();
|
||||
$result = $db->query('select name, value from metadata');
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
$params[$row['name']] = $row['value'];
|
||||
}
|
||||
return $params;
|
||||
}
|
||||
|
||||
function readzooms($db) {
|
||||
$zooms = array();
|
||||
$result = $db->query('select zoom_level from tiles group by zoom_level order by zoom_level');
|
||||
while ($zoom = $result->fetchColumn()) {
|
||||
$zooms[] = $zoom;
|
||||
}
|
||||
return $zooms;
|
||||
}
|
||||
|
||||
?>
|
@@ -1,85 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* TileServer.php project
|
||||
* ======================
|
||||
* https://github.com/klokantech/tileserver-php/
|
||||
* Copyright (C) 2012 - Klokan Technologies GmbH
|
||||
*/
|
||||
|
||||
require "tileserver.php";
|
||||
|
||||
header("Content-type: application/xml");
|
||||
|
||||
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
|
||||
|
||||
// Accepted GET strings
|
||||
$layer = (array_key_exists('layer', $_GET)) ? $_GET['layer'] : "";
|
||||
|
||||
# -----------
|
||||
# TMS SERVICE
|
||||
# -----------
|
||||
if ($layer === ""):
|
||||
|
||||
$maps = maps();
|
||||
?>
|
||||
<TileMapService version="1.0.0">
|
||||
<TileMaps>
|
||||
<?php
|
||||
foreach ($maps as $m) {
|
||||
$basename = $m['basename'];
|
||||
$title = (array_key_exists('name', $m )) ? $m['name'] : $basename;
|
||||
$profile = $m['profile'];
|
||||
if ($profile == 'geodetic')
|
||||
$srs = "EPSG:4326";
|
||||
else
|
||||
$srs = "EPSG:3857";
|
||||
echo " <TileMap title=\"$title\" srs=\"$srs\" type=\"InvertedTMS\" profile=\"global-$profile\" href=\"$baseUrl$basename/tms\" />\n";
|
||||
}
|
||||
?>
|
||||
</TileMaps>
|
||||
</TileMapService>
|
||||
<?php
|
||||
die;
|
||||
# ---------
|
||||
# TMS LAYER
|
||||
# ---------
|
||||
else:
|
||||
$m = layer($layer);
|
||||
$basename = $m['basename'];
|
||||
$title = (array_key_exists('name', $m )) ? $m['name'] : $basename;
|
||||
$description = (array_key_exists('description', $m )) ? $m['description'] : "";
|
||||
$bounds = $m['bounds'];
|
||||
$profile = $m['profile'];
|
||||
if ($profile == 'geodetic') {
|
||||
$srs = "EPSG:4326";
|
||||
$originx = -180.0;
|
||||
$originy = -90.0;
|
||||
$initialResolution = 0.703125;
|
||||
}
|
||||
else {
|
||||
$srs = "EPSG:3857";
|
||||
$originx = -20037508.342789;
|
||||
$originy = -20037508.342789;
|
||||
list( $minx, $miny ) = $mercator->LatLonToMeters($bounds[1], $bounds[0]);
|
||||
list( $maxx, $maxy ) = $mercator->LatLonToMeters($bounds[3], $bounds[2]);
|
||||
$bounds = array( $minx, $miny, $maxx, $maxy );
|
||||
$initialResolution = 156543.03392804062;
|
||||
}
|
||||
$format = $m['format'];
|
||||
$mime = ($format == 'jpg') ? 'image/jpeg' : 'image/png';
|
||||
?>
|
||||
<TileMap version="1.0.0" tilemapservice="<?php echo $baseUrl.$basename ?>" type="InvertedTMS">
|
||||
<Title><?php echo htmlspecialchars($title) ?></Title>
|
||||
<Abstract><?php echo htmlspecialchars($description) ?></Abstract>
|
||||
<SRS><?php echo $srs ?></SRS>
|
||||
<BoundingBox minx="<?php echo $bounds[0] ?>" miny="<?php echo $bounds[1] ?>" maxx="<?php echo $bounds[2] ?>" maxy="<?php echo $bounds[3] ?>" />
|
||||
<Origin x="<?php echo $originx ?>" y="<?php echo $originy ?>"/>
|
||||
<TileFormat width="256" height="256" mime-type="<?php echo $mime ?>" extension="<?php echo $format ?>"/>
|
||||
<TileSets profile="global-<?php echo $profile ?>">
|
||||
<?php for ($zoom = $m['minzoom']; $zoom < $m['maxzoom']+1; $zoom++ ) { ?>
|
||||
<TileSet href="<?php echo $baseUrl.$basename.'/'.$zoom ?>" units-per-pixel="<?php echo $initialResolution / pow(2, $zoom) ?>" order="<?php echo $zoom ?>" />
|
||||
<?php } ?>
|
||||
</TileSets>
|
||||
</TileMap>
|
||||
<?php
|
||||
endif; ?>
|
@@ -1,472 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* TileServer.php project
|
||||
* ======================
|
||||
* https://github.com/klokantech/tileserver-php/
|
||||
* Copyright (C) 2012 - Klokan Technologies GmbH
|
||||
*/
|
||||
|
||||
require "tileserver.php";
|
||||
|
||||
$maps = maps();
|
||||
|
||||
header("Content-type: application/xml");
|
||||
|
||||
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"; ?>
|
||||
<Capabilities xmlns="http://www.opengis.net/wmts/1.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml" xsi:schemaLocation="http://www.opengis.net/wmts/1.0 http://schemas.opengis.net/wmts/1.0/wmtsGetCapabilities_response.xsd" version="1.0.0">
|
||||
<!-- Service Identification -->
|
||||
<ows:ServiceIdentification>
|
||||
<ows:Title><?php echo $config['serverTitle'] ?></ows:Title>
|
||||
<ows:ServiceType>OGC WMTS</ows:ServiceType>
|
||||
<ows:ServiceTypeVersion>1.0.0</ows:ServiceTypeVersion>
|
||||
</ows:ServiceIdentification>
|
||||
<!-- Operations Metadata -->
|
||||
<ows:OperationsMetadata>
|
||||
<ows:Operation name="GetCapabilities">
|
||||
<ows:DCP>
|
||||
<ows:HTTP>
|
||||
<ows:Get xlink:href="<?php echo $baseUrl ?>wmts/1.0.0/WMTSCapabilities.xml">
|
||||
<ows:Constraint name="GetEncoding">
|
||||
<ows:AllowedValues>
|
||||
<ows:Value>RESTful</ows:Value>
|
||||
</ows:AllowedValues>
|
||||
</ows:Constraint>
|
||||
</ows:Get>
|
||||
<!-- add KVP binding in 10.1 -->
|
||||
<ows:Get xlink:href="<?php echo $baseUrl ?>wmts?">
|
||||
<ows:Constraint name="GetEncoding">
|
||||
<ows:AllowedValues>
|
||||
<ows:Value>KVP</ows:Value>
|
||||
</ows:AllowedValues>
|
||||
</ows:Constraint>
|
||||
</ows:Get>
|
||||
</ows:HTTP>
|
||||
</ows:DCP>
|
||||
</ows:Operation>
|
||||
<ows:Operation name="GetTile">
|
||||
<ows:DCP>
|
||||
<ows:HTTP>
|
||||
<ows:Get xlink:href="<?php echo $baseUrl ?>wmts/">
|
||||
<ows:Constraint name="GetEncoding">
|
||||
<ows:AllowedValues>
|
||||
<ows:Value>RESTful</ows:Value>
|
||||
</ows:AllowedValues>
|
||||
</ows:Constraint>
|
||||
</ows:Get>
|
||||
<ows:Get xlink:href="<?php echo $baseUrl ?>wmts?">
|
||||
<ows:Constraint name="GetEncoding">
|
||||
<ows:AllowedValues>
|
||||
<ows:Value>KVP</ows:Value>
|
||||
</ows:AllowedValues>
|
||||
</ows:Constraint>
|
||||
</ows:Get>
|
||||
</ows:HTTP>
|
||||
</ows:DCP>
|
||||
</ows:Operation>
|
||||
</ows:OperationsMetadata>
|
||||
<Contents>
|
||||
|
||||
<!--Layer-->
|
||||
<?php
|
||||
|
||||
foreach ($maps as $m) {
|
||||
$basename = $m['basename'];
|
||||
$title = (array_key_exists('name', $m )) ? $m['name'] : $basename;
|
||||
$profile = $m['profile'];
|
||||
$bounds = $m['bounds'];
|
||||
$format = $m['format'];
|
||||
$mime = ($format == 'jpg') ? 'image/jpeg' : 'image/png';
|
||||
if ($profile == 'geodetic') {
|
||||
$tileMatrixSet = "WGS84";
|
||||
} else {
|
||||
$tileMatrixSet = "GoogleMapsCompatible";
|
||||
list( $minx, $miny ) = $mercator->LatLonToMeters($bounds[1], $bounds[0]);
|
||||
list( $maxx, $maxy ) = $mercator->LatLonToMeters($bounds[3], $bounds[2]);
|
||||
$bounds3857 = array( $minx, $miny, $maxx, $maxy );
|
||||
}
|
||||
|
||||
?>
|
||||
<Layer>
|
||||
<ows:Title><?php echo $title ?></ows:Title>
|
||||
<ows:Identifier><?php echo $basename ?></ows:Identifier>
|
||||
<?php /* GAIA client does not like it
|
||||
if ($profile == 'mercator') { ?>
|
||||
<ows:BoundingBox crs="urn:ogc:def:crs:EPSG::102100">
|
||||
<ows:LowerCorner><?php echo $bounds3857[1], ' ', $bounds3857[0] ?></ows:LowerCorner>
|
||||
<ows:UpperCorner><?php echo $bounds3857[3], ' ', $bounds3857[2] ?></ows:UpperCorner>
|
||||
</ows:BoundingBox>
|
||||
<?php } */ ?>
|
||||
<ows:WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">
|
||||
<ows:LowerCorner><?php echo $bounds[0], ' ', $bounds[1] ?></ows:LowerCorner>
|
||||
<ows:UpperCorner><?php echo $bounds[2], ' ', $bounds[3] ?></ows:UpperCorner>
|
||||
</ows:WGS84BoundingBox>
|
||||
<Style isDefault="true">
|
||||
<ows:Identifier>default</ows:Identifier>
|
||||
</Style>
|
||||
<Format><?php echo $mime ?></Format>
|
||||
<TileMatrixSetLink>
|
||||
<TileMatrixSet><?php echo $tileMatrixSet ?></TileMatrixSet>
|
||||
</TileMatrixSetLink>
|
||||
<ResourceURL format="<?php echo $mime ?>" resourceType="tile" template="<?php echo $baseUrl ?><?php echo $basename ?>/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.<?php echo $format ?>"/>
|
||||
</Layer>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<!--TileMatrixSet-->
|
||||
|
||||
<TileMatrixSet>
|
||||
<ows:Title>GoogleMapsCompatible</ows:Title>
|
||||
<ows:Abstract>the wellknown 'GoogleMapsCompatible' tile matrix set defined by OGC WMTS specification</ows:Abstract>
|
||||
<ows:Identifier>GoogleMapsCompatible</ows:Identifier>
|
||||
<ows:SupportedCRS>urn:ogc:def:crs:EPSG:6.18:3:3857</ows:SupportedCRS>
|
||||
<WellKnownScaleSet>urn:ogc:def:wkss:OGC:1.0:GoogleMapsCompatible</WellKnownScaleSet>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>0</ows:Identifier>
|
||||
<ScaleDenominator>559082264.0287178</ScaleDenominator>
|
||||
<TopLeftCorner>-20037508.34278925 20037508.34278925</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>1</MatrixWidth>
|
||||
<MatrixHeight>1</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>1</ows:Identifier>
|
||||
<ScaleDenominator>279541132.0143589</ScaleDenominator>
|
||||
<TopLeftCorner>-20037508.34278925 20037508.34278925</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>2</MatrixWidth>
|
||||
<MatrixHeight>2</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>2</ows:Identifier>
|
||||
<ScaleDenominator>139770566.0071794</ScaleDenominator>
|
||||
<TopLeftCorner>-20037508.34278925 20037508.34278925</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>4</MatrixWidth>
|
||||
<MatrixHeight>4</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>3</ows:Identifier>
|
||||
<ScaleDenominator>69885283.00358972</ScaleDenominator>
|
||||
<TopLeftCorner>-20037508.34278925 20037508.34278925</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>8</MatrixWidth>
|
||||
<MatrixHeight>8</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>4</ows:Identifier>
|
||||
<ScaleDenominator>34942641.50179486</ScaleDenominator>
|
||||
<TopLeftCorner>-20037508.34278925 20037508.34278925</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>16</MatrixWidth>
|
||||
<MatrixHeight>16</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>5</ows:Identifier>
|
||||
<ScaleDenominator>17471320.75089743</ScaleDenominator>
|
||||
<TopLeftCorner>-20037508.34278925 20037508.34278925</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>32</MatrixWidth>
|
||||
<MatrixHeight>32</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>6</ows:Identifier>
|
||||
<ScaleDenominator>8735660.375448715</ScaleDenominator>
|
||||
<TopLeftCorner>-20037508.34278925 20037508.34278925</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>64</MatrixWidth>
|
||||
<MatrixHeight>64</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>7</ows:Identifier>
|
||||
<ScaleDenominator>4367830.187724357</ScaleDenominator>
|
||||
<TopLeftCorner>-20037508.34278925 20037508.34278925</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>128</MatrixWidth>
|
||||
<MatrixHeight>128</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>8</ows:Identifier>
|
||||
<ScaleDenominator>2183915.093862179</ScaleDenominator>
|
||||
<TopLeftCorner>-20037508.34278925 20037508.34278925</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>256</MatrixWidth>
|
||||
<MatrixHeight>256</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>9</ows:Identifier>
|
||||
<ScaleDenominator>1091957.546931089</ScaleDenominator>
|
||||
<TopLeftCorner>-20037508.34278925 20037508.34278925</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>512</MatrixWidth>
|
||||
<MatrixHeight>512</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>10</ows:Identifier>
|
||||
<ScaleDenominator>545978.7734655447</ScaleDenominator>
|
||||
<TopLeftCorner>-20037508.34278925 20037508.34278925</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>1024</MatrixWidth>
|
||||
<MatrixHeight>1024</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>11</ows:Identifier>
|
||||
<ScaleDenominator>272989.3867327723</ScaleDenominator>
|
||||
<TopLeftCorner>-20037508.34278925 20037508.34278925</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>2048</MatrixWidth>
|
||||
<MatrixHeight>2048</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>12</ows:Identifier>
|
||||
<ScaleDenominator>136494.6933663862</ScaleDenominator>
|
||||
<TopLeftCorner>-20037508.34278925 20037508.34278925</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>4096</MatrixWidth>
|
||||
<MatrixHeight>4096</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>13</ows:Identifier>
|
||||
<ScaleDenominator>68247.34668319309</ScaleDenominator>
|
||||
<TopLeftCorner>-20037508.34278925 20037508.34278925</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>8192</MatrixWidth>
|
||||
<MatrixHeight>8192</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>14</ows:Identifier>
|
||||
<ScaleDenominator>34123.67334159654</ScaleDenominator>
|
||||
<TopLeftCorner>-20037508.34278925 20037508.34278925</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>16384</MatrixWidth>
|
||||
<MatrixHeight>16384</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>15</ows:Identifier>
|
||||
<ScaleDenominator>17061.83667079827</ScaleDenominator>
|
||||
<TopLeftCorner>-20037508.34278925 20037508.34278925</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>32768</MatrixWidth>
|
||||
<MatrixHeight>32768</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>16</ows:Identifier>
|
||||
<ScaleDenominator>8530.918335399136</ScaleDenominator>
|
||||
<TopLeftCorner>-20037508.34278925 20037508.34278925</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>65536</MatrixWidth>
|
||||
<MatrixHeight>65536</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>17</ows:Identifier>
|
||||
<ScaleDenominator>4265.459167699568</ScaleDenominator>
|
||||
<TopLeftCorner>-20037508.34278925 20037508.34278925</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>131072</MatrixWidth>
|
||||
<MatrixHeight>131072</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>18</ows:Identifier>
|
||||
<ScaleDenominator>2132.729583849784</ScaleDenominator>
|
||||
<TopLeftCorner>-20037508.34278925 20037508.34278925</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>262144</MatrixWidth>
|
||||
<MatrixHeight>262144</MatrixHeight>
|
||||
</TileMatrix>
|
||||
</TileMatrixSet>
|
||||
|
||||
<TileMatrixSet>
|
||||
<ows:Identifier>WGS84</ows:Identifier>
|
||||
<ows:Title>GoogleCRS84Quad</ows:Title>
|
||||
<ows:SupportedCRS>urn:ogc:def:crs:EPSG:6.3:4326</ows:SupportedCRS>
|
||||
<ows:BoundingBox crs="urn:ogc:def:crs:EPSG:6.3:4326">
|
||||
<LowerCorner>-180.000000 -90.000000</LowerCorner>
|
||||
<UpperCorner>180.000000 90.000000</UpperCorner>
|
||||
</ows:BoundingBox>
|
||||
<WellKnownScaleSet>urn:ogc:def:wkss:OGC:1.0:GoogleCRS84Quad</WellKnownScaleSet>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>0</ows:Identifier>
|
||||
<ScaleDenominator>279541132.01435887813568115234</ScaleDenominator>
|
||||
<TopLeftCorner>90.000000 -180.000000</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>2</MatrixWidth>
|
||||
<MatrixHeight>1</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>1</ows:Identifier>
|
||||
<ScaleDenominator>139770566.00717943906784057617</ScaleDenominator>
|
||||
<TopLeftCorner>90.000000 -180.000000</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>4</MatrixWidth>
|
||||
<MatrixHeight>2</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>2</ows:Identifier>
|
||||
<ScaleDenominator>69885283.00358971953392028809</ScaleDenominator>
|
||||
<TopLeftCorner>90.000000 -180.000000</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>8</MatrixWidth>
|
||||
<MatrixHeight>4</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>3</ows:Identifier>
|
||||
<ScaleDenominator>34942641.50179485976696014404</ScaleDenominator>
|
||||
<TopLeftCorner>90.000000 -180.000000</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>16</MatrixWidth>
|
||||
<MatrixHeight>8</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>4</ows:Identifier>
|
||||
<ScaleDenominator>17471320.75089742988348007202</ScaleDenominator>
|
||||
<TopLeftCorner>90.000000 -180.000000</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>32</MatrixWidth>
|
||||
<MatrixHeight>16</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>5</ows:Identifier>
|
||||
<ScaleDenominator>8735660.37544871494174003601</ScaleDenominator>
|
||||
<TopLeftCorner>90.000000 -180.000000</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>64</MatrixWidth>
|
||||
<MatrixHeight>32</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>6</ows:Identifier>
|
||||
<ScaleDenominator>4367830.18772435747087001801</ScaleDenominator>
|
||||
<TopLeftCorner>90.000000 -180.000000</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>128</MatrixWidth>
|
||||
<MatrixHeight>64</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>7</ows:Identifier>
|
||||
<ScaleDenominator>2183915.09386217873543500900</ScaleDenominator>
|
||||
<TopLeftCorner>90.000000 -180.000000</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>256</MatrixWidth>
|
||||
<MatrixHeight>128</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>8</ows:Identifier>
|
||||
<ScaleDenominator>1091957.54693108936771750450</ScaleDenominator>
|
||||
<TopLeftCorner>90.000000 -180.000000</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>512</MatrixWidth>
|
||||
<MatrixHeight>256</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>9</ows:Identifier>
|
||||
<ScaleDenominator>545978.77346554468385875225</ScaleDenominator>
|
||||
<TopLeftCorner>90.000000 -180.000000</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>1024</MatrixWidth>
|
||||
<MatrixHeight>512</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>10</ows:Identifier>
|
||||
<ScaleDenominator>272989.38673277234192937613</ScaleDenominator>
|
||||
<TopLeftCorner>90.000000 -180.000000</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>2048</MatrixWidth>
|
||||
<MatrixHeight>1024</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>11</ows:Identifier>
|
||||
<ScaleDenominator>136494.69336638617096468806</ScaleDenominator>
|
||||
<TopLeftCorner>90.000000 -180.000000</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>4096</MatrixWidth>
|
||||
<MatrixHeight>2048</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>12</ows:Identifier>
|
||||
<ScaleDenominator>68247.34668319308548234403</ScaleDenominator>
|
||||
<TopLeftCorner>90.000000 -180.000000</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>8192</MatrixWidth>
|
||||
<MatrixHeight>4096</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>13</ows:Identifier>
|
||||
<ScaleDenominator>34123.67334159654274117202</ScaleDenominator>
|
||||
<TopLeftCorner>90.000000 -180.000000</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>16384</MatrixWidth>
|
||||
<MatrixHeight>8192</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>14</ows:Identifier>
|
||||
<ScaleDenominator>17061.83667079825318069197</ScaleDenominator>
|
||||
<TopLeftCorner>90.000000 -180.000000</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>32768</MatrixWidth>
|
||||
<MatrixHeight>16384</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>15</ows:Identifier>
|
||||
<ScaleDenominator>8530.91833539912659034599</ScaleDenominator>
|
||||
<TopLeftCorner>90.000000 -180.000000</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>65536</MatrixWidth>
|
||||
<MatrixHeight>32768</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>16</ows:Identifier>
|
||||
<ScaleDenominator>4265.45916769956329517299</ScaleDenominator>
|
||||
<TopLeftCorner>90.000000 -180.000000</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>131072</MatrixWidth>
|
||||
<MatrixHeight>65536</MatrixHeight>
|
||||
</TileMatrix>
|
||||
<TileMatrix>
|
||||
<ows:Identifier>17</ows:Identifier>
|
||||
<ScaleDenominator>2132.72958384978574031265</ScaleDenominator>
|
||||
<TopLeftCorner>90.000000 -180.000000</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>262144</MatrixWidth>
|
||||
<MatrixHeight>131072</MatrixHeight>
|
||||
</TileMatrix>
|
||||
</TileMatrixSet>
|
||||
|
||||
</Contents>
|
||||
<ServiceMetadataURL xlink:href="<?php echo $baseUrl ?>wmts/1.0.0/WMTSCapabilities.xml"/>
|
||||
</Capabilities>
|
1731
tileserver.php
1731
tileserver.php
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user