Commit 934d4682bc77a5af28dde15900d75ab7c4c64e49
1 parent
f0a7e609
Exists in
master
and in
7 other branches
Na ferramenta de análise de geometrias, agora é possível ver as imagens em minia…
…tura das geometrias processadas
Showing
4 changed files
with
61 additions
and
5 deletions
Show diff stats
classesphp/classe_analise.php
| @@ -1275,9 +1275,46 @@ $operacao - Tipo de análise. | @@ -1275,9 +1275,46 @@ $operacao - Tipo de análise. | ||
| 1275 | if (count($calculo)>0) | 1275 | if (count($calculo)>0) |
| 1276 | { | 1276 | { |
| 1277 | $final["layer"] = $operacao." ".(implode(" ",$lista)); | 1277 | $final["layer"] = $operacao." ".(implode(" ",$lista)); |
| 1278 | - $final["dados"][] = array("id"=>"0","wkt"=>($calculo[0]["gwkt"]),"valores"=>$valoresoriginais); | 1278 | + $final["dados"][] = array("id"=>"0","wkt"=>($calculo[0]["gwkt"]),"valores"=>$valoresoriginais,"imagem"=>""); |
| 1279 | $nomegeo = $dir.(nomerandomico(10)).".geo"; | 1279 | $nomegeo = $dir.(nomerandomico(10)).".geo"; |
| 1280 | $this->serializeGeo($nomegeo,$final); | 1280 | $this->serializeGeo($nomegeo,$final); |
| 1281 | + $ext = $this->mapa->extent; | ||
| 1282 | + $minx = $ext->minx; | ||
| 1283 | + $miny = $ext->miny; | ||
| 1284 | + $maxx = $ext->maxx; | ||
| 1285 | + $maxy = $ext->maxy; | ||
| 1286 | + $h = $this->mapa->height; | ||
| 1287 | + $w = $this->mapa->width; | ||
| 1288 | + $nomelayer = $this->incmapageometrias($dir_tmp,$imgdir,basename($nomegeo)); | ||
| 1289 | + if ($nomelayer != "erro") | ||
| 1290 | + { | ||
| 1291 | + | ||
| 1292 | + $nlayer = $this->mapa->getlayerbyname($nomelayer); | ||
| 1293 | + $bounds = $nlayer->getExtent(); | ||
| 1294 | + $this->mapa->setsize(30,30); | ||
| 1295 | + $sb = $this->mapa->scalebar; | ||
| 1296 | + $statusoriginal = $sb->status; | ||
| 1297 | + $sb->set("status",MS_OFF); | ||
| 1298 | + | ||
| 1299 | + $ext->setextent(($bounds->minx),($bounds->miny),($bounds->maxx),($bounds->maxy)); | ||
| 1300 | + | ||
| 1301 | + $imgo = $this->mapa->draw(); | ||
| 1302 | + $nomei = ($imgo->imagepath).nomeRandomico().".png"; | ||
| 1303 | + $imgo->saveImage($nomei); | ||
| 1304 | + $nomei = ($imgo->imageurl).basename($nomei); | ||
| 1305 | + $imgo->free(); | ||
| 1306 | + | ||
| 1307 | + $this->mapa->setsize($w,$h); | ||
| 1308 | + $ext->setextent($minx,$miny,$maxx,$maxy); | ||
| 1309 | + | ||
| 1310 | + $nlayer->set("status",MS_DELETE); | ||
| 1311 | + $sb->set("status",$statusoriginal); | ||
| 1312 | + $this->salva(); | ||
| 1313 | + $final = array(); | ||
| 1314 | + $final["layer"] = $operacao." ".(implode(" ",$lista)); | ||
| 1315 | + $final["dados"][] = array("id"=>"0","wkt"=>($calculo[0]["gwkt"]),"valores"=>$valoresoriginais,"imagem"=>$nomei); | ||
| 1316 | + $this->serializeGeo($nomegeo,$final); | ||
| 1317 | + } | ||
| 1281 | } | 1318 | } |
| 1282 | return($nomegeo); | 1319 | return($nomegeo); |
| 1283 | } | 1320 | } |
classesphp/classe_temas.php
| @@ -610,6 +610,11 @@ $nome - nome que será dado a geometria | @@ -610,6 +610,11 @@ $nome - nome que será dado a geometria | ||
| 610 | */ | 610 | */ |
| 611 | function capturaGeometrias($dir_tmp,$imgdir,$nome="") | 611 | function capturaGeometrias($dir_tmp,$imgdir,$nome="") |
| 612 | { | 612 | { |
| 613 | + $this->mapa->setsize(30,30); | ||
| 614 | + $ext = $this->mapa->extent; | ||
| 615 | + $sb = $this->mapa->scalebar; | ||
| 616 | + $sb->set("status",MS_OFF); | ||
| 617 | + | ||
| 613 | if (file_exists($this->arquivo."qy")) | 618 | if (file_exists($this->arquivo."qy")) |
| 614 | {$this->mapa->loadquery(($this->arquivo)."qy");} | 619 | {$this->mapa->loadquery(($this->arquivo)."qy");} |
| 615 | $items = pegaItens($this->layer); | 620 | $items = pegaItens($this->layer); |
| @@ -632,7 +637,19 @@ $nome - nome que será dado a geometria | @@ -632,7 +637,19 @@ $nome - nome que será dado a geometria | ||
| 632 | } | 637 | } |
| 633 | $wktgeo=$shape->toWkt(); | 638 | $wktgeo=$shape->toWkt(); |
| 634 | if ($wktgeo != "") | 639 | if ($wktgeo != "") |
| 635 | - {$registros[] = array("id"=>$i,"wkt"=>$wktgeo,"valores"=>$valitem);} | 640 | + { |
| 641 | + $fechou = $this->layer->close(); | ||
| 642 | + $bounds = $shape->bounds; | ||
| 643 | + //gera imagem | ||
| 644 | + $ext->setextent(($bounds->minx),($bounds->miny),($bounds->maxx),($bounds->maxy)); | ||
| 645 | + $imgo = $this->mapa->draw(); | ||
| 646 | + $nomei = ($imgo->imagepath).nomeRandomico().".png"; | ||
| 647 | + $imgo->saveImage($nomei); | ||
| 648 | + $nomei = ($imgo->imageurl).basename($nomei); | ||
| 649 | + $imgo->free(); | ||
| 650 | + $registros[] = array("id"=>$i,"wkt"=>$wktgeo,"valores"=>$valitem,"imagem"=>$nomei); | ||
| 651 | + $fechou = $this->layer->open(); | ||
| 652 | + } | ||
| 636 | } | 653 | } |
| 637 | $fechou = $this->layer->close(); | 654 | $fechou = $this->layer->close(); |
| 638 | if (count($registros) > 0) | 655 | if (count($registros) > 0) |
| @@ -650,6 +667,7 @@ $nome - nome que será dado a geometria | @@ -650,6 +667,7 @@ $nome - nome que será dado a geometria | ||
| 650 | $r = serialize($final); | 667 | $r = serialize($final); |
| 651 | fwrite($fp,$r); | 668 | fwrite($fp,$r); |
| 652 | fclose($fp); | 669 | fclose($fp); |
| 670 | + | ||
| 653 | } | 671 | } |
| 654 | return("ok"); | 672 | return("ok"); |
| 655 | } | 673 | } |
| @@ -675,7 +693,7 @@ $imgdir - diretório temporário das imagens do mapa atual | @@ -675,7 +693,7 @@ $imgdir - diretório temporário das imagens do mapa atual | ||
| 675 | //var_dump($final); | 693 | //var_dump($final); |
| 676 | $dados = array(); | 694 | $dados = array(); |
| 677 | foreach ($final["dados"] as $d) | 695 | foreach ($final["dados"] as $d) |
| 678 | - {$dados[] = array("id"=>($d["id"]),"valores"=>($d["valores"]));} | 696 | + {$dados[] = array("id"=>($d["id"]),"valores"=>($d["valores"]),"imagem"=>($d["imagem"]));} |
| 679 | $resultado[] = array("arquivo"=>(basename($arquivo)),"layer"=>$final["layer"],"dados"=>$dados); | 697 | $resultado[] = array("arquivo"=>(basename($arquivo)),"layer"=>$final["layer"],"dados"=>$dados); |
| 680 | } | 698 | } |
| 681 | return($resultado); | 699 | return($resultado); |
classesphp/mapa_controle.php
| @@ -205,7 +205,6 @@ Include: | @@ -205,7 +205,6 @@ Include: | ||
| 205 | $m = new Analise($map_file,""); | 205 | $m = new Analise($map_file,""); |
| 206 | $resultado = $m->incmapageometrias($dir_tmp,$imgdir,$lista); | 206 | $resultado = $m->incmapageometrias($dir_tmp,$imgdir,$lista); |
| 207 | $cp->set_data($resultado); | 207 | $cp->set_data($resultado); |
| 208 | - | ||
| 209 | break; | 208 | break; |
| 210 | /* | 209 | /* |
| 211 | Property: funcoesGeometrias | 210 | Property: funcoesGeometrias |
ferramentas/analisageometrias/index.js
| @@ -120,9 +120,12 @@ function montalistageometrias(retorno) | @@ -120,9 +120,12 @@ function montalistageometrias(retorno) | ||
| 120 | for (j=0;j<temp.length; j++) | 120 | for (j=0;j<temp.length; j++) |
| 121 | { | 121 | { |
| 122 | ins += "<tr><td>"+temp[j].id+"</td><td style=text-align:left >" | 122 | ins += "<tr><td>"+temp[j].id+"</td><td style=text-align:left >" |
| 123 | + if (temp[j].imagem != "") | ||
| 124 | + {ins += "<img src='"+temp[j].imagem+"' />"} | ||
| 123 | for (k=0;k<temp[j].valores.length; k++) | 125 | for (k=0;k<temp[j].valores.length; k++) |
| 124 | { | 126 | { |
| 125 | ins += temp[j].valores[k].item+" = "+temp[j].valores[k].valor+"<br>" | 127 | ins += temp[j].valores[k].item+" = "+temp[j].valores[k].valor+"<br>" |
| 128 | + | ||
| 126 | } | 129 | } |
| 127 | ins += "</td></tr>" | 130 | ins += "</td></tr>" |
| 128 | } | 131 | } |
| @@ -157,7 +160,6 @@ function pegaMarcados() | @@ -157,7 +160,6 @@ function pegaMarcados() | ||
| 157 | } | 160 | } |
| 158 | function incmapa() | 161 | function incmapa() |
| 159 | { | 162 | { |
| 160 | - aguarde("block") | ||
| 161 | var lista = pegaMarcados() | 163 | var lista = pegaMarcados() |
| 162 | var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=incmapageometrias&lista="+lista | 164 | var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=incmapageometrias&lista="+lista |
| 163 | var cp = new cpaint(); | 165 | var cp = new cpaint(); |