Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 78 lines (70 sloc) 3.543 kB
296e3fa @srahn kvwmap Version 1.8.0
authored
1 <?php
2 ###################################################################
3 # kvwmap - Kartenserver für Kreisverwaltungen #
4 ###################################################################
5 # Lizenz #
6 # #
7 # Copyright (C) 2004 Peter Korduan #
8 # #
9 # This program is free software; you can redistribute it and/or #
10 # modify it under the terms of the GNU General Public License as #
11 # published by the Free Software Foundation; either version 2 of #
12 # the License, or (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 #
20 # License along with this program; if not, write to the Free #
21 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, #
22 # MA 02111-1307, USA. #
23 # #
24 # Kontakt: #
25 # pkorduan@gmx.de peter.korduan@auf.uni-rostock.de #
26 ###################################################################
27 #############################
28 # Klasse dbf #
29 #############################
30
31 class tif {
32
33 ################### Liste der Funktionen ########################################################################################################
34 # tif($map)
35 ##################################################################################################################################################
36
37 function tif($map, $resolution) {
38 $this->map=$map;
39 $this->resolution=$resolution;
40 }
41
42 function setmap(){
43 $breite = $this->map->extent->maxx - $this->map->extent->minx;
44 $current_resolution = $breite/$this->map->width;
45 str_replace(',','.',$this->resolution);
46 $ratio = $current_resolution/$this->resolution;
47 $this->map->set('width', $this->map->width*$ratio);
48 $this->map->set('height', $this->map->height*$ratio);
49 $this->final_resolution = $breite/$this->map->width;
50 return $this->map;
51 }
52
53 function create_tif($karte){
54 $this->dateiname = explode('.', basename($karte));
55 exec(IMAGEMAGICKPATH.'convert '.IMAGEPATH.basename($karte).' '.IMAGEPATH.$this->dateiname[0].'.tif');
56 #echo IMAGEMAGICKPATH.'convert '.IMAGEPATH.basename($karte).' '.IMAGEPATH.$this->dateiname[0].'.tif';
57 if(file_exists(IMAGEPATH.$this->dateiname[0].'.tif')){
58 $this->tifimage = IMAGEURL.$this->dateiname[0].'.tif';
59 }
60 else{
61 $this->tifimage = 'error';
62 }
63 }
64
65 function create_tfw(){
66 $fp = fopen(IMAGEPATH.$this->dateiname[0].'.tfw', 'w');
67 fwrite($fp, $this->final_resolution.chr(10));
68 fwrite($fp, '0.00'.chr(10));
69 fwrite($fp, '0.00'.chr(10));
70 fwrite($fp, '-'.$this->final_resolution.chr(10));
71 fwrite($fp, $this->map->extent->minx.chr(10));
72 fwrite($fp, $this->map->extent->maxy.chr(10));
73 $this->tfwfile = IMAGEURL.$this->dateiname[0].'.tfw';
74 }
75
76 }
77 ?>
Something went wrong with that request. Please try again.