[postgis-devel] geographystyle feature request (external textual representation)

Malek,Christophe [CMC] Christophe.Malek at ec.gc.ca
Wed Sep 9 10:39:59 PDT 2015


Hi PostGIS devs,

I would like to make a feature request relating to the "external textual
representation" of the geography data type. In short, I would like to
request the provision of a directly human readable form as I believe it
may be the intention and possibly proper usage of having the "external
textual representation".

Currently it appears that the geography data type is represented
textually as something like
"010100008000000080EB5108400000006066662E400000000000005940" which means
little to nothing to the average human.

Obviously we can run the ST_AsText function to get another more readable
column but then we have two columns: one just for readability and
another that users actually work with to calculate distances etc. etc.
Or even worse, creating even more columns for users to work with using
ST_X, ST_Y, ST_Z.

I would like to request that we instead be able to set the "external
textual representation" of the geography data type to something more
human friendly such as to the output of ST_AsText. This would allow
users to better understand the data while at the same time allowing them
to work with it without additional conversion.

It is my understanding that this has been done in Postgres for the date
and interval data types using the commands:
"SET DATESTYLE TO ISO" etc. or
"SET INTERVALSTYLE TO POSTGRES" etc.

Postgis could perhaps include something similar:
"SET GEORAPHYSTYLE TO WKT", "SET GEOGRAPHYSTYLE TO POSTGIS", etc. or
something along those lines to give users some more options.

Please forgive me if there is already such a feature as I was not able
to find it after searching both google and the postgis forums. If there
is, then if you could please point me in the right direction and my
apologies.

If there isn't, then it might be interesting to hear back if people
would be interested in such a feature and even more interested to hear
back if somebody else is willing to develop it.

I unfortunately don't have time at the moment to implement it myself as
I am just at the early stages of testing Postgres/Postgis and converting
a very large dataset. But I believe such a feature might make Postgis an
even more digestible option for our end users and possibly others.

I understand there could be some precision related issues in converting
back and forth between internal storage and WKT format that users would
probably need to be aware of but in such cases users should probably be
using the "binary external representation" or the usual
geography/geometry constructors rather than "text external
representation" for construction anyway. Effectively, the text
representation is probably one of the worst ones to be working with from
a performance standpoint (due to all the extra parsing involved) so
should be possibly be discouraged in general for anything other than
convenience for human use anyway.

Looking forward to hearing from you,
Chris

Chris Malek
christophe.malek at ec.gc.ca
Data Assimilation Informatics
Canadian Meteorological Centre
2121 Trans Canada Highway
Dorval, Quebec
H9P 1J3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20150909/8f7a7cbc/attachment.html>


More information about the postgis-devel mailing list