Commit 455fb4cd097b0c5dafb4a42fdf7d12fa14ef6b24
1 parent
0f05ebd2
Exists in
master
and in
7 other branches
--no commit message
Showing
2 changed files
with
19 additions
and
9 deletions
Show diff stats
classesphp/classe_atributos.php
| @@ -327,7 +327,7 @@ $dadosDaClasse - sim|nao Indica se serão obtidos os dados que descrevem a classe | @@ -327,7 +327,7 @@ $dadosDaClasse - sim|nao Indica se serão obtidos os dados que descrevem a classe | ||
| 327 | error_reporting(0); | 327 | error_reporting(0); |
| 328 | if(!$this->layer){return "erro";} | 328 | if(!$this->layer){return "erro";} |
| 329 | if($this->v < 6) | 329 | if($this->v < 6) |
| 330 | - {$dadosDaClasse="nao";} | 330 | + {$dadosDaClasse="nao";} |
| 331 | $resultadoFinal = array(); | 331 | $resultadoFinal = array(); |
| 332 | if ((!isset($tipolista)) || ($tipolista=="")){$tipolista = "tudo";} | 332 | if ((!isset($tipolista)) || ($tipolista=="")){$tipolista = "tudo";} |
| 333 | if (!isset($inicio)){$inicio = 0;} | 333 | if (!isset($inicio)){$inicio = 0;} |
| @@ -843,8 +843,10 @@ $resolucao - Resolucao de busca. | @@ -843,8 +843,10 @@ $resolucao - Resolucao de busca. | ||
| 843 | $ext - (opcional) Extensão geográfica que será aplicada ao mapa antes da operação de query (xmin ymin xmax ymax) | 843 | $ext - (opcional) Extensão geográfica que será aplicada ao mapa antes da operação de query (xmin ymin xmax ymax) |
| 844 | 844 | ||
| 845 | $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificados - vale apenas se $opcao = lista | 845 | $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificados - vale apenas se $opcao = lista |
| 846 | + | ||
| 847 | +$wkt - (opcional) {boolean} inclui ou não o valor do wkt da geometria | ||
| 846 | */ | 848 | */ |
| 847 | - function identifica2($opcao,$xy,$resolucao,$ext="",$listaDeTemas="") | 849 | + function identifica2($opcao,$xy,$resolucao,$ext="",$listaDeTemas="",$wkt="nao") |
| 848 | { | 850 | { |
| 849 | if($listaDeTemas != "") | 851 | if($listaDeTemas != "") |
| 850 | { | 852 | { |
| @@ -908,14 +910,14 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | @@ -908,14 +910,14 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | ||
| 908 | } | 910 | } |
| 909 | foreach ($listatemas as $tema) | 911 | foreach ($listatemas as $tema) |
| 910 | { | 912 | { |
| 911 | - $resultados[$tema] = $this->identificaQBP2($tema,$xyarray[0],$xyarray[1],"",$resolucao,"","",false,$ext); | 913 | + $resultados[$tema] = $this->identificaQBP2($tema,$xyarray[0],$xyarray[1],"",$resolucao,"","",false,$ext,$wkt); |
| 912 | } | 914 | } |
| 913 | } | 915 | } |
| 914 | //pesquisa todos os temas acrescentados no mapa | 916 | //pesquisa todos os temas acrescentados no mapa |
| 915 | if ($opcao == "todos") | 917 | if ($opcao == "todos") |
| 916 | { | 918 | { |
| 917 | foreach ($listatemas as $tema) | 919 | foreach ($listatemas as $tema) |
| 918 | - {$resultados[$tema] = $this->identificaQBP2($tema,$xyarray[0],$xyarray[1],"",$resolucao,"","",false,$ext);} | 920 | + {$resultados[$tema] = $this->identificaQBP2($tema,$xyarray[0],$xyarray[1],"",$resolucao,"","",false,$ext,$wkt);} |
| 919 | } | 921 | } |
| 920 | //pesquisa apenas os temas visiveis | 922 | //pesquisa apenas os temas visiveis |
| 921 | if ($opcao == "ligados" || $opcao == "lista") | 923 | if ($opcao == "ligados" || $opcao == "lista") |
| @@ -934,7 +936,7 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | @@ -934,7 +936,7 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | ||
| 934 | foreach ($listatemas as $tema) | 936 | foreach ($listatemas as $tema) |
| 935 | { | 937 | { |
| 936 | $l = $this->mapa->getlayerbyname($tema); | 938 | $l = $this->mapa->getlayerbyname($tema); |
| 937 | - $resultados[$tema] = $this->identificaQBP2($tema,$xyarray[0],$xyarray[1],"",$resolucao,"","",false,$ext); | 939 | + $resultados[$tema] = $this->identificaQBP2($tema,$xyarray[0],$xyarray[1],"",$resolucao,"","",false,$ext,$wkt); |
| 938 | } | 940 | } |
| 939 | //var_dump($resultados); | 941 | //var_dump($resultados); |
| 940 | } | 942 | } |
| @@ -950,7 +952,7 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | @@ -950,7 +952,7 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | ||
| 950 | { | 952 | { |
| 951 | if ($tl->status == MS_DEFAULT || $listaDeTemas != "") | 953 | if ($tl->status == MS_DEFAULT || $listaDeTemas != "") |
| 952 | { | 954 | { |
| 953 | - $resultados[$tema] = array("tips"=>$itemtip,"dados"=>$this->identificaQBP2($tema,$xyarray[0],$xyarray[1],"",$resolucao,$itemtip,"",true,$ext)); | 955 | + $resultados[$tema] = array("tips"=>$itemtip,"dados"=>$this->identificaQBP2($tema,$xyarray[0],$xyarray[1],"",$resolucao,$itemtip,"",true,$ext,$wkt)); |
| 954 | $ltemp[] = $tema; | 956 | $ltemp[] = $tema; |
| 955 | } | 957 | } |
| 956 | } | 958 | } |
| @@ -1268,7 +1270,7 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | @@ -1268,7 +1270,7 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | ||
| 1268 | 1270 | ||
| 1269 | $etip {booblean} - indica se a solicitação é para obtenção dos dados do tipo etiqueta | 1271 | $etip {booblean} - indica se a solicitação é para obtenção dos dados do tipo etiqueta |
| 1270 | */ | 1272 | */ |
| 1271 | - function identificaQBP2($tema="",$x=0,$y=0,$map_file="",$resolucao=0,$item="",$tiporetorno="",$etip=false,$ext="") | 1273 | + function identificaQBP2($tema="",$x=0,$y=0,$map_file="",$resolucao=0,$item="",$tiporetorno="",$etip=false,$ext="",$wkt="nao") |
| 1272 | { | 1274 | { |
| 1273 | if($map_file == "") | 1275 | if($map_file == "") |
| 1274 | { | 1276 | { |
| @@ -1300,6 +1302,7 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | @@ -1300,6 +1302,7 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | ||
| 1300 | // | 1302 | // |
| 1301 | if($layer->connectiontype == MS_WMS) | 1303 | if($layer->connectiontype == MS_WMS) |
| 1302 | { | 1304 | { |
| 1305 | + $wkt = "nao"; | ||
| 1303 | $layer->set("toleranceunits",MS_PIXELS); | 1306 | $layer->set("toleranceunits",MS_PIXELS); |
| 1304 | $layer->set("tolerance",$resolucao); | 1307 | $layer->set("tolerance",$resolucao); |
| 1305 | $ptimg = xy2imagem($map_file,array($x,$y)); | 1308 | $ptimg = xy2imagem($map_file,array($x,$y)); |
| @@ -1434,6 +1437,7 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | @@ -1434,6 +1437,7 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | ||
| 1434 | } | 1437 | } |
| 1435 | if(($layer->connectiontype != MS_WMS) && ($layer->type == MS_LAYER_RASTER)) | 1438 | if(($layer->connectiontype != MS_WMS) && ($layer->type == MS_LAYER_RASTER)) |
| 1436 | { | 1439 | { |
| 1440 | + $wkt = "nao"; | ||
| 1437 | $layer->set("toleranceunits",MS_PIXELS); | 1441 | $layer->set("toleranceunits",MS_PIXELS); |
| 1438 | $layer->set("tolerance",$resolucao); | 1442 | $layer->set("tolerance",$resolucao); |
| 1439 | $ident = @$layer->queryByPoint($pt, 0, 0); //0.01); | 1443 | $ident = @$layer->queryByPoint($pt, 0, 0); //0.01); |
| @@ -1513,12 +1517,16 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | @@ -1513,12 +1517,16 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado | ||
| 1513 | $etiqueta = "nao"; | 1517 | $etiqueta = "nao"; |
| 1514 | if(in_array($it,$tips)) | 1518 | if(in_array($it,$tips)) |
| 1515 | {$etiqueta = "sim";} | 1519 | {$etiqueta = "sim";} |
| 1520 | + if($wkt == "sim"){ | ||
| 1521 | + $wkt = $shape->towkt(); | ||
| 1522 | + } | ||
| 1516 | $arraytemp = array( | 1523 | $arraytemp = array( |
| 1517 | "alias"=>$this->converte($itensdesc[$conta]), | 1524 | "alias"=>$this->converte($itensdesc[$conta]), |
| 1518 | "valor"=>$val, | 1525 | "valor"=>$val, |
| 1519 | "link"=>$link, | 1526 | "link"=>$link, |
| 1520 | "img"=>$img, | 1527 | "img"=>$img, |
| 1521 | - "tip"=>$etiqueta | 1528 | + "tip"=>$etiqueta, |
| 1529 | + "wkt"=>$wkt | ||
| 1522 | ); | 1530 | ); |
| 1523 | if($etip==false) | 1531 | if($etip==false) |
| 1524 | {$valori[] = $arraytemp;} | 1532 | {$valori[] = $arraytemp;} |
classesphp/mapa_controle.php
| @@ -2243,8 +2243,10 @@ Identifica elementos no mapa. | @@ -2243,8 +2243,10 @@ Identifica elementos no mapa. | ||
| 2243 | include_once("classe_atributos.php"); | 2243 | include_once("classe_atributos.php"); |
| 2244 | if(!isset($ext)) | 2244 | if(!isset($ext)) |
| 2245 | {$ext = "";} | 2245 | {$ext = "";} |
| 2246 | + if(!isset($wkt)) | ||
| 2247 | + {$wkt = "nao";} | ||
| 2246 | $m = new Atributos($map_file,$tema,"",$ext); | 2248 | $m = new Atributos($map_file,$tema,"",$ext); |
| 2247 | - $retorno = $m->identifica2($opcao,$xy,$resolucao,$ext,$listaDeTemas); | 2249 | + $retorno = $m->identifica2($opcao,$xy,$resolucao,$ext,$listaDeTemas,$wkt); |
| 2248 | break; | 2250 | break; |
| 2249 | /* | 2251 | /* |
| 2250 | Valor: IDENTIFICAUNICO | 2252 | Valor: IDENTIFICAUNICO |