mirror of
https://github.com/klokantech/tileserver-php.git
synced 2025-08-07 15:16:28 +02:00
Order of origin coords based on proj4 definition #70
This commit is contained in:
@@ -735,6 +735,12 @@ class Wmts extends Server {
|
|||||||
*/
|
*/
|
||||||
public function parseTileMatrix($layer, $tileMatrix){
|
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++){
|
for($i = 0; $i < count($tileMatrix); $i++){
|
||||||
|
|
||||||
if(!isset($tileMatrix[$i]['id'])){
|
if(!isset($tileMatrix[$i]['id'])){
|
||||||
@@ -760,11 +766,8 @@ class Wmts extends Server {
|
|||||||
$tileMatrix[$i]['extent'][0], $tileMatrix[$i]['extent'][3]
|
$tileMatrix[$i]['extent'][0], $tileMatrix[$i]['extent'][3]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!isset($layer['axis'])) {
|
|
||||||
$layer['axis'] = $layer['xy'];
|
|
||||||
}
|
|
||||||
// Origins of geographic coordinate systems are setting in opposite order
|
// Origins of geographic coordinate systems are setting in opposite order
|
||||||
if ($layer['axis'] == 'yx') {
|
if (isset($proj4) && $proj4['proj'] === 'longlat') {
|
||||||
$tileMatrix[$i]['origin'] = array_reverse($tileMatrix[$i]['origin']);
|
$tileMatrix[$i]['origin'] = array_reverse($tileMatrix[$i]['origin']);
|
||||||
}
|
}
|
||||||
if(!isset($tileMatrix[$i]['scale_denominator'])){
|
if(!isset($tileMatrix[$i]['scale_denominator'])){
|
||||||
|
Reference in New Issue
Block a user