[postgis-devel] lwgeom switch

strk at refractions.net strk at refractions.net
Fri Aug 20 01:44:05 PDT 2004


Hi all,
I'm working on the switch to LWGEOM for geometry
internal representation.

What I've in mind is allowing old=>new transaction
trough the use of the new utils/postgis_restore.pl
script.

For this to work I produced a new postgis enabler
script (utils/lwpostgis.sql) which defines the
'geometry' type instead of the 'lwgeom' type defined
by lwgeom.sql.  This means that you cannot source
lwpostgis.sql in a postgis enabled database, but you
can use it in a new db.

I don't intend to mantain the lwgeom.sql script.

If you want to give a try to the lwgeom version
(still incomplete) you should be able to do something
like this:

	1) pg_dump -Fc <postgisdb> > /tmp/dump
	3) postgis_restore.pl lwpostgis.sql <lwpostgisdb> /tmp/dump

Note that <lwpostgisdb> must not exist. It will be created
by postgis_restore.pl

The new lwgeom version contains estimation code (bogus for pg80,
working for previous pg versions).
Also, you might find the mem_size function useful to compare old
and new representation:
	postgis=$ select sum(mem_size(the_geom)) from hugetable;
	lwpostgis=$ select sum(mem_size(the_geom)) from hugetable;

Happy hacking.

--strk;




More information about the postgis-devel mailing list