Hi all,

Sandro,

More precisely, what we did is
- generated a dump of our old database
- uninstalled Postgis 1.5.2
- installed Postgis 1.5.3 
- Executed the perl script new_postgis_restore.pl which opened the dump and
created a sql script without the public schemes.

Therefore the sql script has reinstalled our entire database without
changing what was from public postgis 1.5.3

You can see the script in the attached file.

Me neither, I don't know why QGis is using a BOX3D but it doesn't seem to
call a BOX2D function.

And we're using the 9.0.3 postgresql version.

Thanks for your help

Dominique Le Cocq
----------------------------------------------------------------------

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: [email protected] – Web:
http://www.siig.fr
 
-----Message d'origine-----
De : [email protected]
[mailto:[email protected]] De la part de Sandro
Santilli
Envoyé : vendredi 23 septembre 2011 17:34
À : PostGIS Users Discussion
Objet : Re: [postgis-users] Trouble adding Postgis 1.5.3 layer to QGis

On Fri, Sep 23, 2011 at 05:27:27PM +0200, Sandro Santilli wrote:
> On Fri, Sep 23, 2011 at 04:15:10PM +0200, [email protected] 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
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Attachment: new_postgis_restore.pl
Description: Binary data

_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to