mirror of
https://github.com/klokantech/tileserver-php.git
synced 2025-08-29 09:10:37 +02:00
Compare commits
62 Commits
v1
...
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 |
34
.htaccess
34
.htaccess
@@ -1,27 +1,33 @@
|
||||
# tileserver.php integration with Apache via .htaccess
|
||||
|
||||
# Restrictions for data crawlers
|
||||
#Options -Indexes
|
||||
|
||||
# Optional 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
|
||||
|
||||
#check htaccess functionality
|
||||
DirectoryIndex tileserver.php
|
||||
|
||||
RewriteEngine on
|
||||
|
||||
#some hostings require RewriteBase e.g. 1&1.com
|
||||
# Option: some hostings require RewriteBase e.g. 1&1.com
|
||||
#RewriteBase /
|
||||
#RewriteBase /server/
|
||||
#RewriteBase /directory/
|
||||
|
||||
#some hostings require -MultiViews e.g. 1&1.com
|
||||
# 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>
|
||||
|
||||
# Block direct downloading of .mbtiles
|
||||
<FilesMatch "\.mbtiles$">
|
||||
Order Allow,Deny
|
||||
Deny from all
|
||||
</FilesMatch>
|
||||
|
||||
# Mapping of the WMTS standardized URLs to real files and XML capabilities to tileserver.php
|
||||
|
||||
# WMTS RESTful
|
||||
# ------------
|
||||
# The file can be accessed directly:
|
||||
@@ -69,4 +75,4 @@ RewriteRule .* - [E=HTTP_IF_NONE_MATCH:%{HTTP:If-None-Match}]
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond $1 !^(tileserver\.php)
|
||||
RewriteRule ^(.*)$ tileserver.php?/$1 [L,QSA]
|
||||
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
|
||||
|
931
tileserver.php
931
tileserver.php
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user