From e36a7e6a06162ec04585ebe027ceba1a11d7f1d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dalibor=20Jan=C3=A1k?= Date: Fri, 26 Feb 2016 08:51:47 +0100 Subject: [PATCH] Fix of order of origin in geodetic profile --- tileserver.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tileserver.php b/tileserver.php index 1a9c842..46890ee 100644 --- a/tileserver.php +++ b/tileserver.php @@ -734,13 +734,13 @@ class Wmts extends Server { * @return Object */ public function parseTileMatrix($layer, $tileMatrix){ - + //process projection if(isset($layer['proj4'])){ preg_match_all("/([^+= ]+)=([^= ]+)/", $layer['proj4'], $res); $proj4 = array_combine($res[1], $res[2]); } - + for($i = 0; $i < count($tileMatrix); $i++){ if(!isset($tileMatrix[$i]['id'])){ @@ -766,7 +766,7 @@ class Wmts extends Server { $tileMatrix[$i]['extent'][0], $tileMatrix[$i]['extent'][3] ); } - // Origins of geographic coordinate systems are setting in opposite order + // Origins of geographic coordinate systems are setting in opposite order if (isset($proj4) && $proj4['proj'] === 'longlat') { $tileMatrix[$i]['origin'] = array_reverse($tileMatrix[$i]['origin']); } @@ -853,7 +853,7 @@ class Wmts extends Server { 'extent' => $extent, 'id' => (string) $i, 'matrix_size' => array($matrixSize * 2, $matrixSize), - 'origin' => array($extent[0], $extent[3]), + 'origin' => array($extent[3], $extent[0]), 'scale_denominator' => $scaleDenominators[$i], 'tile_size' => array(256, 256) ); @@ -910,7 +910,7 @@ class Wmts extends Server { ); } } - + header('Content-type: application/xml'); echo ' @@ -1019,7 +1019,7 @@ class Wmts extends Server { '; } - + // Print custom TileMatrixSets if (strlen($customtileMatrixSets) > 0) { echo $customtileMatrixSets;