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

Sandro Santilli strk at keybit.net
Fri Sep 23 05:25:31 PDT 2011


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



More information about the postgis-users mailing list