Commit 5df74c289b4aba9be1398c936834afda64b77f0b

Authored by Edmar Moretti
1 parent d7cf31ff

--no commit message

ferramentas/editortema/exec.php
... ... @@ -61,17 +61,22 @@ switch (strtoupper($funcao))
61 61 $dbh = new PDO('pgsql:dbname='.$c["dbname"].';user='.$c["user"].';password='.$c["password"].';host='.$c["host"].';port='.$c["port"]);
62 62 //pega o SRID
63 63 $sql = "select ST_SRID($colunageometria) as srid from $esquema"."."."$tabela LIMIT 1";
64   - //echo $sql;exit;
65 64 $q = $dbh->query($sql,PDO::FETCH_ASSOC);
66 65 $r = $q->fetchAll();
67 66 $srid = $r[0]["srid"];
68   -
  67 + if($srid == ""){
  68 + $sql = "select srid from public.geometry_columns where f_table_schema = '$esquema' and f_table_name = '$tabela'";
  69 + $q = $dbh->query($sql,PDO::FETCH_ASSOC);
  70 + $r = $q->fetchAll();
  71 + $srid = $r[0]["srid"];
  72 + if($srid == ""){
  73 + $srid = -1;
  74 + }
  75 + }
  76 +
69 77 $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
70 78 $dbh->beginTransaction();
71   - if($srid == ""){
72   - $srid = "4326";
73   - }
74   -
  79 +
75 80 $sql = "INSERT INTO ".$esquema.".".$tabela." (".$colunageometria.")";
76 81 $sql .= " VALUES (ST_GeomFromText('SRID=$srid;".$wkt."'))";
77 82  
... ... @@ -186,4 +191,4 @@ if (!connection_aborted()){
186 191 }
187 192 else
188 193 {exit();}
189   -?>
190 194 \ No newline at end of file
  195 +?>
... ...
ferramentas/graficointerativo1/index.js
... ... @@ -301,7 +301,7 @@ i3GEOF.graficointerativo1 =
301 301 i3GEOF.graficointerativo1.LISTAREGATIVO = false;
302 302 var n, i;
303 303 par = i3GEO.util.base64decode(par);
304   - //alert(par)
  304 + //console.info(par);
305 305 par = YAHOO.lang.JSON.parse(par);
306 306 n = par.length;
307 307 for (i = 0; i < n; i++) {
... ...