[postgis-users] help setting up postgis
Nicolas Ribot
nicolas.ribot at gmail.com
Tue Aug 10 06:53:28 PDT 2010
> thank you for your help. And yet I have another question. When I try to
> insert my 3d points into a previously created, empty column it seems only a
> 2d point is stored. Here is what I did via psql:
>
> -----
> postgisdb=# INSERT INTO punkte (jan) VALUES (ST_makePoint(1.1,2.2,3.3));
> INSERT 0 1
> postgisdb=# SELECT * FROM punkte;
> id | jan
> ----+------------------------------------------------------------
> | 01010000809A9999999999F13F9A999999999901406666666666660A40
> (1 Zeile)
>
> postgisdb=# SELECT
> ST_AsText('01010000809A9999999999F13F9A999999999901406666666666660A40');
> st_astext
> ----------------
> POINT(1.1 2.2)
> (1 Zeile)
> -----
>
> In the last line only two dimensions are returned but I would have expected
> three. Any suggestions what I am doing wrong or how I can visualise the
> third one? At the moment I am learning the psql commands and postgis
> structure simultaneously, so please forgive me if I am missing anything
> simple.
>
>
Hello
st_astext is an OGC function supporting only 2D geometries.
To get the textual representation of the real object, use st_asewkt
(extended version of WKT, supporting more dimensions and SRID):
SELECT ST_AsEWkt('01010000809A9999999999F13F9A999999999901406666666666660A40');
(there is the binary equivalent: st_asEwkb(...) )
Nicolas
More information about the postgis-users
mailing list