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

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


On Fri, Sep 23, 2011 at 05:27:27PM +0200, Sandro Santilli wrote:
> 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 ?

I've checked with a fresh database enabled with a postgis from the 1.5 branch
and I do have the casts in place:

psql (8.4.8)
Type "help" for help.


test15=# select st_summary(setsrid('BOX3D(0 0, 10 0)'::box3d, 1));
          st_summary
------------------------------

 LineString[BS] with 2 points

Versions:

 POSTGIS="1.5.3SVN" GEOS="3.3.1dev-CAPI-1.7.1" PROJ="Rel. 4.7.1, 23 September 2009" LIBXML="2.7.6" USE_STATS

 PostgreSQL 8.4.8 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real (Ubuntu 4.4.3-4ubuntu5) 4.4.3, 64-bit


--strk;

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



More information about the postgis-users mailing list