示例#1
0
 function insereSHPgrafico($x, $y, $itens, $width, $inclinacao, $shadow_height, $ext = "")
 {
     if (!isset($tipo)) {
         $tipo = "pizza";
     }
     //nome do novo tema
     $temaedit = nomeRandomico();
     //pega os valores
     include_once $this->locaplic . "/classesphp/classe_atributos.php";
     $m = new Atributos($this->arquivo, $this->tema);
     $shape = $m->identificaQBP2($this->nome, $x, $y, $this->arquivo, 0, "", "shape", false, $ext);
     if (is_array($shape) && $shape[0] == " ") {
         return "erro.Nenhum valor encontrado";
     } else {
         $shape = $shape[0];
         $itens = explode("*", $itens);
         foreach ($itens as $i) {
             $ii = explode(",", $i);
             $v = $shape->values[$ii[0]];
             if (!is_numeric($v)) {
                 return "erro. Dados nao numericos.";
             }
             $valor[] = $v;
             $cor[] = $ii[1] . "," . $ii[2] . "," . $ii[3];
         }
         $data = implode("*", $valor);
         $cores = implode("*", $cor);
         if ($tipo == "pizza") {
             //gera a figura
             include_once $this->locaplic . "/classesphp/graficopizza.php";
             $res = graficopizza($data, $width, $inclinacao, $shadow_height, $cores, $this->arquivo, $temaedit);
             $img = explode(",", $res);
         }
         //insere simbolo
         $nomes = nomeRandomico();
         $nId = ms_newsymbolobj($this->mapa, $img[0]);
         $oSymbol = $this->mapa->getsymbolobjectbyid($nId);
         $oSymbol->set("inmapfile", MS_TRUE);
         $oSymbol->set("type", MS_SYMBOL_PIXMAP);
         $oSymbol->setimagepath($img[0]);
         $oSymbol->set("name", $nomes);
         $pinlayer = criaLayer($this->mapa, MS_LAYER_POINT, MS_DEFAULT, "Gráfico (" . $temaedit . ")", "SIM");
         $c = $pinlayer->getclass(0);
         $e = $c->getstyle(0);
         $pinlayer->set("name", $temaedit);
         $c->set("name", "");
         if (!isset($tamanho)) {
             $tamanho = 50;
         }
         $e->set("size", $tamanho);
         $e->set("symbolname", $nomes);
         $pinlayer->set("opacity", MS_GD_ALPHA);
         $shp = ms_newshapeobj(MS_SHAPE_POINT);
         $lin = ms_newlineobj();
         $lin->addxy($x, $y);
         $shp->add($lin);
         $pinlayer->addfeature($shp);
         $this->salva();
         return "ok";
     }
 }
示例#2
0
function dadosPerfilRelevo($pontos, $opcao, $amostragem, $item = "", $map_file = "")
{
    $urlGoogle = "http://maps.google.com/maps/api/elevation/json?sensor=false&path=";
    $pontos = str_replace(",", "|", $pontos);
    $pontos = str_replace(" ", ",", $pontos);
    $urlGoogle .= $pontos . "&samples=" . $amostragem;
    $curl = curl_init();
    if (!isset($i3geo_proxy_server)) {
        include dirname(__FILE__) . "/../ms_configura.php";
    }
    curl_setopt($curl, CURLOPT_URL, $urlGoogle);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    if (isset($i3geo_proxy_server) && $i3geo_proxy_server != "") {
        curl_setopt($curl, CURLOPT_PROXY, $i3geo_proxy_server);
    }
    $result = curl_exec($curl);
    curl_close($curl);
    $result = json_decode($result, true);
    if ($opcao != "google") {
        include_once "classe_atributos.php";
        $m = new Atributos($map_file, $opcao);
        $rs = array();
        foreach ($result["results"] as $r) {
            $l = $r["location"];
            $rs[] = $m->identificaQBP2("", $l["lng"], $l["lat"], "", 5, $item, "googlerelevo", $etip = false, $ext = "");
        }
        $result = array("results" => $rs, "status" => "OK");
    }
    return $result;
}