Commit aa7ccce939e7d08c09db05c85129812e04f368ad
1 parent
9ed906ca
Exists in
master
and in
7 other branches
Correção na inclusão de georss do tipo point
Showing
1 changed file
with
9 additions
and
10 deletions
Show diff stats
classesphp/classe_mapa.php
... | ... | @@ -1140,11 +1140,11 @@ $canal - Identificador do canal (ordem em que está no RSS) |
1140 | 1140 | {$canal = $c;} |
1141 | 1141 | } |
1142 | 1142 | $resultado = array(); |
1143 | + $tipog = ""; | |
1143 | 1144 | foreach ($canal->item as $item) |
1144 | 1145 | { |
1145 | 1146 | $env = array(); |
1146 | 1147 | //define o tipo |
1147 | - $tipog = ""; | |
1148 | 1148 | if ($item->xpath('geo:lat')){$tipog = "geo";} |
1149 | 1149 | if ($item->xpath('georss:point')){$tipog = "georsspoint";} |
1150 | 1150 | if ($item->xpath('georss:where')){$tipog = "envelope";} |
... | ... | @@ -1199,15 +1199,16 @@ $canal - Identificador do canal (ordem em que está no RSS) |
1199 | 1199 | include_once ("../pacotes/phpxbase/api_conversion.php"); |
1200 | 1200 | $diretorio = dirname($this->arquivo); |
1201 | 1201 | $tipol = MS_SHP_POLYGON; |
1202 | - if ($tipog != "envelope"){$tipol = MS_SHP_POINT;} | |
1202 | + if ($tipog == "georsspoint"){$tipol = MS_SHP_POINT;} | |
1203 | + if ($tipog == "geo"){$tipol = MS_SHP_POINT;} | |
1203 | 1204 | $novonomelayer = nomeRandomico(10)."georss"; |
1204 | 1205 | $nomeshp = $diretorio."/".$novonomelayer; |
1205 | 1206 | $novoshpf = ms_newShapefileObj($nomeshp, $tipol); |
1206 | 1207 | $novoshpf->free(); |
1207 | - $def[] = array("titulo","C","254"); | |
1208 | - $def[] = array("link","C","254"); | |
1209 | - $def[] = array("desc","C","254"); | |
1210 | - $def[] = array("categoria","C","254"); | |
1208 | + $def[] = array("TITULO","C","254"); | |
1209 | + $def[] = array("LINK","C","254"); | |
1210 | + $def[] = array("DESC","C","254"); | |
1211 | + $def[] = array("CATEGORIA","C","254"); | |
1211 | 1212 | $db = xbase_create($nomeshp.".dbf", $def); |
1212 | 1213 | $dbname = $nomeshp.".dbf"; |
1213 | 1214 | $reg = array(); |
... | ... | @@ -1241,12 +1242,10 @@ $canal - Identificador do canal (ordem em que está no RSS) |
1241 | 1242 | } |
1242 | 1243 | xbase_close($db); |
1243 | 1244 | $novoshpf->free(); |
1244 | - if ($tipol == MS_SHP_POINT) | |
1245 | + if ($tipog == "georsspoint" || $tipog == "geo") | |
1245 | 1246 | {$tipol = MS_LAYER_POINT;} |
1246 | - if ($tipol == MS_SHP_POLYGON) | |
1247 | + else | |
1247 | 1248 | {$tipol = MS_LAYER_POLYGON;} |
1248 | - if ($tipol == MS_SHP_LINE) | |
1249 | - {$tipol = MS_LAYER_LINE;} | |
1250 | 1249 | $layer = criaLayer($this->mapa,$tipol,MS_DEFAULT,"GeoRSS","SIM"); |
1251 | 1250 | $layer->set("data",$nomeshp.".shp"); |
1252 | 1251 | $layer->set("name",basename($nomeshp)); | ... | ... |