[postgis-users] Input on upgrade to GIS database
Markus Schaber
schabi at logix-tt.com
Fri Nov 18 09:53:14 PST 2005
Hi, Onyx,
Onyx schrieb:
> Gregory, Dylan, Darren, or anyone else,
> So, is the postgis_restore.pl script converting the geometry data to binary?
> Or is this done somewhere else? Regardless, is there a way to avoid the
> conversion, for legacy code reasons? I would like to keep the geometries as
> ASCII.
It is the internal storage format as well as the so-called canonical
representation that has changed between postgis 0.x and 1.x. This
representation was not meant to be processed by client software
directly, apart from database interface drivers.
If you need the text representation, you can use the OpenGIS compliant
asText() and getSRID() functions which are not only immune to postgis
internal changes, but also compatible with other OpenGIS compliant
databases, as well as the PostGIS extended asEWKT().
Another way is to use the adaptor interfaces for your programming
language (like the pgjdbc extension delivered with postgis or the others
e. G. for python and php announced here on the list) - they abstract
over the database internal representations.
If you really need to run an old, unchangeable application against a new
PostGIS database, you can rename all your GIS tables and replace them by
views that provide the translated data, via the asEWKT() function. If
your application needs write access, you have to create the appropriate
ON ... DO INSTEAD rules for the view, and it may be necessary to
explicitly expose the legacy OID column in the view.
Markus
More information about the postgis-users
mailing list