Commit a8169eacb2be1d02f033ba1fffb69455d30e92af
1 parent
0b59c5f8
Exists in
master
and in
7 other branches
Inclusão de download KMZ e servico KMZ em OGC
Showing
7 changed files
with
31 additions
and
20 deletions
Show diff stats
admin/admin.db
No preview for this file type
admin/js/listatemas.js
@@ -2,8 +2,17 @@ function editorTemaMapfile(mapfile) | @@ -2,8 +2,17 @@ function editorTemaMapfile(mapfile) | ||
2 | { | 2 | { |
3 | core_pegaDados("buscando dados...","../php/menutemas.php?funcao=pegaTemaPorMapfile&codigo_tema="+mapfile,"montaEditorTema"); | 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 | function on_editorCheckBoxChange(p_oEvent) | 16 | function on_editorCheckBoxChange(p_oEvent) |
8 | { | 17 | { |
9 | var temp; | 18 | var temp; |
@@ -53,6 +62,7 @@ function montaEditorTema(dados) | @@ -53,6 +62,7 @@ function montaEditorTema(dados) | ||
53 | //preenche a div com a lista de tags | 62 | //preenche a div com a lista de tags |
54 | // | 63 | // |
55 | core_comboTags("comboTags","tags_tema","registraTagTema"); | 64 | core_comboTags("comboTags","tags_tema","registraTagTema"); |
65 | + */ | ||
56 | } | 66 | } |
57 | function registraTagTema(valor) | 67 | function registraTagTema(valor) |
58 | { | 68 | { |
@@ -99,15 +109,15 @@ function montaDivTemas(i) | @@ -99,15 +109,15 @@ function montaDivTemas(i) | ||
99 | ins += "<select id='ogc_tema' >"; | 109 | ins += "<select id='ogc_tema' >"; |
100 | ins += core_combosimnao(i.ogc_tema); | 110 | ins += core_combosimnao(i.ogc_tema); |
101 | ins += "</select></p>"; | 111 | ins += "</select></p>"; |
102 | - ins += "<p>Permite o download na aplicação datadownload.htm? (nã afeta temas do tipo gvSIG) (não afeta a permissão de download definida no item 'disponibilidade' existente em cada layer)<br>"; | 112 | + ins += "<p>Permite o download na aplicação datadownload.htm? (não afeta temas do tipo gvSIG) (não afeta a permissão de download definida no item 'disponibilidade' existente em cada layer)<br>"; |
103 | ins += "<select id='download_tema' >"; | 113 | ins += "<select id='download_tema' >"; |
104 | ins += core_combosimnao(i.download_tema); | 114 | ins += core_combosimnao(i.download_tema); |
105 | ins += "</select></p>"; | 115 | ins += "</select></p>"; |
106 | - ins += "<p>Permite acesso via kml? (nã restringe em temas do tipo gvSIG)<br>"; | 116 | + ins += "<p>Permite acesso via kml? (não restringe em temas do tipo gvSIG)<br>"; |
107 | ins += "<select id='kml_tema' >"; | 117 | ins += "<select id='kml_tema' >"; |
108 | ins += core_combosimnao(i.kml_tema); | 118 | ins += core_combosimnao(i.kml_tema); |
109 | ins += "</select></p>"; | 119 | ins += "</select></p>"; |
110 | - ins += "<p>Permite acesso via kmz (kml com dados vetoriais)? (nã restringe em temas do tipo gvSIG)<br>"; | 120 | + ins += "<p>Permite acesso via kmz (kml com dados vetoriais)? (não restringe em temas do tipo gvSIG)<br>"; |
111 | ins += "<select id='kmz_tema' >"; | 121 | ins += "<select id='kmz_tema' >"; |
112 | ins += core_combosimnao(i.kmz_tema); | 122 | ins += core_combosimnao(i.kmz_tema); |
113 | ins += "</select></p>"; | 123 | ins += "</select></p>"; |
@@ -188,8 +198,9 @@ function gravaDadosTema(id) | @@ -188,8 +198,9 @@ function gravaDadosTema(id) | ||
188 | //myDataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText)[0]) | 198 | //myDataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText)[0]) |
189 | core_carregando("desativa"); | 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 | catch(e){core_handleFailure(e,o.responseText);} | 205 | catch(e){core_handleFailure(e,o.responseText);} |
195 | }, | 206 | }, |
classesjs/datadownload.js
@@ -274,7 +274,7 @@ function datadownload_download(obj) | @@ -274,7 +274,7 @@ function datadownload_download(obj) | ||
274 | }; | 274 | }; |
275 | YAHOO.datadownloadLista.panel.setBody($trad("d28")); | 275 | YAHOO.datadownloadLista.panel.setBody($trad("d28")); |
276 | YAHOO.datadownloadLista.panel.show(); | 276 | YAHOO.datadownloadLista.panel.show(); |
277 | - YAHOO.datadownloadLista.panel.cfg.setProperty("y", 100); | 277 | + YAHOO.datadownloadLista.panel.cfg.setProperty("y", 100); |
278 | //document.getElementById("corpo").innerHTML = "Aguarde. Gerando arquivos..." | 278 | //document.getElementById("corpo").innerHTML = "Aguarde. Gerando arquivos..." |
279 | var p = g_locaplic+"/classesphp/mapa_controle.php?map_file=&funcao=download3&tema="+obj.title; | 279 | var p = g_locaplic+"/classesphp/mapa_controle.php?map_file=&funcao=download3&tema="+obj.title; |
280 | //caso a camada venha do sistema de metadados estatisticos e seja uma variavel | 280 | //caso a camada venha do sistema de metadados estatisticos e seja uma variavel |
@@ -315,7 +315,8 @@ function mostraDownload(retorno) | @@ -315,7 +315,8 @@ function mostraDownload(retorno) | ||
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>"; | 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 | 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>"; | 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 | 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>"; | 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 | for (var arq=0;arq<n;arq++) | 320 | for (var arq=0;arq<n;arq++) |
320 | { | 321 | { |
321 | ins += "<a href='"+window.location.protocol+"//"+window.location.host+"/"+arqs[arq]+"'>"+arqs[arq]+"</a><br>"; | 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&ccedil;o do webservice do tema escolhido | @@ -70,7 +70,7 @@ Gera o endere&ccedil;o do webservice do tema escolhido | ||
70 | 70 | ||
71 | Parameters: | 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 | function ogc_endereco(botao) | 75 | function ogc_endereco(botao) |
76 | { | 76 | { |
@@ -97,6 +97,7 @@ function ogc_endereco(botao) | @@ -97,6 +97,7 @@ function ogc_endereco(botao) | ||
97 | ins += "<p><a target=blank href='"+servico+"&format=application/openlayers&bbox=-76.5125927,-39.3925675209,-29.5851853,9.49014852081' />visualizar com openLayers</a>"; | 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 | 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>"; | 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 | 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>"; | 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 | if(!$i("panellistaarquivos")){ | 102 | if(!$i("panellistaarquivos")){ |
102 | YAHOO.namespace("datadownloadLista"); | 103 | YAHOO.namespace("datadownloadLista"); |
ogc.php
@@ -86,7 +86,6 @@ include(dirname(__FILE__)."/ms_configura.php"); | @@ -86,7 +86,6 @@ 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 | 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"){ | 89 | if(strtolower($OUTPUTFORMAT) == "kml" || strtolower($OUTPUTFORMAT) == "kmz"){ |
91 | //http://localhost/i3geo/pacotes/kmlmapserver/kmlservice.php?request=kmz&map=_lbiomashp&typename=_lbiomashp | 90 | //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; | 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,7 +435,7 @@ class LayerServer { | ||
435 | */ | 435 | */ |
436 | function process_shape(&$layer, &$shape, &$class_list, &$folder, &$namecol){ | 436 | function process_shape(&$layer, &$shape, &$class_list, &$folder, &$namecol){ |
437 | $permite = $layer->getmetadata("permitekmz"); | 437 | $permite = $layer->getmetadata("permitekmz"); |
438 | - if($permite == "nao"){return;} | 438 | + if(strtolower($permite) == "nao"){return;} |
439 | $itens = $layer->getmetadata("itens"); | 439 | $itens = $layer->getmetadata("itens"); |
440 | $itensdesc = $layer->getmetadata("itensdesc"); | 440 | $itensdesc = $layer->getmetadata("itensdesc"); |
441 | $shape->project($this->in_proj, $this->out_proj); | 441 | $shape->project($this->in_proj, $this->out_proj); |
temas/_lbiomashp.map
@@ -6,30 +6,29 @@ MAP | @@ -6,30 +6,29 @@ MAP | ||
6 | DATA "/var/www/i3geo/aplicmap/dados/biomas.shp" | 6 | DATA "/var/www/i3geo/aplicmap/dados/biomas.shp" |
7 | METADATA | 7 | METADATA |
8 | "METAESTAT_ID_MEDIDA_VARIAVEL" "" | 8 | "METAESTAT_ID_MEDIDA_VARIAVEL" "" |
9 | - "cache" "" | ||
10 | "TIP" "CD_LEGENDA" | 9 | "TIP" "CD_LEGENDA" |
11 | - "olopacity" "" | 10 | + "cache" "" |
12 | "CLASSE" "SIM" | 11 | "CLASSE" "SIM" |
12 | + "olopacity" "" | ||
13 | "permitekmz" "nao" | 13 | "permitekmz" "nao" |
14 | "gmopacity" "" | 14 | "gmopacity" "" |
15 | "gmstatus" "" | 15 | "gmstatus" "" |
16 | "ITENSDESC" "Teste de acentuação" | 16 | "ITENSDESC" "Teste de acentuação" |
17 | "METAESTAT_CODIGO_TIPO_REGIAO" "" | 17 | "METAESTAT_CODIGO_TIPO_REGIAO" "" |
18 | "arquivotemaoriginal" "" | 18 | "arquivotemaoriginal" "" |
19 | - "olstatus" "" | ||
20 | "nomeoriginal" "" | 19 | "nomeoriginal" "" |
20 | + "olstatus" "" | ||
21 | "permitedownload" "sim" | 21 | "permitedownload" "sim" |
22 | "metaestat" "" | 22 | "metaestat" "" |
23 | "download" "SIM" | 23 | "download" "SIM" |
24 | "itembuscarapida" "" | 24 | "itembuscarapida" "" |
25 | - "arquivokmz" "" | ||
26 | - "arquivodownload" "" | ||
27 | "ITENS" "CD_LEGENDA" | 25 | "ITENS" "CD_LEGENDA" |
28 | - "permitekml" "sim" | 26 | + "arquivodownload" "" |
27 | + "arquivokmz" "" | ||
29 | "permiteogc" "sim" | 28 | "permiteogc" "sim" |
30 | - "TEMA" "Biomas shapefile (acentuação)" | 29 | + "permitekml" "sim" |
31 | "convcaracter" "" | 30 | "convcaracter" "" |
32 | - "permitekmz" "sim" | 31 | + "TEMA" "Biomas shapefile (acentuação)" |
33 | END # METADATA | 32 | END # METADATA |
34 | NAME "_lbiomashp" | 33 | NAME "_lbiomashp" |
35 | PROCESSING "ITEMS=CD_LEGENDA" | 34 | PROCESSING "ITEMS=CD_LEGENDA" |