Unix Technical Forum

Re: [postgis-users] PostGIS Geometry column

This is a discussion on Re: [postgis-users] PostGIS Geometry column within the pgsql Novice forums, part of the PostgreSQL category; --> Hi Nikolas, Hi Michael, Thanks a lot for your help. I think asText function could do the job we ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 09:36 PM
Oleg
 
Posts: n/a
Default Re: [postgis-users] PostGIS Geometry column

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@postgis.refractions.net
>http://postgis.refractions.net/mailm.../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/mailm.../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)




---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:17 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com