Commit a8169eacb2be1d02f033ba1fffb69455d30e92af

Authored by Edmar Moretti
1 parent 0b59c5f8

Inclusão de download KMZ e servico KMZ em OGC

admin/admin.db
No preview for this file type
admin/js/listatemas.js
... ... @@ -2,8 +2,17 @@ function editorTemaMapfile(mapfile)
2 2 {
3 3 core_pegaDados("buscando dados...","../php/menutemas.php?funcao=pegaTemaPorMapfile&codigo_tema="+mapfile,"montaEditorTema");
4 4 }
5   -function montaEditorTema(dados)
6   -{
  5 +function montaEditorTema(dados){
  6 + var temp = function(){
  7 + gravaDadosTema(dados[0].id_tema);
  8 + };
  9 + core_montaEditor(temp,"400px","400px","","Tema",true,true,false);
  10 + $i("editor_bd").innerHTML = montaDivTemas(dados[0]);
  11 + //
  12 + //preenche a div com a lista de tags
  13 + //
  14 + core_comboTags("comboTags","tags_tema","registraTagTema");
  15 + /*
7 16 function on_editorCheckBoxChange(p_oEvent)
8 17 {
9 18 var temp;
... ... @@ -53,6 +62,7 @@ function montaEditorTema(dados)
53 62 //preenche a div com a lista de tags
54 63 //
55 64 core_comboTags("comboTags","tags_tema","registraTagTema");
  65 + */
56 66 }
57 67 function registraTagTema(valor)
58 68 {
... ... @@ -99,15 +109,15 @@ function montaDivTemas(i)
99 109 ins += "<select id='ogc_tema' >";
100 110 ins += core_combosimnao(i.ogc_tema);
101 111 ins += "</select></p>";
102   - ins += "<p>Permite o download na aplica&ccedil;&atilde;o datadownload.htm? (n&atilde; afeta temas do tipo gvSIG) (n&atilde;o afeta a permiss&atilde;o de download definida no item 'disponibilidade' existente em cada layer)<br>";
  112 + ins += "<p>Permite o download na aplica&ccedil;&atilde;o datadownload.htm? (n&atilde;o afeta temas do tipo gvSIG) (n&atilde;o afeta a permiss&atilde;o de download definida no item 'disponibilidade' existente em cada layer)<br>";
103 113 ins += "<select id='download_tema' >";
104 114 ins += core_combosimnao(i.download_tema);
105 115 ins += "</select></p>";
106   - ins += "<p>Permite acesso via kml? (n&atilde; restringe em temas do tipo gvSIG)<br>";
  116 + ins += "<p>Permite acesso via kml? (n&atilde;o restringe em temas do tipo gvSIG)<br>";
107 117 ins += "<select id='kml_tema' >";
108 118 ins += core_combosimnao(i.kml_tema);
109 119 ins += "</select></p>";
110   - ins += "<p>Permite acesso via kmz (kml com dados vetoriais)? (n&atilde; restringe em temas do tipo gvSIG)<br>";
  120 + ins += "<p>Permite acesso via kmz (kml com dados vetoriais)? (n&atilde;o restringe em temas do tipo gvSIG)<br>";
111 121 ins += "<select id='kmz_tema' >";
112 122 ins += core_combosimnao(i.kmz_tema);
113 123 ins += "</select></p>";
... ... @@ -188,8 +198,9 @@ function gravaDadosTema(id)
188 198 //myDataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText)[0])
189 199 core_carregando("desativa");
190 200 }
191   - YAHOO.admin.container.panelEditorTema.destroy();
192   - YAHOO.admin.container.panelEditorTema = null;
  201 + YAHOO.admin.container.panelEditor.destroy();
  202 + YAHOO.admin.container.panelEditor = null;
  203 +
193 204 }
194 205 catch(e){core_handleFailure(e,o.responseText);}
195 206 },
... ...
classesjs/datadownload.js
... ... @@ -274,7 +274,7 @@ function datadownload_download(obj)
274 274 };
275 275 YAHOO.datadownloadLista.panel.setBody($trad("d28"));
276 276 YAHOO.datadownloadLista.panel.show();
277   - YAHOO.datadownloadLista.panel.cfg.setProperty("y", 100);
  277 + YAHOO.datadownloadLista.panel.cfg.setProperty("y", 100);
278 278 //document.getElementById("corpo").innerHTML = "Aguarde. Gerando arquivos..."
279 279 var p = g_locaplic+"/classesphp/mapa_controle.php?map_file=&funcao=download3&tema="+obj.title;
280 280 //caso a camada venha do sistema de metadados estatisticos e seja uma variavel
... ... @@ -315,7 +315,8 @@ function mostraDownload(retorno)
315 315 ins += "<a href='"+g_locaplic+"/ogc.php?tema="+retorno.tema+"&SERVICE=WMS&VERSION=1.1.0&format=application/openlayers&bbox=-76.5125927,-39.3925675209,-29.5851853,9.49014852081' target=blank >Ver com OpenLayers</a><br><br>";
316 316 ins += "<a href='"+g_locaplic+"/ogc.php?tema="+retorno.tema+"&SERVICE=WFS&VERSION=1.1.0&request=getfeature&OUTPUTFORMAT=shape-zip' target=blank >Download shapefile com WFS (arquivo compactado incluindo .prj)</a><br><br>";
317 317 ins += "<a href='"+g_locaplic+"/ogc.php?tema="+retorno.tema+"&SERVICE=WFS&VERSION=1.1.0&request=getfeature&OUTPUTFORMAT=csv' target=blank >Download CSV com WFS (arquivo compactado)</a><br><br>";
318   -
  318 + ins += "<a href='"+g_locaplic+"/ogc.php?tema="+retorno.tema+"&SERVICE=WFS&VERSION=1.1.0&request=getfeature&OUTPUTFORMAT=kmz' target=blank >Download KMZ</a><br><br>";
  319 +
319 320 for (var arq=0;arq<n;arq++)
320 321 {
321 322 ins += "<a href='"+window.location.protocol+"//"+window.location.host+"/"+arqs[arq]+"'>"+arqs[arq]+"</a><br>";
... ...
ogc.htm
... ... @@ -70,7 +70,7 @@ Gera o endere&amp;ccedil;o do webservice do tema escolhido
70 70  
71 71 Parameters:
72 72  
73   -tema - tema para acesso
  73 +botao - objeto do tipo input com o valor do tema para acesso
74 74 */
75 75 function ogc_endereco(botao)
76 76 {
... ... @@ -97,6 +97,7 @@ function ogc_endereco(botao)
97 97 ins += "<p><a target=blank href='"+servico+"&format=application/openlayers&bbox=-76.5125927,-39.3925675209,-29.5851853,9.49014852081' />visualizar com openLayers</a>";
98 98 ins += "<p><a target=blank href='"+servico+"&OUTPUTFORMAT=shape-zip&bbox=-76.5125927,-39.3925675209,-29.5851853,9.49014852081&service=wfs&version=1.1.0&request=getfeature&layers="+tema+"' />download shapefile via WFS</a>";
99 99 ins += "<p><a target=blank href='"+servico+"&OUTPUTFORMAT=csv&bbox=-76.5125927,-39.3925675209,-29.5851853,9.49014852081&service=wfs&version=1.1.0&request=getfeature&layers="+tema+"' />download CSV via WFS</a>";
  100 + ins += "<p><a target=blank href='"+servico+"&OUTPUTFORMAT=kmz&bbox=-76.5125927,-39.3925675209,-29.5851853,9.49014852081&service=wfs&version=1.1.0&request=getfeature&layers="+tema+"' />download KMZ</a>";
100 101  
101 102 if(!$i("panellistaarquivos")){
102 103 YAHOO.namespace("datadownloadLista");
... ...
ogc.php
... ... @@ -86,7 +86,6 @@ include(dirname(__FILE__).&quot;/ms_configura.php&quot;);
86 86 include(dirname(__FILE__)."/classesphp/pega_variaveis.php");
87 87 include(dirname(__FILE__)."/classesphp/funcoes_gerais.php");
88 88 //para o caso da requisicao kml
89   -//FIXME envia uma linha estranha no header. Nao da pra usar
90 89 if(strtolower($OUTPUTFORMAT) == "kml" || strtolower($OUTPUTFORMAT) == "kmz"){
91 90 //http://localhost/i3geo/pacotes/kmlmapserver/kmlservice.php?request=kmz&map=_lbiomashp&typename=_lbiomashp
92 91 $urln = "pacotes/kmlmapserver/kmlservice.php?request=kmz&map=".$tema."&typename=".$tema;
... ...
pacotes/kmlmapserver/classes/layerserver.class.php
... ... @@ -435,7 +435,7 @@ class LayerServer {
435 435 */
436 436 function process_shape(&$layer, &$shape, &$class_list, &$folder, &$namecol){
437 437 $permite = $layer->getmetadata("permitekmz");
438   - if($permite == "nao"){return;}
  438 + if(strtolower($permite) == "nao"){return;}
439 439 $itens = $layer->getmetadata("itens");
440 440 $itensdesc = $layer->getmetadata("itensdesc");
441 441 $shape->project($this->in_proj, $this->out_proj);
... ...
temas/_lbiomashp.map
... ... @@ -6,30 +6,29 @@ MAP
6 6 DATA "/var/www/i3geo/aplicmap/dados/biomas.shp"
7 7 METADATA
8 8 "METAESTAT_ID_MEDIDA_VARIAVEL" ""
9   - "cache" ""
10 9 "TIP" "CD_LEGENDA"
11   - "olopacity" ""
  10 + "cache" ""
12 11 "CLASSE" "SIM"
  12 + "olopacity" ""
13 13 "permitekmz" "nao"
14 14 "gmopacity" ""
15 15 "gmstatus" ""
16 16 "ITENSDESC" "Teste de acentuação"
17 17 "METAESTAT_CODIGO_TIPO_REGIAO" ""
18 18 "arquivotemaoriginal" ""
19   - "olstatus" ""
20 19 "nomeoriginal" ""
  20 + "olstatus" ""
21 21 "permitedownload" "sim"
22 22 "metaestat" ""
23 23 "download" "SIM"
24 24 "itembuscarapida" ""
25   - "arquivokmz" ""
26   - "arquivodownload" ""
27 25 "ITENS" "CD_LEGENDA"
28   - "permitekml" "sim"
  26 + "arquivodownload" ""
  27 + "arquivokmz" ""
29 28 "permiteogc" "sim"
30   - "TEMA" "Biomas shapefile (acentuação)"
  29 + "permitekml" "sim"
31 30 "convcaracter" ""
32   - "permitekmz" "sim"
  31 + "TEMA" "Biomas shapefile (acentuação)"
33 32 END # METADATA
34 33 NAME "_lbiomashp"
35 34 PROCESSING "ITEMS=CD_LEGENDA"
... ...