Commit 0b59c5f85169c72f629380585e640adec840c4a2

Authored by Edmar Moretti
1 parent 11b943ef

inclusão de saida kml em ogc.php

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
... ... @@ -98,4 +98,4 @@ class KmlServer {
98 98 return $value;
99 99 }
100 100 }
101   -?>
102 101 \ No newline at end of file
  102 +?>
... ...
temas/_lbiomashp.map
... ... @@ -29,6 +29,7 @@ MAP
29 29 "permiteogc" "sim"
30 30 "TEMA" "Biomas shapefile (acentuação)"
31 31 "convcaracter" ""
  32 + "permitekmz" "sim"
32 33 END # METADATA
33 34 NAME "_lbiomashp"
34 35 PROCESSING "ITEMS=CD_LEGENDA"
... ...