Ejemplo n.º 1
0
 } else {
     //remove o nome do caminho
     $novo = explode("/", $_pg["arq"]);
     $novo[0] = "";
     $_pg["arq"] = implode("/", $novo);
     //
     include dirname(__FILE__) . "/../ms_configura.php";
     $d = $navegadoresLocais[0]["drives"];
     $p = "";
     foreach ($d as $n) {
         if ($n["nome"] == $nome) {
             $p = $n["caminho"];
         }
     }
     if ($p != "" && file_exists($p)) {
         $retorno = $m->adicionaTemaSHP($p . "/" . $_pg["arq"]);
         if ($retorno != "erro") {
             $m->salva();
             $_SESSION["contadorsalva"]++;
             redesenhaMapa();
         } else {
             $retorno = "erro.Nenhum dado espacializado foi encontrado.";
         }
     } else {
         $retorno = "erro";
     }
 }
 break;
 /*
  Valor: ADICIONATEMAIMG
 
Ejemplo n.º 2
0
 $yaml = str_replace('"', "", $yaml);
 $yaml = trim($yaml) . "\n";
 $yaml = str_replace('|-', "", $yaml);
 $yaml = str_replace('|2-', "", $yaml);
 //salva o arquivo com os parametros
 $fp = fopen($y, "w");
 fwrite($fp, $yaml);
 fclose($fp);
 //executa os calculos
 exec(dirname(__FILE__) . "/better_path.py {$y}");
 //adiciona ao mapa atual os shapefiles criados
 include_once "../../classesphp/classe_mapa.php";
 $m = new Mapa($map_file);
 if (file_exists($pathresult . "/" . $prefixo . "_best_path.shp")) {
     //adiciona ao mapa best_path
     $retorno = $m->adicionaTemaSHP($pathresult . "/" . $prefixo . "_best_path.shp");
     $layer = $m->mapa->getlayerbyname($prefixo . "_best_path.shp");
     $layer->setmetadata("TEMA", "Melhor caminho {$prefixo}");
     $layer->setmetadata("DOWNLOAD", "SIM");
     $layer->setmetadata("TEMALOCAL", "SIM");
     $classe = $layer->getclass(0);
     $estilo = $classe->getstyle(0);
     $cor = $estilo->color;
     $cor->setRGB(255, 0, 0);
 }
 if (file_exists($pathresult . "/" . $prefixo . "_cartesian_straight_line_cost.shp")) {
     //cartesian_straight_line_cost
     $retorno = $m->adicionaTemaSHP($pathresult . "/" . $prefixo . "_cartesian_straight_line_cost.shp");
     $layer = $m->mapa->getlayerbyname($prefixo . "_cartesian_straight_line_cost.shp");
     $layer->setmetadata("TEMA", "Linha reta entre os pontos A e B {$prefixo}");
     $layer->setmetadata("DOWNLOAD", "SIM");