mirror of
https://github.com/klokantech/tileserver-php.git
synced 2025-08-02 12:47:31 +02:00
Fix of order of origin in geodetic profile
This commit is contained in:
@@ -734,13 +734,13 @@ class Wmts extends Server {
|
|||||||
* @return Object
|
* @return Object
|
||||||
*/
|
*/
|
||||||
public function parseTileMatrix($layer, $tileMatrix){
|
public function parseTileMatrix($layer, $tileMatrix){
|
||||||
|
|
||||||
//process projection
|
//process projection
|
||||||
if(isset($layer['proj4'])){
|
if(isset($layer['proj4'])){
|
||||||
preg_match_all("/([^+= ]+)=([^= ]+)/", $layer['proj4'], $res);
|
preg_match_all("/([^+= ]+)=([^= ]+)/", $layer['proj4'], $res);
|
||||||
$proj4 = array_combine($res[1], $res[2]);
|
$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'])){
|
||||||
@@ -766,7 +766,7 @@ class Wmts extends Server {
|
|||||||
$tileMatrix[$i]['extent'][0], $tileMatrix[$i]['extent'][3]
|
$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') {
|
if (isset($proj4) && $proj4['proj'] === 'longlat') {
|
||||||
$tileMatrix[$i]['origin'] = array_reverse($tileMatrix[$i]['origin']);
|
$tileMatrix[$i]['origin'] = array_reverse($tileMatrix[$i]['origin']);
|
||||||
}
|
}
|
||||||
@@ -853,7 +853,7 @@ class Wmts extends Server {
|
|||||||
'extent' => $extent,
|
'extent' => $extent,
|
||||||
'id' => (string) $i,
|
'id' => (string) $i,
|
||||||
'matrix_size' => array($matrixSize * 2, $matrixSize),
|
'matrix_size' => array($matrixSize * 2, $matrixSize),
|
||||||
'origin' => array($extent[0], $extent[3]),
|
'origin' => array($extent[3], $extent[0]),
|
||||||
'scale_denominator' => $scaleDenominators[$i],
|
'scale_denominator' => $scaleDenominators[$i],
|
||||||
'tile_size' => array(256, 256)
|
'tile_size' => array(256, 256)
|
||||||
);
|
);
|
||||||
@@ -910,7 +910,7 @@ class Wmts extends Server {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
header('Content-type: application/xml');
|
header('Content-type: application/xml');
|
||||||
echo '<?xml version="1.0" encoding="UTF-8" ?>
|
echo '<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<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">
|
<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">
|
||||||
@@ -1019,7 +1019,7 @@ class Wmts extends Server {
|
|||||||
<ResourceURL format="' . $mime . '" resourceType="tile" template="' . $resourceUrlTemplate . '"/>
|
<ResourceURL format="' . $mime . '" resourceType="tile" template="' . $resourceUrlTemplate . '"/>
|
||||||
</Layer>';
|
</Layer>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print custom TileMatrixSets
|
// Print custom TileMatrixSets
|
||||||
if (strlen($customtileMatrixSets) > 0) {
|
if (strlen($customtileMatrixSets) > 0) {
|
||||||
echo $customtileMatrixSets;
|
echo $customtileMatrixSets;
|
||||||
|
Reference in New Issue
Block a user