$retorno = $m->alteracor($idclasse, $_pg["cor"]); } if ($opcao == "adicionaopacidade") { $retorno = $m->adicionaopacidade(); } if ($opcao == "alterageometria") { $retorno = $m->alterageometria($_pg["tipo"]); } if ($opcao == "adicionaclasse") { $retorno = $m->adicionaclasse(); } if ($opcao == "valorunico") { if (empty($_pg["itemNome"])) { $_pg["itemNome"] = ""; } $retorno = $m->valorunico($_pg["item"], $_pg["ignorar"], $_pg["itemNome"]); } if ($opcao == "intervalosiguais") { $retorno = $m->intervalosiguais($_pg["item"], $_pg["nclasses"], $_pg["ignorar"]); } if ($opcao == "quantil") { $retorno = $m->quantil($_pg["item"], $_pg["nclasses"], $_pg["ignorar"]); } if ($opcao == "quebrasnaturais") { $retorno = $m->quebrasnaturais($_pg["item"], $_pg["nclasses"], $_pg["ignorar"]); } if ($opcao == "metade") { $retorno = $m->metade($_pg["item"], $_pg["itemid"], $_pg["ignorar"]); } if ($opcao == "media") { $retorno = $m->classemedia($_pg["item"], $_pg["ignorar"]);
function autoClassesLayer() { global $codigoMap, $codigoLayer, $locaplic, $dir_tmp, $postgis_mapa; $mapfile = $locaplic . "/temas/" . $codigoMap . ".map"; include_once "{$locaplic}/classesphp/classe_alteraclasse.php"; error_reporting(0); $nometemp = $dir_tmp . "/" . nomerandomico() . ".map"; $versao = versao(); $versao = $versao["principal"]; if ($base == "" || !isset($base)) { $base = ""; if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) { $base = $locaplic . "/aplicmap/geral1windowsv" . $versao . ".map"; } else { if ($base == "" && file_exists('/var/www/i3geo/aplicmap/geral1debianv' . $versao . '.map')) { $base = "/var/www/i3geo/aplicmap/geral1debianv" . $versao . ".map"; } if ($base == "" && file_exists('/var/www/html/i3geo/aplicmap/geral1fedorav' . $versao . '.map')) { $base = "/var/www/html/i3geo/aplicmap/geral1fedorav" . $versao . ".map"; } if ($base == "" && file_exists('/opt/www/html/i3geo/aplicmap/geral1fedorav' . $versao . '.map')) { $base = "/opt/www/html/i3geo/aplicmap/geral1v" . $versao . ".map"; } if ($base == "") { $base = $locaplic . "/aplicmap/geral1v" . $versao . ".map"; } } } else { if (!file_exists($base)) { $base = $locaplic . "/aplicmap/" . $base; } } $mapageral = ms_newMapObj($base); $numlayers = $mapageral->numlayers; for ($i = 0; $i < $numlayers; $i++) { $layertemp = $mapageral->getlayer($i); $layertemp->set("status", MS_DELETE); } $mapatemp = ms_newMapObj($mapfile); $numlayers = $mapatemp->numlayers; for ($i = 0; $i < $numlayers; $i++) { $layertemp = $mapatemp->getlayer($i); //troca string de conexao com alias $lcon = $layertemp->connection; if ($layertemp->connectiontype == MS_POSTGIS) { if (in_array($lcon, array_keys($postgis_mapa))) { $layertemp->set("connection", $postgis_mapa[$lcon]); } } ms_newLayerObj($mapageral, $layertemp); } $mapageral->save($nometemp); $m = new Alteraclasse($nometemp, $codigoLayer); $m->valorunico($_GET["itemExpressao"], "", $_GET["itemNome"]); $m->salva(); $mapatemp = ms_newMapObj($nometemp); $numlayers = $mapatemp->numlayers; for ($i = 0; $i < $numlayers; $i++) { $layertemp = $mapatemp->getlayer($i); //troca string de conexao com alias if ($layertemp->connectiontype == MS_POSTGIS) { $layertemp->set("connection", $lcon); } } $mapatemp->save($mapfile); removeCabecalho($mapfile); }