Commit d956f69e4246a53b276cb36d1e5ee9af29817e9f

Authored by Edmar Moretti
1 parent ff1f90c0

--no commit message

Showing 2 changed files with 28 additions and 12 deletions   Show diff stats
admin/admin.db
No preview for this file type
classesphp/wmswfs.php
@@ -493,6 +493,7 @@ function listaLayersWMS() @@ -493,6 +493,7 @@ function listaLayersWMS()
493 $handle = fopen ($wms_service_request, "r"); 493 $handle = fopen ($wms_service_request, "r");
494 $wms_capabilities = fread ($handle, filesize ($wms_service_request)); 494 $wms_capabilities = fread ($handle, filesize ($wms_service_request));
495 fclose ($handle); 495 fclose ($handle);
  496 +
496 $dom = new DomDocument(); 497 $dom = new DomDocument();
497 $dom->loadXML($wms_capabilities); 498 $dom->loadXML($wms_capabilities);
498 $xpath = new DOMXPath($dom); 499 $xpath = new DOMXPath($dom);
@@ -505,6 +506,7 @@ function listaLayersWMS() @@ -505,6 +506,7 @@ function listaLayersWMS()
505 $layersanteriores = $xpath->query($q); 506 $layersanteriores = $xpath->query($q);
506 foreach ($layersanteriores as $layeranterior){ 507 foreach ($layersanteriores as $layeranterior){
507 $r1 = pegaTag($layeranterior); 508 $r1 = pegaTag($layeranterior);
  509 + //echo "<pre>";var_dump($layeranterior);
508 if($r1["nome"] == $nomelayer || $r1["titulo"] == $nomelayer) 510 if($r1["nome"] == $nomelayer || $r1["titulo"] == $nomelayer)
509 { 511 {
510 $layers = $xpath->query('Layer',$layeranterior); 512 $layers = $xpath->query('Layer',$layeranterior);
@@ -528,15 +530,27 @@ function listaLayersWMS() @@ -528,15 +530,27 @@ function listaLayersWMS()
528 $q .= "/Layer"; 530 $q .= "/Layer";
529 $layers = $xpath->query($q); 531 $layers = $xpath->query($q);
530 $res = array(); 532 $res = array();
531 - foreach ($layers as $layer)  
532 - { 533 + foreach ($layers as $layer){
533 $r = pegaTag($layer); 534 $r = pegaTag($layer);
534 - //echo $r["nome"]."\n";  
535 - if(!$r["nome"]){$r["nome"] = $r["titulo"];}  
536 - if(array_search("Style",$r["tags"]) || array_search("Layer",$r["tags"]))  
537 - {$res[] = array("nome"=>$r["nome"],"titulo"=>$r["titulo"],"estilos"=>$r["estilos"],"srs"=>wms_srs($dom),"formats"=>wms_formats($dom),"version"=>wms_version($dom),"formatsinfo"=>wms_formatsinfo($dom));} 535 + //var_dump($r);
  536 + if(!$r["nome"]){
  537 + $r["nome"] = $r["titulo"];
  538 + }
  539 + if(array_search("Style",$r["tags"]) || array_search("Layer",$r["tags"])){
  540 + $res[] = array(
  541 + "nome"=>$r["nome"],
  542 + "titulo"=>$r["titulo"],
  543 + "estilos"=>$r["estilos"],
  544 + "srs"=>wms_srs($dom),
  545 + "formats"=>wms_formats($dom),
  546 + "version"=>wms_version($dom),
  547 + "formatsinfo"=>wms_formatsinfo($dom)
  548 +
  549 + );
  550 + }
538 } 551 }
539 } 552 }
  553 + //exit;
540 return($res); 554 return($res);
541 } 555 }
542 556
@@ -571,9 +585,11 @@ function pegaTag($layer) @@ -571,9 +585,11 @@ function pegaTag($layer)
571 { 585 {
572 error_reporting(0); 586 error_reporting(0);
573 $noslayer = $layer->childNodes; 587 $noslayer = $layer->childNodes;
574 - $resultado = array();  
575 - for ($i = 0; $i < $noslayer->length; ++$i)  
576 - { 588 + $resultado = array(
  589 + "estiloas" => array(),
  590 + "tags" => array()
  591 + );
  592 + for ($i = 0; $i < $noslayer->length; ++$i){
577 $tnome = $noslayer->item($i)->tagName; 593 $tnome = $noslayer->item($i)->tagName;
578 $tvalor = $noslayer->item($i)->nodeValue; 594 $tvalor = $noslayer->item($i)->nodeValue;
579 if($tnome){ 595 if($tnome){
@@ -584,8 +600,8 @@ function pegaTag($layer) @@ -584,8 +600,8 @@ function pegaTag($layer)
584 {$resultado["nome"] = $tvalor;} 600 {$resultado["nome"] = $tvalor;}
585 if ($tnome == "Abstract") 601 if ($tnome == "Abstract")
586 {$resultado["resumo"] = $tvalor;} 602 {$resultado["resumo"] = $tvalor;}
587 -  
588 - if ($tnome == "StyleXXXX"){ 603 +
  604 + if ($tnome == "Style"){
589 $ss = $noslayer->item($i)->childNodes; 605 $ss = $noslayer->item($i)->childNodes;
590 $ssl = $ss->length; 606 $ssl = $ss->length;
591 $n = ""; 607 $n = "";
@@ -594,7 +610,7 @@ function pegaTag($layer) @@ -594,7 +610,7 @@ function pegaTag($layer)
594 { 610 {
595 $snome = $ss->item($s)->tagName; 611 $snome = $ss->item($s)->tagName;
596 $svalor = $ss->item($s)->nodeValue; 612 $svalor = $ss->item($s)->nodeValue;
597 - if($snome && $svalor) 613 + if($snome)
598 { 614 {
599 if ($snome == "Title") 615 if ($snome == "Title")
600 {$t=$svalor;} 616 {$t=$svalor;}