Commit 63f6ea0dd877deabb479f41aeb2e6f064c3c93ad
1 parent
713eb581
Exists in
master
and in
7 other branches
--no commit message
Showing
2 changed files
with
11 additions
and
7 deletions
Show diff stats
pacotes/gvsig/gvsig2mapfile/class.gvsig2mapfile.php
1 | <?php | 1 | <?php |
2 | /** | 2 | /** |
3 | - * Manipula um arquivo GVP (projeto gvSIG) para construção de layers Mapserver | 3 | + * Manipula um arquivo GVP (projeto gvSIG) para construção de layers Mapserver |
4 | * @author Edmar Moretti | 4 | * @author Edmar Moretti |
5 | + * | ||
5 | * @license GPL2 | 6 | * @license GPL2 |
6 | */ | 7 | */ |
7 | class gvsig2mapfile{ | 8 | class gvsig2mapfile{ |
@@ -17,7 +18,7 @@ class gvsig2mapfile{ | @@ -17,7 +18,7 @@ class gvsig2mapfile{ | ||
17 | function __construct($gvp) | 18 | function __construct($gvp) |
18 | { | 19 | { |
19 | if(!file_exists($gvp)) | 20 | if(!file_exists($gvp)) |
20 | - {throw new Exception("Arquivo $gvp não existe");} | 21 | + {throw new Exception("Arquivo $gvp não existe");} |
21 | else{ | 22 | else{ |
22 | $this->arquivoGvp = $gvp; | 23 | $this->arquivoGvp = $gvp; |
23 | if(function_exists("dl")){ | 24 | if(function_exists("dl")){ |
@@ -25,7 +26,7 @@ class gvsig2mapfile{ | @@ -25,7 +26,7 @@ class gvsig2mapfile{ | ||
25 | {dl( 'php_simplexml.'.PHP_SHLIB_SUFFIX );} | 26 | {dl( 'php_simplexml.'.PHP_SHLIB_SUFFIX );} |
26 | } | 27 | } |
27 | if (!function_exists('simplexml_load_file')) | 28 | if (!function_exists('simplexml_load_file')) |
28 | - {throw new Exception("Função PHP simplexml_load_file não existe");} | 29 | + {throw new Exception("Função PHP simplexml_load_file não existe");} |
29 | $this->xml = simplexml_load_file($gvp); | 30 | $this->xml = simplexml_load_file($gvp); |
30 | } | 31 | } |
31 | } | 32 | } |
@@ -126,8 +127,8 @@ class gvsig2mapfile{ | @@ -126,8 +127,8 @@ class gvsig2mapfile{ | ||
126 | {$classes = $this->SingleSymbolLegend($result,$path1);} | 127 | {$classes = $this->SingleSymbolLegend($result,$path1);} |
127 | 128 | ||
128 | // | 129 | // |
129 | - //obtem a conexão | ||
130 | - //a senha não pode ser obtida, então, é usado o mesmo nome de usuário em seu lugar. No i3Geo deve-se prever isso na variável de substituição de string. | 130 | + //obtem a conexao |
131 | + //a senha nao pode ser obtida, entao, he usado o mesmo nome de usuario em seu lugar. No i3Geo deve-se prever isso na variavel de substituicao de string. | ||
131 | $driverName = $this->getValue($path,"driverName"); | 132 | $driverName = $this->getValue($path,"driverName"); |
132 | if($driverName == "gvSIG shp driver"){ | 133 | if($driverName == "gvSIG shp driver"){ |
133 | $data = (string) $this->getValue($path,"file"); | 134 | $data = (string) $this->getValue($path,"file"); |
@@ -261,6 +262,9 @@ class gvsig2mapfile{ | @@ -261,6 +262,9 @@ class gvsig2mapfile{ | ||
261 | {$oLayer->setConnectionType($dataLayer["connectiontype"]);} | 262 | {$oLayer->setConnectionType($dataLayer["connectiontype"]);} |
262 | if($dataLayer["connection"] != "") | 263 | if($dataLayer["connection"] != "") |
263 | {$oLayer->set("connection",$dataLayer["connection"]);} | 264 | {$oLayer->set("connection",$dataLayer["connection"]);} |
265 | + | ||
266 | + if($dataLayer["proj"] != "") | ||
267 | + {$oLayer->setProjection($dataLayer["proj"]);} | ||
264 | $oLayer->set("status",MS_DEFAULT); | 268 | $oLayer->set("status",MS_DEFAULT); |
265 | if($dataLayer["visible"] == "false") | 269 | if($dataLayer["visible"] == "false") |
266 | {$oLayer->set("status",MS_OFF);} | 270 | {$oLayer->set("status",MS_OFF);} |
pacotes/gvsig/gvsig2mapfile/gvsig2mapfile.php
@@ -6,8 +6,8 @@ | @@ -6,8 +6,8 @@ | ||
6 | $nomes = $gm->getViewsNames(); | 6 | $nomes = $gm->getViewsNames(); |
7 | $view = $gm->getViewByName($nomes[0]); | 7 | $view = $gm->getViewByName($nomes[0]); |
8 | $dataView = $gm->getViewData($nomes[0]); | 8 | $dataView = $gm->getViewData($nomes[0]); |
9 | - echo "Extensão do mapa: ".(implode(",",$dataView["extent"]))."\n"; | ||
10 | - echo "Projeção do mapa: ".$dataView["proj"]."\n"; | 9 | + echo "Extensão do mapa: ".(implode(",",$dataView["extent"]))."\n"; |
10 | + echo "Projeção do mapa: ".$dataView["proj"]."\n"; | ||
11 | echo "Camadas: ".(implode(",",$dataView["layerNames"]))."\n"; | 11 | echo "Camadas: ".(implode(",",$dataView["layerNames"]))."\n"; |
12 | foreach($dataView["layerNames"] as $lname) | 12 | foreach($dataView["layerNames"] as $lname) |
13 | {var_dump($gm->getLayerData($nomes[0],$lname));} | 13 | {var_dump($gm->getLayerData($nomes[0],$lname));} |