Commit 0b59c5f85169c72f629380585e640adec840c4a2
1 parent
11b943ef
Exists in
master
and in
7 other branches
inclusão de saida kml em ogc.php
Showing
3 changed files
with
22 additions
and
13 deletions
Show diff stats
ogc.php
| ... | ... | @@ -85,6 +85,26 @@ require_once(dirname(__FILE__)."/classesphp/carrega_ext.php"); |
| 85 | 85 | include(dirname(__FILE__)."/ms_configura.php"); |
| 86 | 86 | include(dirname(__FILE__)."/classesphp/pega_variaveis.php"); |
| 87 | 87 | include(dirname(__FILE__)."/classesphp/funcoes_gerais.php"); |
| 88 | +//para o caso da requisicao kml | |
| 89 | +//FIXME envia uma linha estranha no header. Nao da pra usar | |
| 90 | +if(strtolower($OUTPUTFORMAT) == "kml" || strtolower($OUTPUTFORMAT) == "kmz"){ | |
| 91 | + //http://localhost/i3geo/pacotes/kmlmapserver/kmlservice.php?request=kmz&map=_lbiomashp&typename=_lbiomashp | |
| 92 | + $urln = "pacotes/kmlmapserver/kmlservice.php?request=kmz&map=".$tema."&typename=".$tema; | |
| 93 | + header("Location:".$urln); | |
| 94 | + exit; | |
| 95 | + /* | |
| 96 | + $l = $oMap->getlayer(0); | |
| 97 | + $n = $l->name."-kml"; | |
| 98 | + $oMap->selectOutputFormat("kml"); | |
| 99 | + $oMap->outputformat->setOption("STORAGE", "memory"); | |
| 100 | + $oMap->outputformat->setOption("FILENAME", $n.".kml"); | |
| 101 | + $l->setmetadata("wfs_getfeature_formatlist","kml"); | |
| 102 | + $oMap->save($nomeMapfileTmp); | |
| 103 | + header('Content-Disposition: attachment; filename='.$n.'.kml'); | |
| 104 | + header("Content-type: application/vnd.google-earth.kml+xml"); | |
| 105 | + */ | |
| 106 | +} | |
| 107 | + | |
| 88 | 108 | //define um nome para o mapfile caso a origem seja o sistema de metadados estatisticos |
| 89 | 109 | if(isset($id_medida_variavel)){ |
| 90 | 110 | $tema = "ogcmetaestat".$id_medida_variavel; |
| ... | ... | @@ -815,18 +835,6 @@ if(isset($OUTPUTFORMAT)){ |
| 815 | 835 | } |
| 816 | 836 | } |
| 817 | 837 | //FIXME envia uma linha estranha no header. Nao da pra usar |
| 818 | - if(strtolower($OUTPUTFORMAT) == "kml"){ | |
| 819 | - $l = $oMap->getlayer(0); | |
| 820 | - $n = $l->name."-kml"; | |
| 821 | - $oMap->selectOutputFormat("kml"); | |
| 822 | - $oMap->outputformat->setOption("STORAGE", "memory"); | |
| 823 | - $oMap->outputformat->setOption("FILENAME", $n.".kml"); | |
| 824 | - $l->setmetadata("wfs_getfeature_formatlist","kml"); | |
| 825 | - $oMap->save($nomeMapfileTmp); | |
| 826 | - header('Content-Disposition: attachment; filename='.$n.'.kml'); | |
| 827 | - header("Content-type: application/vnd.google-earth.kml+xml"); | |
| 828 | - } | |
| 829 | - //FIXME envia uma linha estranha no header. Nao da pra usar | |
| 830 | 838 | if(strtolower($OUTPUTFORMAT) == "geojson"){ |
| 831 | 839 | $l = $oMap->getlayer(0); |
| 832 | 840 | $oMap->selectOutputFormat("geojson"); | ... | ... |
pacotes/kmlmapserver/classes/kmlserver.class.php