[postgis-users] Trouble adding Postgis 1.5.3 layer to QGis

Dominique LE COCQ technique at siig.fr
Fri Sep 23 06:19:36 PDT 2011


Hi
Thanks for your answer. We were using PostGis 1.5.2 before upgrading, and it
used to work properly with QGis. 
The problem is that there is no setsrid function calling for a (BOX3D,
integer) in postgis 1.5.3 (nor in postgis 1.5.2), but it is what QGis is
asking each time we're trying to load postgis layer to QGis.

In fact, it seems that in postgis 1.5.3 the BoX3D element doesn't derive
from the geometry type. 
DLC
----------------------------------------------------------------------

Dominique LE COCQ – Technicienne SIG
SiiG (Syndicat Intercommunal d’Information Géographique)

115 Avenue de la Roquette – ZA de Berret – 30 200 Bagnols-sur-Cèze

Tél: 04.66.90.58.00 – Fax: 04.66.82.98.35 – Mail: technique at siig.fr – Web:
http://www.siig.fr
 
-----Message d'origine-----
De : postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] De la part de Sandro
Santilli
Envoyé : vendredi 23 septembre 2011 14:26
À : PostGIS Users Discussion
Cc : dconstant at siig.fr
Objet : Re: [postgis-users] Trouble adding Postgis 1.5.3 layer to QGis

On Fri, Sep 23, 2011 at 09:34:01AM +0200, technique at siig.fr wrote:
> Hi every one
> 
> I'm using PostGis 1.5.3 and QGis 1.7 and I've troubles adding postgis
layers
> to QGis. 
> 
> In the error message given by QGis when I try to add postgis layers,
there's
> this query which doesn't work any longer although it used to work with
> PostGis 1.5.2: 
> ----------
> 
> select "oid",asbinary("geom",'NDR') from "cadastre"."commune" where "geom"
> && setsrid('BOX3D(794270.8532559783197939 6312919.8975825672969222,
> 860762.6940280217677355 6362904.3300199424847960)'::box3d,2154); 
> ------------
> After different tests I've found that I must use the geometry() function
to
> force the first parameter of the setsrid() function to convert into
> "geometry" type. 
> ----------
> select "oid",asbinary("geom",'NDR') from "cadastre"."commune" where "geom"
> && setsrid(geometry('BOX3D(794270.8532559783197939
6312919.8975825672969222,
> 860762.6940280217677355 6362904.3300199424847960)'::box3d),2154); 
> ----------
> 
> Is it a Postgis or a Qgis problem? How can I fix that? Since I've upgraded
> to Postgis 1.5.3, all my QGis projects are not working any more and the
QGis
> 1.7 doesn't work either (I was using Qgis 1.6 version when it first
> occurred, then I've installed the greater version but it didn't change a
> thing). 

What version of postgis were you running when it used to work ?
You may try dropping the implicit box3d->geography cast from your database.

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list