[PostGIS] #5822: Incorrect Output for ST_ASEWKT with "LINESTRING Z"

PostGIS trac at osgeo.org
Mon Dec 16 11:38:06 PST 2024


#5822: Incorrect Output for ST_ASEWKT with "LINESTRING Z"
---------------------+---------------------------
 Reporter:  bitner   |      Owner:  pramsey
     Type:  defect   |     Status:  new
 Priority:  medium   |  Milestone:  PostGIS 3.5.1
Component:  postgis  |    Version:  3.4.x
 Keywords:  WKT      |
---------------------+---------------------------
 ST_AsEWKT does not report the geometry type correctly and reports
 differently than ST_AsText. See below to reproduce. ST_AsEWKT returns
 "LINESTRING" where it should return "LINESTRING Z".

 postgres=# select postgis_full_version();
 postgis_full_version
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  POSTGIS="3.5.0 d2c3ca4" [EXTENSION] PGSQL="170" GEOS="3.9.0-CAPI-1.16.2"
 PROJ="7.2.1 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org
 USER_WRITABLE_DIRECTORY=/var/lib/postgresql/.local/share/proj
 DATABASE_PATH=/usr/share/proj/proj.db" (compiled against PROJ 7.9.0)
 LIBXML="2.9.10" LIBJSON="0.15" LIBPROTOBUF="1.3.3" WAGYU="0.5.0
 (Internal)" TOPOLOGY
 (1 row)

 postgres=# SELECT ST_Astext(ST_GeomFromText('LINESTRING Z(-71.160281
 42.258729 1.0,-71.160837 42.259113 2.0,-71.161144 42.25932 3.0)'));
                                      st_astext
 ------------------------------------------------------------------------------------
  LINESTRING Z (-71.160281 42.258729 1,-71.160837 42.259113 2,-71.161144
 42.25932 3)
 (1 row)

 postgres=# SELECT ST_AsEWKT(ST_GeomFromText('LINESTRING Z(-71.160281
 42.258729 1.0,-71.160837 42.259113 2.0,-71.161144 42.25932 3.0)'));
                                     st_asewkt
 ---------------------------------------------------------------------------------
  LINESTRING(-71.160281 42.258729 1,-71.160837 42.259113 2,-71.161144
 42.25932 3)
 (1 row)
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5822>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list