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

Sandro Santilli strk at keybit.net
Fri Sep 23 08:27:27 PDT 2011


On Fri, Sep 23, 2011 at 04:15:10PM +0200, technique at siig.fr wrote:

> We could load postgis layers to QGis when we had postgis 1.5.2, yes, but it
> doesn’t work any more with the 1.5.3 version.
> 
> The error message that we get from QGis when we try to load layers is:
> --------------------
> 1 cursor states lost.
> SQL: declare qgisf1 binary cursor for select "oid",asbinary("geom",'NDR')
> from "cadastre"."q_cadastre_commune" where "geom" &&
> setsrid('BOX3D(794270.6350231178803369 6312919.8874999880790710,
> 860762.8649768828181550 6362904.6124999895691872)'::box3d,2154) and
> (GeometryType("geom") IN ('POLYGON','MULTIPOLYGON'))
> Résultat: 7 (ERROR: function setsrid(box3d, integer) does not exist
> LINE 1: ...m "cadastre"."q_cadastre_commune" where "geom" && setsrid('B...
> ^
> HINT: No function matches the given name and argument types. You might need
> to add explicit type casts.
> )
> ---------------------
> We had though that "there's never been a SetSRID taking BOX3D, but implicit
> casts transformed that BOX3D into a GEOMETRY, passing the latter to
> SetSRID.” But it seems that it no longer works like that in the 1.5.3
> version? But still, Qgis is waiting for a geometry coming from the setsrid
> (through box3D) function.
> 
> To answer your question, what we did is:
> - First uninstalled completely postgis 1.5.2
> - Then installed postgis 1.5.3
> - Then loaded our database from 1.5.2 to 1.5.3 version using the perl script
> called new_postgis_restore.pl
> This script is supposed to transfer a database from the Postgis 1.5.2 to the
> Postgis 1.5.3 version.
> 
> Would there be a problem doing so?

Could you please file a trac ticket about this ?
It may be calling for a 1.5.4 ...

It's possible 1.5.3 dropped some cast, I'm not sure (should check).
But also I wonder why qgis makes use of a BOX3D rather than a BOX2D.
Does a BOX2D work fine for you ?

Also, which postgresql version are you on ?

--strk; 

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html



More information about the postgis-users mailing list