From 5df74c289b4aba9be1398c936834afda64b77f0b Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Wed, 28 Oct 2015 13:06:00 +0000 Subject: [PATCH] --- ferramentas/editortema/exec.php | 19 ++++++++++++------- ferramentas/graficointerativo1/index.js | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ferramentas/editortema/exec.php b/ferramentas/editortema/exec.php index 3ca8a38..0cef71b 100755 --- a/ferramentas/editortema/exec.php +++ b/ferramentas/editortema/exec.php @@ -61,17 +61,22 @@ switch (strtoupper($funcao)) $dbh = new PDO('pgsql:dbname='.$c["dbname"].';user='.$c["user"].';password='.$c["password"].';host='.$c["host"].';port='.$c["port"]); //pega o SRID $sql = "select ST_SRID($colunageometria) as srid from $esquema"."."."$tabela LIMIT 1"; - //echo $sql;exit; $q = $dbh->query($sql,PDO::FETCH_ASSOC); $r = $q->fetchAll(); $srid = $r[0]["srid"]; - + if($srid == ""){ + $sql = "select srid from public.geometry_columns where f_table_schema = '$esquema' and f_table_name = '$tabela'"; + $q = $dbh->query($sql,PDO::FETCH_ASSOC); + $r = $q->fetchAll(); + $srid = $r[0]["srid"]; + if($srid == ""){ + $srid = -1; + } + } + $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $dbh->beginTransaction(); - if($srid == ""){ - $srid = "4326"; - } - + $sql = "INSERT INTO ".$esquema.".".$tabela." (".$colunageometria.")"; $sql .= " VALUES (ST_GeomFromText('SRID=$srid;".$wkt."'))"; @@ -186,4 +191,4 @@ if (!connection_aborted()){ } else {exit();} -?> \ No newline at end of file +?> diff --git a/ferramentas/graficointerativo1/index.js b/ferramentas/graficointerativo1/index.js index 4ce57cf..2cdb867 100755 --- a/ferramentas/graficointerativo1/index.js +++ b/ferramentas/graficointerativo1/index.js @@ -301,7 +301,7 @@ i3GEOF.graficointerativo1 = i3GEOF.graficointerativo1.LISTAREGATIVO = false; var n, i; par = i3GEO.util.base64decode(par); - //alert(par) + //console.info(par); par = YAHOO.lang.JSON.parse(par); n = par.length; for (i = 0; i < n; i++) { -- libgit2 0.21.2