Commit 54c560d6a4ba18ede2193fe51d62ff76616804e4
1 parent
473cd8de
Exists in
master
and in
7 other branches
reformulação dos códigos para uso da extensão .qy nos arquivos de seleção ao inv…
…és de .mapqy. Isso foi necessário por questões de compatibilidade entre versões do Mapserver.
Showing
9 changed files
with
150 additions
and
111 deletions
Show diff stats
classesphp/classe_analise.php
@@ -67,6 +67,12 @@ class Analise | @@ -67,6 +67,12 @@ class Analise | ||
67 | Diretório do arquivo map_file | 67 | Diretório do arquivo map_file |
68 | */ | 68 | */ |
69 | protected $diretorio; | 69 | protected $diretorio; |
70 | + /* | ||
71 | + Variavel: $qyfile | ||
72 | + | ||
73 | + Nome do arquivo de seleção (.qy) | ||
74 | + */ | ||
75 | + public $qyfile; | ||
70 | /* | 76 | /* |
71 | Function: __construct | 77 | Function: __construct |
72 | 78 | ||
@@ -81,6 +87,7 @@ $tema - Nome do tema que será processado | @@ -81,6 +87,7 @@ $tema - Nome do tema que será processado | ||
81 | function __construct($map_file,$tema="",$locaplic="") | 87 | function __construct($map_file,$tema="",$locaplic="") |
82 | { | 88 | { |
83 | //error_reporting(E_ALL); | 89 | //error_reporting(E_ALL); |
90 | + $this->qyfile = str_replace(".map",".qy",$map_file); | ||
84 | if(file_exists($locaplic."/funcoes_gerais.php")) | 91 | if(file_exists($locaplic."/funcoes_gerais.php")) |
85 | include_once($locaplic."/funcoes_gerais.php"); | 92 | include_once($locaplic."/funcoes_gerais.php"); |
86 | else | 93 | else |
@@ -165,8 +172,8 @@ Include: | @@ -165,8 +172,8 @@ Include: | ||
165 | $this->mapaDeldir($nomearq,$dir_tmp,$R_path,$locaplic); | 172 | $this->mapaDeldir($nomearq,$dir_tmp,$R_path,$locaplic); |
166 | $this->deldirDir2shp($nomearq."dirsgs",$dir_tmp,$locaplic); | 173 | $this->deldirDir2shp($nomearq."dirsgs",$dir_tmp,$locaplic); |
167 | $this->deldirDel2shp($nomearq."delsgs",$dir_tmp,$locaplic); | 174 | $this->deldirDel2shp($nomearq."delsgs",$dir_tmp,$locaplic); |
168 | - if(file_exists(($this->arquivo)."qy")) | ||
169 | - {unlink(($this->arquivo)."qy");} | 175 | + if(file_exists($this->qyfile)) |
176 | + {unlink($this->qyfile);} | ||
170 | return "ok"; | 177 | return "ok"; |
171 | break; | 178 | break; |
172 | case "kernel": | 179 | case "kernel": |
@@ -240,8 +247,8 @@ Include: | @@ -240,8 +247,8 @@ Include: | ||
240 | } | 247 | } |
241 | else | 248 | else |
242 | {return("erro");} | 249 | {return("erro");} |
243 | - if(file_exists(($this->arquivo)."qy")) | ||
244 | - {unlink(($this->arquivo)."qy");} | 250 | + if(file_exists($this->qyfile)) |
251 | + {unlink($this->qyfile);} | ||
245 | return("ok"); | 252 | return("ok"); |
246 | } | 253 | } |
247 | /* | 254 | /* |
@@ -947,8 +954,8 @@ $locaplic - Localização do I3geo. | @@ -947,8 +954,8 @@ $locaplic - Localização do I3geo. | ||
947 | //pega os shapes selecionados | 954 | //pega os shapes selecionados |
948 | $itemspt = pegaItens($layerPt); | 955 | $itemspt = pegaItens($layerPt); |
949 | $existesel = "nao"; | 956 | $existesel = "nao"; |
950 | - if (file_exists(($this->arquivo)."qy")) | ||
951 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 957 | + if (file_exists($this->qyfile)) |
958 | + {$this->mapa->loadquery($this->qyfile);} | ||
952 | if ($layerPt->getNumresults() > 0){$existesel = "sim";} | 959 | if ($layerPt->getNumresults() > 0){$existesel = "sim";} |
953 | if ($existesel == "nao") | 960 | if ($existesel == "nao") |
954 | { | 961 | { |
@@ -1057,8 +1064,8 @@ $locaplic - Localização do I3geo. | @@ -1057,8 +1064,8 @@ $locaplic - Localização do I3geo. | ||
1057 | $novolayer->setmetadata("ITENS"," "); | 1064 | $novolayer->setmetadata("ITENS"," "); |
1058 | $novolayer->setmetadata("ITENSDESC"," "); | 1065 | $novolayer->setmetadata("ITENSDESC"," "); |
1059 | $novolayer->set("connectiontype",MS_SHAPEFILE); | 1066 | $novolayer->set("connectiontype",MS_SHAPEFILE); |
1060 | - if (file_exists(($this->arquivo)."qy")) | ||
1061 | - {unlink (($this->arquivo)."qy");} | 1067 | + if (file_exists($this->qyfile)) |
1068 | + {unlink ($this->qyfile);} | ||
1062 | return(implode(" ",$nomesitens)); | 1069 | return(implode(" ",$nomesitens)); |
1063 | } | 1070 | } |
1064 | /* | 1071 | /* |
@@ -1094,8 +1101,8 @@ function distanciaptpt($temaorigem,$temadestino,$temaoverlay,$locaplic,$itemorig | @@ -1094,8 +1101,8 @@ function distanciaptpt($temaorigem,$temadestino,$temaoverlay,$locaplic,$itemorig | ||
1094 | //define o nome do novo shapefile que será criado | 1101 | //define o nome do novo shapefile que será criado |
1095 | $nomefinal = nomeRandomico(); | 1102 | $nomefinal = nomeRandomico(); |
1096 | $nomeshp = $this->diretorio."/".$nomefinal; | 1103 | $nomeshp = $this->diretorio."/".$nomefinal; |
1097 | - if (file_exists(($this->arquivo)."qy")) | ||
1098 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 1104 | + if (file_exists($this->qyfile)) |
1105 | + {$this->mapa->loadquery($this->qyfile);} | ||
1099 | else | 1106 | else |
1100 | {return "errox";} | 1107 | {return "errox";} |
1101 | $layerorigem = $this->mapa->getlayerbyname($temaorigem); | 1108 | $layerorigem = $this->mapa->getlayerbyname($temaorigem); |
@@ -1183,8 +1190,8 @@ function distanciaptpt($temaorigem,$temadestino,$temaoverlay,$locaplic,$itemorig | @@ -1183,8 +1190,8 @@ function distanciaptpt($temaorigem,$temadestino,$temaoverlay,$locaplic,$itemorig | ||
1183 | $cor = $estilo->color; | 1190 | $cor = $estilo->color; |
1184 | $cor->setrgb(255,210,0); | 1191 | $cor->setrgb(255,210,0); |
1185 | //limpa selecao | 1192 | //limpa selecao |
1186 | - if (file_exists(($this->arquivo)."qy")) | ||
1187 | - {unlink (($this->arquivo)."qy");} | 1193 | + if (file_exists($this->qyfile)) |
1194 | + {unlink ($this->qyfile);} | ||
1188 | return($nomeshp.".shp"); | 1195 | return($nomeshp.".shp"); |
1189 | } | 1196 | } |
1190 | /* | 1197 | /* |
@@ -1218,8 +1225,8 @@ nome do layer criado com o buffer. | @@ -1218,8 +1225,8 @@ nome do layer criado com o buffer. | ||
1218 | $nomebuffer = nomeRandomico(); | 1225 | $nomebuffer = nomeRandomico(); |
1219 | $nomeshp = $this->diretorio."/".$nomebuffer; | 1226 | $nomeshp = $this->diretorio."/".$nomebuffer; |
1220 | //pega os shapes selecionados | 1227 | //pega os shapes selecionados |
1221 | - if (file_exists(($this->arquivo)."qy")) | ||
1222 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 1228 | + if (file_exists($this->qyfile)) |
1229 | + {$this->mapa->loadquery($this->qyfile);} | ||
1223 | $sopen = $this->layer->open(); | 1230 | $sopen = $this->layer->open(); |
1224 | if($sopen == MS_FAILURE){return "erro";} | 1231 | if($sopen == MS_FAILURE){return "erro";} |
1225 | $items = pegaItens($this->layer); | 1232 | $items = pegaItens($this->layer); |
@@ -1330,8 +1337,8 @@ $locaplic - Localização do I3geo. | @@ -1330,8 +1337,8 @@ $locaplic - Localização do I3geo. | ||
1330 | $nomeCentroides = nomeRandomico(); | 1337 | $nomeCentroides = nomeRandomico(); |
1331 | $nomeshp = $this->diretorio."/".$nomeCentroides; | 1338 | $nomeshp = $this->diretorio."/".$nomeCentroides; |
1332 | //pega os shapes selecionados | 1339 | //pega os shapes selecionados |
1333 | - if (file_exists(($this->arquivo)."qy")) | ||
1334 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 1340 | + if (file_exists($this->qyfile)) |
1341 | + {$this->mapa->loadquery($this->qyfile);} | ||
1335 | $sopen = $this->layer->open(); | 1342 | $sopen = $this->layer->open(); |
1336 | if($sopen == MS_FAILURE){return "erro";} | 1343 | if($sopen == MS_FAILURE){return "erro";} |
1337 | $items = pegaItens($this->layer); | 1344 | $items = pegaItens($this->layer); |
@@ -1389,8 +1396,8 @@ $locaplic - Localização do I3geo. | @@ -1389,8 +1396,8 @@ $locaplic - Localização do I3geo. | ||
1389 | $novolayer->set("template","none.htm"); | 1396 | $novolayer->set("template","none.htm"); |
1390 | $novolayer->setmetadata("TEMALOCAL","SIM"); | 1397 | $novolayer->setmetadata("TEMALOCAL","SIM"); |
1391 | //limpa selecao | 1398 | //limpa selecao |
1392 | - if (file_exists(($this->arquivo)."qy")) | ||
1393 | - {unlink (($this->arquivo)."qy");} | 1399 | + if (file_exists($this->qyfile)) |
1400 | + {unlink ($this->qyfile);} | ||
1394 | return("ok"); | 1401 | return("ok"); |
1395 | } | 1402 | } |
1396 | /* | 1403 | /* |
@@ -1503,8 +1510,8 @@ $npty - Número de pontos em Y (opcional) | @@ -1503,8 +1510,8 @@ $npty - Número de pontos em Y (opcional) | ||
1503 | $novolayer->set("data",$nomeshp.".shp"); | 1510 | $novolayer->set("data",$nomeshp.".shp"); |
1504 | $novolayer->setmetadata("DOWNLOAD","SIM"); | 1511 | $novolayer->setmetadata("DOWNLOAD","SIM"); |
1505 | $novolayer->setmetadata("TEMALOCAL","SIM"); | 1512 | $novolayer->setmetadata("TEMALOCAL","SIM"); |
1506 | - if (file_exists(($this->arquivo)."qy")) | ||
1507 | - {unlink (($this->arquivo)."qy");} | 1513 | + if (file_exists($this->qyfile)) |
1514 | + {unlink ($this->qyfile);} | ||
1508 | return("ok"); | 1515 | return("ok"); |
1509 | } | 1516 | } |
1510 | /* | 1517 | /* |
@@ -1646,8 +1653,8 @@ $npty - Número de pontos em Y (opcional) | @@ -1646,8 +1653,8 @@ $npty - Número de pontos em Y (opcional) | ||
1646 | $novolayer->setmetadata("DOWNLOAD","SIM"); | 1653 | $novolayer->setmetadata("DOWNLOAD","SIM"); |
1647 | $novolayer->setmetadata("TEMALOCAL","SIM"); | 1654 | $novolayer->setmetadata("TEMALOCAL","SIM"); |
1648 | $novolayer->set("opacity","50"); | 1655 | $novolayer->set("opacity","50"); |
1649 | - if (file_exists(($this->arquivo)."qy")) | ||
1650 | - {unlink (($this->arquivo)."qy");} | 1656 | + if (file_exists($this->qyfile)) |
1657 | + {unlink ($this->qyfile);} | ||
1651 | return("ok"); | 1658 | return("ok"); |
1652 | } | 1659 | } |
1653 | /* | 1660 | /* |
@@ -1799,8 +1806,8 @@ $npty - Número de pontos em Y (opcional) | @@ -1799,8 +1806,8 @@ $npty - Número de pontos em Y (opcional) | ||
1799 | $novolayer->setmetadata("DOWNLOAD","SIM"); | 1806 | $novolayer->setmetadata("DOWNLOAD","SIM"); |
1800 | $novolayer->setmetadata("TEMALOCAL","SIM"); | 1807 | $novolayer->setmetadata("TEMALOCAL","SIM"); |
1801 | $novolayer->set("opacity","50"); | 1808 | $novolayer->set("opacity","50"); |
1802 | - if (file_exists(($this->arquivo)."qy")) | ||
1803 | - {unlink (($this->arquivo)."qy");} | 1809 | + if (file_exists($this->qyfile)) |
1810 | + {unlink ($this->qyfile);} | ||
1804 | return("ok"); | 1811 | return("ok"); |
1805 | } | 1812 | } |
1806 | /* | 1813 | /* |
@@ -1868,8 +1875,8 @@ $locaplic - Localização do I3geo | @@ -1868,8 +1875,8 @@ $locaplic - Localização do I3geo | ||
1868 | $novolayer->setmetadata("DOWNLOAD","SIM"); | 1875 | $novolayer->setmetadata("DOWNLOAD","SIM"); |
1869 | $novolayer->setmetadata("TEMALOCAL","SIM"); | 1876 | $novolayer->setmetadata("TEMALOCAL","SIM"); |
1870 | $novolayer->set("opacity","80"); | 1877 | $novolayer->set("opacity","80"); |
1871 | - if (file_exists(($this->arquivo)."qy")) | ||
1872 | - {unlink (($this->arquivo)."qy");} | 1878 | + if (file_exists($this->qyfile)) |
1879 | + {unlink ($this->qyfile);} | ||
1873 | return("ok"); | 1880 | return("ok"); |
1874 | } | 1881 | } |
1875 | /* | 1882 | /* |
@@ -1890,8 +1897,8 @@ Salva o mapa acrescentando um novo layer com o resultado. | @@ -1890,8 +1897,8 @@ Salva o mapa acrescentando um novo layer com o resultado. | ||
1890 | else | 1897 | else |
1891 | include_once "../pacotes/phpxbase/api_conversion.php"; | 1898 | include_once "../pacotes/phpxbase/api_conversion.php"; |
1892 | //define o nome do novo shapefile que será criado | 1899 | //define o nome do novo shapefile que será criado |
1893 | - if (file_exists(($this->arquivo)."qy")) | ||
1894 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 1900 | + if (file_exists($this->qyfile)) |
1901 | + {$this->mapa->loadquery($this->qyfile);} | ||
1895 | $sopen = $this->layer->open(); | 1902 | $sopen = $this->layer->open(); |
1896 | if($sopen == MS_FAILURE){return "erro";} | 1903 | if($sopen == MS_FAILURE){return "erro";} |
1897 | $res_count = $this->layer->getNumresults(); | 1904 | $res_count = $this->layer->getNumresults(); |
@@ -1982,8 +1989,8 @@ Salva o mapa acrescentando um novo layer com o resultado. | @@ -1982,8 +1989,8 @@ Salva o mapa acrescentando um novo layer com o resultado. | ||
1982 | $novolayer->set("data",$nomeshp.".shp"); | 1989 | $novolayer->set("data",$nomeshp.".shp"); |
1983 | $novolayer->setmetadata("DOWNLOAD","SIM"); | 1990 | $novolayer->setmetadata("DOWNLOAD","SIM"); |
1984 | $novolayer->setmetadata("TEMALOCAL","SIM"); | 1991 | $novolayer->setmetadata("TEMALOCAL","SIM"); |
1985 | - if (file_exists(($this->arquivo)."qy")) | ||
1986 | - {unlink (($this->arquivo)."qy");} | 1992 | + if (file_exists($this->qyfile)) |
1993 | + {unlink ($this->qyfile);} | ||
1987 | 1994 | ||
1988 | return("ok"); | 1995 | return("ok"); |
1989 | } | 1996 | } |
@@ -2010,8 +2017,8 @@ $locaplic - Localização do I3geo | @@ -2010,8 +2017,8 @@ $locaplic - Localização do I3geo | ||
2010 | else | 2017 | else |
2011 | include_once "../pacotes/phpxbase/api_conversion.php"; | 2018 | include_once "../pacotes/phpxbase/api_conversion.php"; |
2012 | //define o nome do novo shapefile que será criado | 2019 | //define o nome do novo shapefile que será criado |
2013 | - if (file_exists(($this->arquivo)."qy")) | ||
2014 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 2020 | + if (file_exists($this->qyfile)) |
2021 | + {$this->mapa->loadquery($this->qyfile);} | ||
2015 | $sopen = $this->layer->open(); | 2022 | $sopen = $this->layer->open(); |
2016 | if($sopen == MS_FAILURE){return "erro";} | 2023 | if($sopen == MS_FAILURE){return "erro";} |
2017 | $res_count = $this->layer->getNumresults(); | 2024 | $res_count = $this->layer->getNumresults(); |
@@ -2091,8 +2098,8 @@ $locaplic - Localização do I3geo | @@ -2091,8 +2098,8 @@ $locaplic - Localização do I3geo | ||
2091 | $novolayer->set("data",$nomeshp.".shp"); | 2098 | $novolayer->set("data",$nomeshp.".shp"); |
2092 | $novolayer->setmetadata("DOWNLOAD","SIM"); | 2099 | $novolayer->setmetadata("DOWNLOAD","SIM"); |
2093 | $novolayer->setmetadata("TEMALOCAL","SIM"); | 2100 | $novolayer->setmetadata("TEMALOCAL","SIM"); |
2094 | - if (file_exists(($this->arquivo)."qy")) | ||
2095 | - {unlink (($this->arquivo)."qy");} | 2101 | + if (file_exists($this->qyfile)) |
2102 | + {unlink ($this->qyfile);} | ||
2096 | 2103 | ||
2097 | return("ok"); | 2104 | return("ok"); |
2098 | } | 2105 | } |
@@ -2405,8 +2412,8 @@ function gravaCoordenadasPt($tema,$limitepontos="TRUE",$extendelimite) | @@ -2405,8 +2412,8 @@ function gravaCoordenadasPt($tema,$limitepontos="TRUE",$extendelimite) | ||
2405 | $nomearq = $this->diretorio."/".$nomefinal; | 2412 | $nomearq = $this->diretorio."/".$nomefinal; |
2406 | $itemspt = pegaItens($layerPt); | 2413 | $itemspt = pegaItens($layerPt); |
2407 | $existesel = "nao"; | 2414 | $existesel = "nao"; |
2408 | - if (file_exists(($this->arquivo)."qy")) | ||
2409 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 2415 | + if (file_exists($this->qyfile)) |
2416 | + {$this->mapa->loadquery($this->qyfile);} | ||
2410 | if ($layerPt->getNumresults() > 0){$existesel = "sim";} | 2417 | if ($layerPt->getNumresults() > 0){$existesel = "sim";} |
2411 | if ($existesel == "nao") | 2418 | if ($existesel == "nao") |
2412 | {$layerPt->queryByrect($this->mapa->extent);} | 2419 | {$layerPt->queryByrect($this->mapa->extent);} |
classesphp/classe_atributos.php
@@ -63,6 +63,12 @@ class Atributos | @@ -63,6 +63,12 @@ class Atributos | ||
63 | Nome do layer | 63 | Nome do layer |
64 | */ | 64 | */ |
65 | protected $nome; | 65 | protected $nome; |
66 | + /* | ||
67 | + Variavel: $qyfile | ||
68 | + | ||
69 | + Nome do arquivo de seleção (.qy) | ||
70 | + */ | ||
71 | + public $qyfile; | ||
66 | /* | 72 | /* |
67 | Function: __construct | 73 | Function: __construct |
68 | 74 | ||
@@ -77,6 +83,7 @@ $tema - nome do tema | @@ -77,6 +83,7 @@ $tema - nome do tema | ||
77 | function __construct($map_file,$tema="",$locaplic="") | 83 | function __construct($map_file,$tema="",$locaplic="") |
78 | { | 84 | { |
79 | //error_reporting(E_ALL); | 85 | //error_reporting(E_ALL); |
86 | + $this->qyfile = str_replace(".map",".qy",$map_file); | ||
80 | $this->locaplic = $locaplic; | 87 | $this->locaplic = $locaplic; |
81 | $this->mapa = ms_newMapObj($map_file); | 88 | $this->mapa = ms_newMapObj($map_file); |
82 | $this->arquivo = $map_file; | 89 | $this->arquivo = $map_file; |
@@ -214,8 +221,8 @@ $tipo - Tipo de busca brasil|null | @@ -214,8 +221,8 @@ $tipo - Tipo de busca brasil|null | ||
214 | //le o arquivo de query se existir e checa se existe seleção para o tema | 221 | //le o arquivo de query se existir e checa se existe seleção para o tema |
215 | $items = pegaItens($this->layer); | 222 | $items = pegaItens($this->layer); |
216 | $existesel = "nao"; | 223 | $existesel = "nao"; |
217 | - if (file_exists($this->arquivo."qy")) | ||
218 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 224 | + if (file_exists($this->qyfile)) |
225 | + {$this->mapa->loadquery($this->qyfile);} | ||
219 | if ($this->layer->getNumresults() > 0){$existesel = "sim";} | 226 | if ($this->layer->getNumresults() > 0){$existesel = "sim";} |
220 | if ($existesel == "nao") | 227 | if ($existesel == "nao") |
221 | {$this->layer->querybyrect($this->mapa->extent);} | 228 | {$this->layer->querybyrect($this->mapa->extent);} |
@@ -281,8 +288,8 @@ $tipolista - Indica se serão mostrados todos os registros ou apenas os seleciona | @@ -281,8 +288,8 @@ $tipolista - Indica se serão mostrados todos os registros ou apenas os seleciona | ||
281 | else | 288 | else |
282 | {$items[] = $itemtema;} | 289 | {$items[] = $itemtema;} |
283 | $resultadoFinal[] = array("itens"=>$items); | 290 | $resultadoFinal[] = array("itens"=>$items); |
284 | - if (file_exists($this->arquivo."qy")) | ||
285 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 291 | + if (file_exists($this->qyfile)) |
292 | + {$this->mapa->loadquery($this->qyfile);} | ||
286 | $indxlayer = $this->layer->index; | 293 | $indxlayer = $this->layer->index; |
287 | $sopen = $this->layer->open(); | 294 | $sopen = $this->layer->open(); |
288 | if($sopen == MS_FAILURE){return "erro";} | 295 | if($sopen == MS_FAILURE){return "erro";} |
@@ -485,8 +492,8 @@ Include: | @@ -485,8 +492,8 @@ Include: | ||
485 | if ($filtro != ""){$this->layer->setfilter("");} | 492 | if ($filtro != ""){$this->layer->setfilter("");} |
486 | //le o arquivo de query se existir e checa se existe seleção para o tema | 493 | //le o arquivo de query se existir e checa se existe seleção para o tema |
487 | $existesel = "nao"; | 494 | $existesel = "nao"; |
488 | - if (file_exists(($this->arquivo)."qy")) | ||
489 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 495 | + if (file_exists($this->qyfile)) |
496 | + {$this->mapa->loadquery($this->qyfile);} | ||
490 | if ($this->layer->getNumresults() > 0){$existesel = "sim";} | 497 | if ($this->layer->getNumresults() > 0){$existesel = "sim";} |
491 | if ($existesel == "nao") | 498 | if ($existesel == "nao") |
492 | {$this->layer->queryByrect($this->mapa->extent);} | 499 | {$this->layer->queryByrect($this->mapa->extent);} |
classesphp/classe_mapa.php
@@ -53,6 +53,12 @@ class Mapa | @@ -53,6 +53,12 @@ class Mapa | ||
53 | Objetos layers | 53 | Objetos layers |
54 | */ | 54 | */ |
55 | public $layers; | 55 | public $layers; |
56 | + /* | ||
57 | + Variavel: $qyfile | ||
58 | + | ||
59 | + Nome do arquivo de seleção (.qy) | ||
60 | + */ | ||
61 | + public $qyfile; | ||
56 | 62 | ||
57 | /* | 63 | /* |
58 | Function: __construct | 64 | Function: __construct |
@@ -71,6 +77,7 @@ $map_file - Endereço do mapfile no servidor. | @@ -71,6 +77,7 @@ $map_file - Endereço do mapfile no servidor. | ||
71 | include_once($locaplic."/funcoes_gerais.php"); | 77 | include_once($locaplic."/funcoes_gerais.php"); |
72 | else | 78 | else |
73 | include_once("funcoes_gerais.php"); | 79 | include_once("funcoes_gerais.php"); |
80 | + $this->qyfile = str_replace(".map",".qy",$map_file); | ||
74 | $this->locaplic = $locaplic; | 81 | $this->locaplic = $locaplic; |
75 | if(!file_exists($map_file)) | 82 | if(!file_exists($map_file)) |
76 | {return $this->arquivo = false;} | 83 | {return $this->arquivo = false;} |
@@ -140,9 +147,9 @@ string - javascript com os parametros | @@ -140,9 +147,9 @@ string - javascript com os parametros | ||
140 | function parametrosTemas() | 147 | function parametrosTemas() |
141 | { | 148 | { |
142 | $existesel = false; | 149 | $existesel = false; |
143 | - $qy = file_exists(($this->arquivo)."qy"); | 150 | + $qy = file_exists($this->qyfile); |
144 | if ($qy) | 151 | if ($qy) |
145 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 152 | + {$this->mapa->loadquery($this->qyfile);} |
146 | foreach ($this->layers as $oLayer) | 153 | foreach ($this->layers as $oLayer) |
147 | { | 154 | { |
148 | $sel = "nao"; | 155 | $sel = "nao"; |
@@ -218,7 +225,7 @@ string - javascript com os parametros | @@ -218,7 +225,7 @@ string - javascript com os parametros | ||
218 | } | 225 | } |
219 | //apaga o arquivo qy se não for necessário | 226 | //apaga o arquivo qy se não for necessário |
220 | if (!$existesel && $qy) | 227 | if (!$existesel && $qy) |
221 | - {unlink(($this->arquivo)."qy");} | 228 | + {unlink($this->qyfile);} |
222 | $temas = array_reverse($temas); | 229 | $temas = array_reverse($temas); |
223 | return $temas; | 230 | return $temas; |
224 | } | 231 | } |
@@ -247,7 +254,7 @@ Include: | @@ -247,7 +254,7 @@ Include: | ||
247 | else | 254 | else |
248 | include_once("classe_imagem.php"); | 255 | include_once("classe_imagem.php"); |
249 | $nomer = ""; | 256 | $nomer = ""; |
250 | - $qy = file_exists(($this->arquivo)."qy"); | 257 | + $qy = file_exists($this->qyfile); |
251 | $legenda = $this->mapa->legend; | 258 | $legenda = $this->mapa->legend; |
252 | // | 259 | // |
253 | //prepara a legenda para incluir no mapa, preenchendo os nomes das classes que podem estar em branco | 260 | //prepara a legenda para incluir no mapa, preenchendo os nomes das classes que podem estar em branco |
@@ -529,8 +536,8 @@ nome | @@ -529,8 +536,8 @@ nome | ||
529 | */ | 536 | */ |
530 | function listaTemasTipo($tipo,$selecao="nao") | 537 | function listaTemasTipo($tipo,$selecao="nao") |
531 | { | 538 | { |
532 | - if (($selecao=="sim") && (file_exists(($this->arquivo)."qy"))) | ||
533 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 539 | + if (($selecao=="sim") && (file_exists($this->qyfile))) |
540 | + {$this->mapa->loadquery($this->qyfile);} | ||
534 | $layers = array(); | 541 | $layers = array(); |
535 | foreach($this->layers as $layer) | 542 | foreach($this->layers as $layer) |
536 | { | 543 | { |
@@ -585,14 +592,14 @@ nome | @@ -585,14 +592,14 @@ nome | ||
585 | { | 592 | { |
586 | $layers = array(); | 593 | $layers = array(); |
587 | $final = array(); | 594 | $final = array(); |
588 | - if (file_exists(($this->arquivo)."qy")) | 595 | + if (file_exists($this->qyfile)) |
589 | { | 596 | { |
590 | foreach($this->layers as $layer) | 597 | foreach($this->layers as $layer) |
591 | { | 598 | { |
592 | if ($layer->getmetadata("ESCONDIDO") == "") | 599 | if ($layer->getmetadata("ESCONDIDO") == "") |
593 | {$layers[] = $layer;} | 600 | {$layers[] = $layer;} |
594 | } | 601 | } |
595 | - $this->mapa->loadquery(($this->arquivo)."qy"); | 602 | + $this->mapa->loadquery($this->qyfile); |
596 | foreach ($layers as $layer) | 603 | foreach ($layers as $layer) |
597 | { | 604 | { |
598 | //verifica se o tema tem selecao | 605 | //verifica se o tema tem selecao |
@@ -732,8 +739,8 @@ $incluitexto - sim|nao | @@ -732,8 +739,8 @@ $incluitexto - sim|nao | ||
732 | function gradeCoord($intervalo,$corlinha="200,200,200",$larguralinha=1,$tipolinha="linha",$tamanhotexto=MS_TINY,$fonte="bitmap",$cortexto="0,0,0",$incluitexto="sim",$mascara="-1,-1,-1",$shadowcolor="-1,-1,-1",$shadowsizex=0,$shadowsizey=0) | 739 | function gradeCoord($intervalo,$corlinha="200,200,200",$larguralinha=1,$tipolinha="linha",$tamanhotexto=MS_TINY,$fonte="bitmap",$cortexto="0,0,0",$incluitexto="sim",$mascara="-1,-1,-1",$shadowcolor="-1,-1,-1",$shadowsizex=0,$shadowsizey=0) |
733 | { | 740 | { |
734 | //echo $corlinha; | 741 | //echo $corlinha; |
735 | - if (file_exists(($this->arquivo)."qy")) | ||
736 | - {unlink (($this->arquivo)."qy");} | 742 | + if (file_exists($this->qyfile)) |
743 | + {unlink ($this->qyfile);} | ||
737 | $nlayer = criaLayer($this->mapa,MS_LAYER_LINE,MS_DEFAULT,"Grade de coordenadas","SIM"); | 744 | $nlayer = criaLayer($this->mapa,MS_LAYER_LINE,MS_DEFAULT,"Grade de coordenadas","SIM"); |
738 | ms_newgridobj($nlayer); | 745 | ms_newgridobj($nlayer); |
739 | $nlayer->grid->set("labelformat", "DDMMSS"); | 746 | $nlayer->grid->set("labelformat", "DDMMSS"); |
@@ -815,8 +822,8 @@ $random - indica se os nomes dos novos layers serão modificados ou nao | @@ -815,8 +822,8 @@ $random - indica se os nomes dos novos layers serão modificados ou nao | ||
815 | function adicionaTema($temas,$locaplic,$random="sim") | 822 | function adicionaTema($temas,$locaplic,$random="sim") |
816 | { | 823 | { |
817 | //limpa selecao | 824 | //limpa selecao |
818 | - if (file_exists(($this->arquivo)."qy")) | ||
819 | - {unlink (($this->arquivo)."qy");} | 825 | + if (file_exists($this->qyfile)) |
826 | + {unlink ($this->qyfile);} | ||
820 | $temas = explode(",",$temas); | 827 | $temas = explode(",",$temas); |
821 | $zoomlayer = ""; | 828 | $zoomlayer = ""; |
822 | foreach ($temas as $nome) | 829 | foreach ($temas as $nome) |
@@ -939,8 +946,8 @@ $temas - lista separada por vírgula dos temas que serão excluídos. | @@ -939,8 +946,8 @@ $temas - lista separada por vírgula dos temas que serão excluídos. | ||
939 | */ | 946 | */ |
940 | function excluiTemas($temas) | 947 | function excluiTemas($temas) |
941 | { | 948 | { |
942 | - if (file_exists(($this->arquivo)."qy")) | ||
943 | - {unlink(($this->arquivo)."qy");} | 949 | + if (file_exists($this->qyfile)) |
950 | + {unlink($this->qyfile);} | ||
944 | $temas = explode(",",$temas); | 951 | $temas = explode(",",$temas); |
945 | foreach ($temas as $nome) | 952 | foreach ($temas as $nome) |
946 | { | 953 | { |
@@ -1091,8 +1098,8 @@ Include: | @@ -1091,8 +1098,8 @@ Include: | ||
1091 | else | 1098 | else |
1092 | include_once("wmswfs.php"); | 1099 | include_once("wmswfs.php"); |
1093 | //limpa selecao | 1100 | //limpa selecao |
1094 | - if (file_exists(($this->arquivo)."qy")) | ||
1095 | - {unlink (($this->arquivo)."qy");} | 1101 | + if (file_exists($this->qyfile)) |
1102 | + {unlink ($this->qyfile);} | ||
1096 | $nmap = ms_newMapObj($locaplic."/aplicmap/novotema.map"); | 1103 | $nmap = ms_newMapObj($locaplic."/aplicmap/novotema.map"); |
1097 | $layer = $nmap->getlayerbyname("novotema"); | 1104 | $layer = $nmap->getlayerbyname("novotema"); |
1098 | //$layer->set("name",nomeRandomico()); | 1105 | //$layer->set("name",nomeRandomico()); |
classesphp/classe_selecao.php
@@ -62,6 +62,12 @@ class Selecao | @@ -62,6 +62,12 @@ class Selecao | ||
62 | Nome do layer | 62 | Nome do layer |
63 | */ | 63 | */ |
64 | protected $nome; | 64 | protected $nome; |
65 | + /* | ||
66 | + Variavel: $qyfile | ||
67 | + | ||
68 | + Nome do arquivo de seleção (.qy) | ||
69 | + */ | ||
70 | + public $qyfile; | ||
65 | /* | 71 | /* |
66 | Function: __construct | 72 | Function: __construct |
67 | 73 | ||
@@ -77,6 +83,7 @@ $tema - nome do tema | @@ -77,6 +83,7 @@ $tema - nome do tema | ||
77 | function __construct($map_file,$tema="") | 83 | function __construct($map_file,$tema="") |
78 | { | 84 | { |
79 | //error_reporting(E_ALL); | 85 | //error_reporting(E_ALL); |
86 | + $this->qyfile = str_replace(".map",".qy",$map_file); | ||
80 | $this->mapa = ms_newMapObj($map_file); | 87 | $this->mapa = ms_newMapObj($map_file); |
81 | $this->arquivo = $map_file; | 88 | $this->arquivo = $map_file; |
82 | if($tema != "" && @$this->mapa->getlayerbyname($tema)) | 89 | if($tema != "" && @$this->mapa->getlayerbyname($tema)) |
@@ -116,8 +123,8 @@ $ys - lista de coordenadas y separadas por virgula | @@ -116,8 +123,8 @@ $ys - lista de coordenadas y separadas por virgula | ||
116 | {return($this->selecaoInverte());} | 123 | {return($this->selecaoInverte());} |
117 | $tipoLayer = $this->layer->type; | 124 | $tipoLayer = $this->layer->type; |
118 | $this->layer->set("template","none.htm"); | 125 | $this->layer->set("template","none.htm"); |
119 | - if (file_exists(($this->arquivo)."qy")) | ||
120 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 126 | + if (file_exists($this->qyfile)) |
127 | + {$this->mapa->loadquery($this->qyfile);} | ||
121 | $indxlayer = $this->layer->index; | 128 | $indxlayer = $this->layer->index; |
122 | $res_count = $this->layer->getNumresults(); | 129 | $res_count = $this->layer->getNumresults(); |
123 | $shp_atual = array(); | 130 | $shp_atual = array(); |
@@ -178,8 +185,8 @@ $tipo - Tipo de operação adiciona|retira|inverte|limpa | @@ -178,8 +185,8 @@ $tipo - Tipo de operação adiciona|retira|inverte|limpa | ||
178 | $tipoLayero = $layero->type; | 185 | $tipoLayero = $layero->type; |
179 | $this->layer->set("template","none.htm"); | 186 | $this->layer->set("template","none.htm"); |
180 | $layero->set("template","none.htm"); | 187 | $layero->set("template","none.htm"); |
181 | - if (file_exists(($this->arquivo)."qy")) | ||
182 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 188 | + if (file_exists($this->qyfile)) |
189 | + {$this->mapa->loadquery($this->qyfile);} | ||
183 | $indxlayer = $this->layer->index; | 190 | $indxlayer = $this->layer->index; |
184 | $res_count = $this->layer->getNumresults(); | 191 | $res_count = $this->layer->getNumresults(); |
185 | $res_counto = $layero->getNumresults(); | 192 | $res_counto = $layero->getNumresults(); |
@@ -338,8 +345,8 @@ $valor - Valor. | @@ -338,8 +345,8 @@ $valor - Valor. | ||
338 | } | 345 | } |
339 | $this->layer->set("template","none.htm"); | 346 | $this->layer->set("template","none.htm"); |
340 | $indxlayer = $this->layer->index; | 347 | $indxlayer = $this->layer->index; |
341 | - if (file_exists(($this->arquivo)."qy")) | ||
342 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 348 | + if (file_exists($this->qyfile)) |
349 | + {$this->mapa->loadquery($this->qyfile);} | ||
343 | $res_count = $this->layer->getNumresults(); | 350 | $res_count = $this->layer->getNumresults(); |
344 | $shp_atual = array(); | 351 | $shp_atual = array(); |
345 | for ($i = 0; $i < $res_count;++$i) | 352 | for ($i = 0; $i < $res_count;++$i) |
@@ -403,8 +410,8 @@ $valor - Valor. | @@ -403,8 +410,8 @@ $valor - Valor. | ||
403 | if(!$this->layer){return "erro";} | 410 | if(!$this->layer){return "erro";} |
404 | $this->layer->set("template","none.htm"); | 411 | $this->layer->set("template","none.htm"); |
405 | $indxlayer = $this->layer->index; | 412 | $indxlayer = $this->layer->index; |
406 | - if (file_exists(($this->arquivo)."qy")) | ||
407 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 413 | + if (file_exists($this->qyfile)) |
414 | + {$this->mapa->loadquery($this->qyfile);} | ||
408 | $res_count = $this->layer->getNumresults(); | 415 | $res_count = $this->layer->getNumresults(); |
409 | $shp_atual = array(); | 416 | $shp_atual = array(); |
410 | for ($i = 0; $i < $res_count;++$i) | 417 | for ($i = 0; $i < $res_count;++$i) |
@@ -458,8 +465,8 @@ $tipo - Tipo de operação adiciona|retira|inverte|limpa | @@ -458,8 +465,8 @@ $tipo - Tipo de operação adiciona|retira|inverte|limpa | ||
458 | {return ($this->selecaoInverte());} | 465 | {return ($this->selecaoInverte());} |
459 | if(!$this->layer){return "erro";} | 466 | if(!$this->layer){return "erro";} |
460 | $this->layer->set("template","none.htm"); | 467 | $this->layer->set("template","none.htm"); |
461 | - if (file_exists(($this->arquivo)."qy")) | ||
462 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 468 | + if (file_exists($this->qyfile)) |
469 | + {$this->mapa->loadquery($this->qyfile);} | ||
463 | $indxlayer = $this->layer->index; | 470 | $indxlayer = $this->layer->index; |
464 | $res_count = $this->layer->getNumresults(); | 471 | $res_count = $this->layer->getNumresults(); |
465 | $shp_atual = array(); | 472 | $shp_atual = array(); |
@@ -534,16 +541,16 @@ Limpa a seleção do tema. | @@ -534,16 +541,16 @@ Limpa a seleção do tema. | ||
534 | if ($this->nome != "") //limpa de um tema | 541 | if ($this->nome != "") //limpa de um tema |
535 | { | 542 | { |
536 | if(!$this->layer){return "erro";} | 543 | if(!$this->layer){return "erro";} |
537 | - if (file_exists(($this->arquivo)."qy")) | ||
538 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 544 | + if (file_exists($this->qyfile)) |
545 | + {$this->mapa->loadquery($this->qyfile);} | ||
539 | $indxlayer = $this->layer->index; | 546 | $indxlayer = $this->layer->index; |
540 | $this->mapa->freequery($indxlayer); | 547 | $this->mapa->freequery($indxlayer); |
541 | - $this->mapa->savequery(($this->arquivo)."qy"); | 548 | + $this->mapa->savequery($this->qyfile); |
542 | } | 549 | } |
543 | else //limpa de todos os temas | 550 | else //limpa de todos os temas |
544 | { | 551 | { |
545 | - if (file_exists(($this->arquivo)."qy")) | ||
546 | - {unlink (($this->arquivo)."qy");} | 552 | + if (file_exists($this->qyfile)) |
553 | + {unlink ($this->qyfile);} | ||
547 | } | 554 | } |
548 | return("ok"); | 555 | return("ok"); |
549 | } | 556 | } |
@@ -557,8 +564,8 @@ Inverte seleção do tema. | @@ -557,8 +564,8 @@ Inverte seleção do tema. | ||
557 | { | 564 | { |
558 | if(!$this->layer){return "erro";} | 565 | if(!$this->layer){return "erro";} |
559 | $this->layer->set("template","none.htm"); | 566 | $this->layer->set("template","none.htm"); |
560 | - if (file_exists(($this->arquivo)."qy")) | ||
561 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 567 | + if (file_exists($this->qyfile)) |
568 | + {$this->mapa->loadquery($this->qyfile);} | ||
562 | $indxlayer = $this->layer->index; | 569 | $indxlayer = $this->layer->index; |
563 | $items = pegaItens($this->layer); | 570 | $items = pegaItens($this->layer); |
564 | $res_count = $this->layer->getNumresults(); | 571 | $res_count = $this->layer->getNumresults(); |
@@ -584,7 +591,7 @@ Inverte seleção do tema. | @@ -584,7 +591,7 @@ Inverte seleção do tema. | ||
584 | $this->mapa->freequery($indxlayer); | 591 | $this->mapa->freequery($indxlayer); |
585 | foreach ($shp as $indx) | 592 | foreach ($shp as $indx) |
586 | {$this->mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);} | 593 | {$this->mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);} |
587 | - $this->mapa->savequery(($this->arquivo)."qy"); | 594 | + $this->mapa->savequery($this->qyfile); |
588 | return("ok"); | 595 | return("ok"); |
589 | } | 596 | } |
590 | /* | 597 | /* |
@@ -607,7 +614,7 @@ $shp_atual - Indices dos elementos já selecionados. | @@ -607,7 +614,7 @@ $shp_atual - Indices dos elementos já selecionados. | ||
607 | $this->mapa->freequery($indxlayer); | 614 | $this->mapa->freequery($indxlayer); |
608 | foreach ($shp as $indx) | 615 | foreach ($shp as $indx) |
609 | {@$this->mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);} | 616 | {@$this->mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);} |
610 | - $this->mapa->savequery(($this->arquivo)."qy"); | 617 | + $this->mapa->savequery($this->qyfile); |
611 | return("ok"); | 618 | return("ok"); |
612 | } | 619 | } |
613 | /* | 620 | /* |
@@ -632,7 +639,7 @@ $shp_atual - Indices dos elementos já selecionados. | @@ -632,7 +639,7 @@ $shp_atual - Indices dos elementos já selecionados. | ||
632 | $this->mapa->freequery($indxlayer); | 639 | $this->mapa->freequery($indxlayer); |
633 | foreach ($shp as $indx) | 640 | foreach ($shp as $indx) |
634 | {$this->mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);} | 641 | {$this->mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);} |
635 | - $this->mapa->savequery(($this->arquivo)."qy"); | 642 | + $this->mapa->savequery($this->qyfile); |
636 | return("ok"); | 643 | return("ok"); |
637 | } | 644 | } |
638 | /* | 645 | /* |
@@ -650,14 +657,14 @@ $ids - Ids separados por vírgula correspondendo aos registros. | @@ -650,14 +657,14 @@ $ids - Ids separados por vírgula correspondendo aos registros. | ||
650 | { | 657 | { |
651 | if(!$this->layer){return "erro";} | 658 | if(!$this->layer){return "erro";} |
652 | $this->layer->set("template","none.htm"); | 659 | $this->layer->set("template","none.htm"); |
653 | - if (file_exists(($this->arquivo)."qy")) | ||
654 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 660 | + if (file_exists($this->qyfile)) |
661 | + {$this->mapa->loadquery($this->qyfile);} | ||
655 | $ids = explode(",",$ids); | 662 | $ids = explode(",",$ids); |
656 | $indxlayer = $this->layer->index; | 663 | $indxlayer = $this->layer->index; |
657 | $ids = array_unique($ids); | 664 | $ids = array_unique($ids); |
658 | foreach ($ids as $i) | 665 | foreach ($ids as $i) |
659 | {$this->mapa->queryByIndex($indxlayer, -1, $i);} | 666 | {$this->mapa->queryByIndex($indxlayer, -1, $i);} |
660 | - $this->mapa->savequery(($this->arquivo)."qy"); | 667 | + $this->mapa->savequery($this->qyfile); |
661 | return("ok"); | 668 | return("ok"); |
662 | } | 669 | } |
663 | /* | 670 | /* |
@@ -708,8 +715,8 @@ $tipo - Tipo de operação adiciona|retira|inverte|limpa | @@ -708,8 +715,8 @@ $tipo - Tipo de operação adiciona|retira|inverte|limpa | ||
708 | if ($tipo == "inverte") | 715 | if ($tipo == "inverte") |
709 | {return ($this->selecaoInverte());} | 716 | {return ($this->selecaoInverte());} |
710 | $this->layer->set("template","none.htm"); | 717 | $this->layer->set("template","none.htm"); |
711 | - if (file_exists(($this->arquivo)."qy")) | ||
712 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 718 | + if (file_exists($this->qyfile)) |
719 | + {$this->mapa->loadquery($this->qyfile);} | ||
713 | $indxlayer = $this->layer->index; | 720 | $indxlayer = $this->layer->index; |
714 | $res_count = $this->layer->getNumresults(); | 721 | $res_count = $this->layer->getNumresults(); |
715 | $shp_atual = array(); | 722 | $shp_atual = array(); |
@@ -757,8 +764,8 @@ $ext - coordenadas separadas por espaços no estilo xmin ymin xmax ymax | @@ -757,8 +764,8 @@ $ext - coordenadas separadas por espaços no estilo xmin ymin xmax ymax | ||
757 | if ($tipo == "inverte") | 764 | if ($tipo == "inverte") |
758 | {return ($this->selecaoInverte());} | 765 | {return ($this->selecaoInverte());} |
759 | $this->layer->set("template","none.htm"); | 766 | $this->layer->set("template","none.htm"); |
760 | - if (file_exists(($this->arquivo)."qy")) | ||
761 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 767 | + if (file_exists($this->qyfile)) |
768 | + {$this->mapa->loadquery($this->qyfile);} | ||
762 | $indxlayer = $this->layer->index; | 769 | $indxlayer = $this->layer->index; |
763 | $res_count = $this->layer->getNumresults(); | 770 | $res_count = $this->layer->getNumresults(); |
764 | $shp_atual = array(); | 771 | $shp_atual = array(); |
classesphp/classe_temas.php
@@ -79,7 +79,13 @@ class Temas | @@ -79,7 +79,13 @@ class Temas | ||
79 | 79 | ||
80 | Indices dos layers do grupo | 80 | Indices dos layers do grupo |
81 | */ | 81 | */ |
82 | - protected $indices; | 82 | + protected $indices; |
83 | + /* | ||
84 | + Variavel: $qyfile | ||
85 | + | ||
86 | + Nome do arquivo de seleção (.qy) | ||
87 | + */ | ||
88 | + public $qyfile; | ||
83 | /* | 89 | /* |
84 | function __construct | 90 | function __construct |
85 | 91 | ||
@@ -93,6 +99,7 @@ $tema - nome do tema que será processado | @@ -93,6 +99,7 @@ $tema - nome do tema que será processado | ||
93 | function __construct($map_file,$tema=null,$locaplic="") | 99 | function __construct($map_file,$tema=null,$locaplic="") |
94 | { | 100 | { |
95 | //error_reporting(E_ALL); | 101 | //error_reporting(E_ALL); |
102 | + $this->qyfile = str_replace(".map",".qy",$map_file); | ||
96 | if(file_exists($locaplic."/funcoes_gerais.php")) | 103 | if(file_exists($locaplic."/funcoes_gerais.php")) |
97 | include_once($locaplic."/funcoes_gerais.php"); | 104 | include_once($locaplic."/funcoes_gerais.php"); |
98 | else | 105 | else |
@@ -213,8 +220,8 @@ Altera a ordem de armazenamento dos layers no mapfile. | @@ -213,8 +220,8 @@ Altera a ordem de armazenamento dos layers no mapfile. | ||
213 | */ | 220 | */ |
214 | function desceTema() | 221 | function desceTema() |
215 | { | 222 | { |
216 | - if (file_exists(($this->arquivo)."qy")) | ||
217 | - {unlink (($this->arquivo)."qy");} | 223 | + if (file_exists($this->qyfile)) |
224 | + {unlink ($this->qyfile);} | ||
218 | $nl = $this->mapa->numlayers; | 225 | $nl = $this->mapa->numlayers; |
219 | $mover = 1; | 226 | $mover = 1; |
220 | $indice = $this->indices[0]; | 227 | $indice = $this->indices[0]; |
@@ -259,8 +266,8 @@ Altera a ordem de armazenamento dos layers no mapfile. | @@ -259,8 +266,8 @@ Altera a ordem de armazenamento dos layers no mapfile. | ||
259 | */ | 266 | */ |
260 | function sobeTema() | 267 | function sobeTema() |
261 | { | 268 | { |
262 | - if (file_exists(($this->arquivo)."qy")) | ||
263 | - {unlink (($this->arquivo)."qy");} | 269 | + if (file_exists($this->qyfile)) |
270 | + {unlink ($this->qyfile);} | ||
264 | $nl = $this->mapa->numlayers; | 271 | $nl = $this->mapa->numlayers; |
265 | $mover = 1; | 272 | $mover = 1; |
266 | $indices = array_reverse($this->indices); | 273 | $indices = array_reverse($this->indices); |
@@ -692,8 +699,8 @@ $nome - nome que será dado a geometria | @@ -692,8 +699,8 @@ $nome - nome que será dado a geometria | ||
692 | $ext = $this->mapa->extent; | 699 | $ext = $this->mapa->extent; |
693 | $sb = $this->mapa->scalebar; | 700 | $sb = $this->mapa->scalebar; |
694 | $sb->set("status",MS_OFF); | 701 | $sb->set("status",MS_OFF); |
695 | - if (file_exists($this->arquivo."qy")) | ||
696 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 702 | + if (file_exists($this->qyfile)) |
703 | + {$this->mapa->loadquery($this->qyfile);} | ||
697 | $items = pegaItens($this->layer); | 704 | $items = pegaItens($this->layer); |
698 | $sopen = $this->layer->open(); | 705 | $sopen = $this->layer->open(); |
699 | if($sopen == MS_FAILURE){return "erro";} | 706 | if($sopen == MS_FAILURE){return "erro";} |
@@ -917,8 +924,8 @@ Calcula a extensão geográfica dos elementos selecionados de um tema e ajusta o m | @@ -917,8 +924,8 @@ Calcula a extensão geográfica dos elementos selecionados de um tema e ajusta o m | ||
917 | $extatual = $this->mapa->extent; | 924 | $extatual = $this->mapa->extent; |
918 | $prjMapa = ""; | 925 | $prjMapa = ""; |
919 | $prjTema = ""; | 926 | $prjTema = ""; |
920 | - if (file_exists($this->arquivo."qy")) | ||
921 | - {$this->mapa->loadquery(($this->arquivo)."qy");} | 927 | + if (file_exists($this->qyfile)) |
928 | + {$this->mapa->loadquery($this->qyfile);} | ||
922 | $sopen = $this->layer->open(); | 929 | $sopen = $this->layer->open(); |
923 | if($sopen == MS_FAILURE){return "erro";} | 930 | if($sopen == MS_FAILURE){return "erro";} |
924 | $res_count = $this->layer->getNumresults(); | 931 | $res_count = $this->layer->getNumresults(); |
classesphp/funcoes_gerais.php
@@ -1788,8 +1788,9 @@ function criaSHP($tema,$map_file,$locaplic,$dir_tmp,$nomeRand=TRUE) | @@ -1788,8 +1788,9 @@ function criaSHP($tema,$map_file,$locaplic,$dir_tmp,$nomeRand=TRUE) | ||
1788 | $novoshpf = ms_newShapefileObj($nomeshp.".shp", -2); | 1788 | $novoshpf = ms_newShapefileObj($nomeshp.".shp", -2); |
1789 | //le o arquivo de query se existir e checa se existe seleção para o tema | 1789 | //le o arquivo de query se existir e checa se existe seleção para o tema |
1790 | $existesel = "nao"; | 1790 | $existesel = "nao"; |
1791 | - if (file_exists($map_file."qy")) | ||
1792 | - {$map->loadquery($map_file."qy");} | 1791 | + $qyfile = str_replace(".map",".qy",$map_file); |
1792 | + if (file_exists($qyfile)) | ||
1793 | + {$map->loadquery($qyfile);} | ||
1793 | if ($layer->getNumresults() > 0) | 1794 | if ($layer->getNumresults() > 0) |
1794 | {$existesel = "sim";} | 1795 | {$existesel = "sim";} |
1795 | 1796 |
classesphp/graficos.php
@@ -376,8 +376,9 @@ function iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$t | @@ -376,8 +376,9 @@ function iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$t | ||
376 | //pega os valores | 376 | //pega os valores |
377 | $map = ms_newMapObj($map_file); | 377 | $map = ms_newMapObj($map_file); |
378 | $selecionados = "sim"; | 378 | $selecionados = "sim"; |
379 | - if (file_exists($map_file."qy")) | ||
380 | - {$map->loadquery($map_file."qy");} | 379 | + $qyfile = str_replace(".map",".qy",$map_file); |
380 | + if (file_exists($qyfile)) | ||
381 | + {$map->loadquery($qyfile);} | ||
381 | else | 382 | else |
382 | {$selecionados = "nao";} | 383 | {$selecionados = "nao";} |
383 | $layer = $map->getLayerByName($tema); | 384 | $layer = $map->getLayerByName($tema); |
classesphp/mapa_controle.php
@@ -149,12 +149,7 @@ if (isset($debug) && $debug == "sim") | @@ -149,12 +149,7 @@ if (isset($debug) && $debug == "sim") | ||
149 | // | 149 | // |
150 | include_once ("carrega_ext.php"); | 150 | include_once ("carrega_ext.php"); |
151 | include_once("funcoes_gerais.php"); | 151 | include_once("funcoes_gerais.php"); |
152 | -//include_once("../pacotes/cpaint/cpaint2.inc.php"); | ||
153 | -// | ||
154 | -//cria objeto cpaint para uso com ajax | ||
155 | -// | ||
156 | -//$cp = new cpaint(); | ||
157 | -//$cp->set_data(""); | 152 | + |
158 | if ($funcao == "criaMapa") | 153 | if ($funcao == "criaMapa") |
159 | { | 154 | { |
160 | session_destroy(); | 155 | session_destroy(); |
@@ -403,8 +398,9 @@ Salva o mapa acrescentando um novo layer com o buffer. | @@ -403,8 +398,9 @@ Salva o mapa acrescentando um novo layer com o buffer. | ||
403 | $retorno = $m->criaBuffer($distancia,$locaplic,$unir); | 398 | $retorno = $m->criaBuffer($distancia,$locaplic,$unir); |
404 | $m->salva(); | 399 | $m->salva(); |
405 | //limpa selecao | 400 | //limpa selecao |
406 | - if (file_exists($map_file."qy")) | ||
407 | - {unlink ($map_file."qy");} | 401 | + $qyfile = str_replace(".map",".qy",$map_file); |
402 | + if (file_exists($qyfile)) | ||
403 | + {unlink ($qyfile);} | ||
408 | break; | 404 | break; |
409 | /* | 405 | /* |
410 | Property - DISTANCIAPTPT | 406 | Property - DISTANCIAPTPT |
@@ -560,8 +556,10 @@ Valor: REINICIAMAPA | @@ -560,8 +556,10 @@ Valor: REINICIAMAPA | ||
560 | Reinicia um mapa restaurando a cópia de segurança. | 556 | Reinicia um mapa restaurando a cópia de segurança. |
561 | */ | 557 | */ |
562 | case "REINICIAMAPA": | 558 | case "REINICIAMAPA": |
563 | - if(file_exists($map_file."qy")) | ||
564 | - {unlink($map_file."qy");} | 559 | + $qyfile = str_replace(".map",".qy",$map_file); |
560 | + if (file_exists($qyfile)) | ||
561 | + {unlink ($qyfile);} | ||
562 | + | ||
565 | unlink($map_file); | 563 | unlink($map_file); |
566 | copy(str_replace(".map","reinc.map",$map_file),$map_file); | 564 | copy(str_replace(".map","reinc.map",$map_file),$map_file); |
567 | $retorno = "ok"; | 565 | $retorno = "ok"; |
@@ -572,8 +570,10 @@ Valor: RECUPERAMAPA | @@ -572,8 +570,10 @@ Valor: RECUPERAMAPA | ||
572 | Recupera o mapfile de segurança. | 570 | Recupera o mapfile de segurança. |
573 | */ | 571 | */ |
574 | case "RECUPERAMAPA": | 572 | case "RECUPERAMAPA": |
575 | - if(file_exists($map_file."qy")) | ||
576 | - {unlink($map_file."qy");} | 573 | + $qyfile = str_replace(".map",".qy",$map_file); |
574 | + if (file_exists($qyfile)) | ||
575 | + {unlink ($qyfile);} | ||
576 | + | ||
577 | unlink($map_file); | 577 | unlink($map_file); |
578 | $nmf = str_replace(".map","seguranca.map",$map_file); | 578 | $nmf = str_replace(".map","seguranca.map",$map_file); |
579 | if(file_exists($nmf)) | 579 | if(file_exists($nmf)) |
classesphp/mapa_inicia.php
@@ -157,6 +157,7 @@ function iniciaMapa() | @@ -157,6 +157,7 @@ function iniciaMapa() | ||
157 | include_once("classe_mapa.php"); | 157 | include_once("classe_mapa.php"); |
158 | error_reporting(E_ALL); | 158 | error_reporting(E_ALL); |
159 | $m = new Mapa($map_file); | 159 | $m = new Mapa($map_file); |
160 | + | ||
160 | $m->mudaQS($w,$h); | 161 | $m->mudaQS($w,$h); |
161 | $m = new Mapa($map_file); | 162 | $m = new Mapa($map_file); |
162 | $m->mapa->setsize($w,$h); | 163 | $m->mapa->setsize($w,$h); |
@@ -200,7 +201,8 @@ function iniciaMapa() | @@ -200,7 +201,8 @@ function iniciaMapa() | ||
200 | // | 201 | // |
201 | //pega os parametros de cada tema | 202 | //pega os parametros de cada tema |
202 | // | 203 | // |
203 | - $arqsel = (file_exists($map_file."qy")) ? true : false; | 204 | + $qyfile = str_replace(".map",".qy",$map_file); |
205 | + $arqsel = (file_exists($qyfile)) ? true : false; | ||
204 | $m = New Mapa($map_file); | 206 | $m = New Mapa($map_file); |
205 | $temas = $m->parametrosTemas(); | 207 | $temas = $m->parametrosTemas(); |
206 | $nomes = nomeRandomico(12); | 208 | $nomes = nomeRandomico(12); |