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,6 +85,26 @@ require_once(dirname(__FILE__)."/classesphp/carrega_ext.php"); | ||
| 85 | include(dirname(__FILE__)."/ms_configura.php"); | 85 | include(dirname(__FILE__)."/ms_configura.php"); |
| 86 | include(dirname(__FILE__)."/classesphp/pega_variaveis.php"); | 86 | include(dirname(__FILE__)."/classesphp/pega_variaveis.php"); |
| 87 | include(dirname(__FILE__)."/classesphp/funcoes_gerais.php"); | 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 | //define um nome para o mapfile caso a origem seja o sistema de metadados estatisticos | 108 | //define um nome para o mapfile caso a origem seja o sistema de metadados estatisticos |
| 89 | if(isset($id_medida_variavel)){ | 109 | if(isset($id_medida_variavel)){ |
| 90 | $tema = "ogcmetaestat".$id_medida_variavel; | 110 | $tema = "ogcmetaestat".$id_medida_variavel; |
| @@ -815,18 +835,6 @@ if(isset($OUTPUTFORMAT)){ | @@ -815,18 +835,6 @@ if(isset($OUTPUTFORMAT)){ | ||
| 815 | } | 835 | } |
| 816 | } | 836 | } |
| 817 | //FIXME envia uma linha estranha no header. Nao da pra usar | 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 | if(strtolower($OUTPUTFORMAT) == "geojson"){ | 838 | if(strtolower($OUTPUTFORMAT) == "geojson"){ |
| 831 | $l = $oMap->getlayer(0); | 839 | $l = $oMap->getlayer(0); |
| 832 | $oMap->selectOutputFormat("geojson"); | 840 | $oMap->selectOutputFormat("geojson"); |
pacotes/kmlmapserver/classes/kmlserver.class.php
temas/_lbiomashp.map
| @@ -29,6 +29,7 @@ MAP | @@ -29,6 +29,7 @@ MAP | ||
| 29 | "permiteogc" "sim" | 29 | "permiteogc" "sim" |
| 30 | "TEMA" "Biomas shapefile (acentuação)" | 30 | "TEMA" "Biomas shapefile (acentuação)" |
| 31 | "convcaracter" "" | 31 | "convcaracter" "" |
| 32 | + "permitekmz" "sim" | ||
| 32 | END # METADATA | 33 | END # METADATA |
| 33 | NAME "_lbiomashp" | 34 | NAME "_lbiomashp" |
| 34 | PROCESSING "ITEMS=CD_LEGENDA" | 35 | PROCESSING "ITEMS=CD_LEGENDA" |