Re: [postgis-users] PostGIS Geometry column

From: Oleg <evdakov(at)iwk(dot)uka(dot)de>
To: PostGIS Users Discussion <postgis-users(at)postgis(dot)refractions(dot)net>, pgsql-novice(at)postgresql(dot)org
Subject: Re: [postgis-users] PostGIS Geometry column
Date: 2006-02-20 10:27:01
Message-ID: 43F99975.9080705@iwk.uka.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi Nikolas, Hi Michael,
Thanks a lot for your help. I think asText function could do the job we
need.
Best regards
Oleg

Nicolas Ribot schrieb:

>>Dear All,
>>While workin with PostgreSQL 7.4.6 Geometry was stored as String for
>>example:
>>SRID=-1;POINT(135.744865606022 304.591390378093)
>>Now we have installed PostgreSQL 8.1.3. and included in the installer
>>PostGIS.
>>Geometries are stored in a different format for example:
>>01010000003E580C9953964A41F76AF257F9CD5441
>>Is there a way to set up PostgreSQL8.1 or PostGIS to store geometries in
>>String format as it was prviously?
>>Thanks a lot in advance
>>Oleg
>>
>>
>>
>
>Hi Oleg.
>I don't think it is possible. Postgis changed the way it stores
>geometries internally, for space and performanace reason, if I
>remenber well.
>This format also avoids coordinate precision reduction as it could
>happen with a textual format.
>You can still display geometries as text by calling textual
>representation functions when selecting geometries:
>asText() (so srid displayed, OGS-compliant function)
>asEXKT (srid dislpayed before the geometry).
>
>Nicolas
>_______________________________________________
>postgis-users mailing list
>postgis-users(at)postgis(dot)refractions(dot)net
>http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>

To make some light on the question:

PostGIS *NEVER* stored geometries in Text format.
Internal representation has always been in binary form.

The difference between 0.x and 1.x is the
*canonical text output representation*

The canonical text output representation is what you get
when fetching a Geometry object from a text cursor. This
is what you get with the 'psql' monitor application, for
example.

Most importantly, canonical text output representation is
the representation used when *dumping* a database. This
is the exact reason why it changed betseen 0.x and 1.x:
to allow lossless dump/restore operations.

I hope this clarify things.

--strk;

Michael Fuhr schrieb:

PostGIS is a separate project from PostgreSQL so you'd be better off
asking questions about it on the postgis-users mailing list.

http://postgis.refractions.net/mailman/listinfo/postgis-users

The change you're seeing is due to a different version of PostGIS,
not a different version of PostgreSQL. Recent versions of PostGIS
(since 1.0, I think) display a different "canonical form" than older
versions did; search the postgis-users and postgis-devel archives
for discussion and rationale. You can use the AsText or AsEWKT
functions to get the Well-Known Text representation:

postgis=> SELECT geom, AsText(geom) FROM foo;
geom | astext
--------------------------------------------+------------------------
010100000077BE9F1A2FDD5E40AC1C5A643BDD8E40 | POINT(123.456 987.654)
(1 row)

Browse pgsql-novice by date

  From Date Subject
Next Message Zouari Fourat 2006-02-20 10:31:00 inserting a value as null
Previous Message A. Kretschmer 2006-02-20 10:02:38 Re: get the inserted row id