Opened 2 hours ago

#5822 new defect

Incorrect Output for ST_ASEWKT with "LINESTRING Z"

Reported by: bitner Owned by: pramsey
Priority: medium Milestone: PostGIS 3.5.1
Component: postgis Version: 3.4.x
Keywords: WKT Cc:

Description

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)

Change History (0)

Note: See TracTickets for help on using tickets.