source: subversion/applications/rendering/wms/wms.php @ 34399

Last change on this file since 34399 was 9330, checked in by isortega, 11 years ago

WMS now features basic osmarender support (only z17), as well as more bugs.

File size: 2.0 KB
Line 
1<?php
2
3/// @author Iván Sánchez Ortega <ivan@sanchezortega.es>
4   
5/**
6    OSM WMS ("OpenStreetMap Web Map Service")
7    Copyright (C) 2008, Iván Sánchez Ortega
8
9    This program is free software: you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation, either version 3 of the License, or
12    (at your option) any later version.
13
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18
19    You should have received a copy of the GNU General Public License
20    along with this program.  If not, see <http://www.gnu.org/licenses/>.
21*/   
22   
23   
24/// Entry WMS script
25
26/// TODO: __autoload() classes.
27
28require('error_handler.php');
29require_once('class.wireframe.php');
30require_once('class.osmarender.php');
31require_once('class.backend.php');
32require_once('class.backend_api.php');
33require_once('class.backend_osmxapi.php');
34require_once('class.datafactory.php');
35
36
37
38if ($_REQUEST['REQUEST'] == 'GetCapabilities')
39{
40//      if ($_REQUEST['EXCEPTIONS']=='XML')
41//              fpassthru(fopen('exceptions_1_3_0.xml','r'));
42//      else
43//              fpassthru(fopen('osm_capabilities_1_3_0.xml','r'));
44
45        header('Content-type: text/xml');
46
47//      require("capabilities.php");
48//      require("capabilities_1_3_0.php");
49        require("capabilities_1_1_0.php");
50
51}
52elseif ($_REQUEST['REQUEST'] == 'GetMap')
53{
54        /// TODO: depending on the layer&style, get a renderer
55
56        $bbox   = $_REQUEST['BBOX'];
57        $height = (int) $_REQUEST['HEIGHT'];
58        $width  = (int) $_REQUEST['WIDTH'];
59        $crs    = $_REQUEST['SRS'];
60        $format = $_REQUEST['FORMAT'];
61
62//      require("wms_get_image.php");
63       
64        if ($_REQUEST['LAYERS']=='wireframe')
65        {
66                wireframe::getMap($bbox,$crs,$height,$width,$format);
67        }
68        elseif ($_REQUEST['LAYERS']=='osmarender')
69        {
70                osmarender::getMap($bbox,$crs,$height,$width,$format);
71        }
72       
73}
74
75
76
Note: See TracBrowser for help on using the repository browser.