[PostGIS] #5902: ST_PointFromText cannot create geometries with M dimension, but ST_GeomFromText can.

PostGIS trac at osgeo.org
Sun May 25 23:53:35 PDT 2025


#5902: ST_PointFromText cannot create geometries with M dimension, but
ST_GeomFromText can.
-----------------------------------------------+---------------------------
 Reporter:  dmyzl                              |      Owner:  pramsey
     Type:  defect                             |     Status:  new
 Priority:  medium                             |  Milestone:  PostGIS 3.5.4
Component:  postgis                            |    Version:  3.5.x
 Keywords:  ST_PointFromText, ST_LineFromText  |
-----------------------------------------------+---------------------------
 The result is null when using the `ST_GeomFromText` function to create a
 point with M dimension:

 {{{
 postgres=# select st_astext(ST_PointFromText ( 'point m (1 2 3)' , 4269
 ));
  st_astext
 -----------

 (1 row)

 postgres=#
 }}}

 However, using `ST_GeomFromText` returns the expected result:

 {{{
 postgres=# select st_astext(ST_GeomFromText ( 'point m (1 2 3)' , 4269 ));
     st_astext
 -----------------
  POINT M (1 2 3)
 (1 row)

 postgres=#
 }}}

 After testing, the following SQL also has the same issue:

 {{{
 select st_astext(ST_LineFromText ( 'linestring m (1 2 3, 2 3 4)' , 4269
 ));
 select st_astext(ST_polyFromText ( 'polygon m ((0 0 0, 0 1 0, 1 1 0, 0 0
 0))' , 4269 ));
 select st_astext(ST_MPointFromText ( 'MULTIPOINT m((1 2 3),(2 3 4))' ,
 4269 ));
 select st_astext(ST_MLineFromText ( 'MULTILINESTRING m((1 2 3, 2 3 4),(2 3
 4, 4 5 6))' , 4269 ));
 select st_astext(ST_MPolyFromText ( 'MULTIpolygon m (((0 0 0, 0 1 0, 1 1
 0, 0 0 0)), ((0 0 0, 0 1 0, 1 1 0, 0 0 0)))' , 4269 ));
 select st_astext(ST_GeomCollFromText ( 'GeometryCollection(point m (1 1
 1),polygon m ((1 1 1, 2 1 1, 3 2 1, 4 2 1, 1 1 1)))' , 4269 ));
 }}}

 PG Version:17.4

 postgis_full_version:

 {{{
 POSTGIS="3.5.2 dea6d0a" [EXTENSION] PGSQL="170" GEOS="3.13.1-CAPI-1.19.2"
 SFCGAL="SFCGAL 1.5.0, CGAL 5.6, BOOST 1.74.0" PROJ="9.3.1
 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org
 USER_WRITABLE_DIRECTORY=/home/yzl/.local/share/proj
 DATABASE_PATH=/home/yzl/project/build_pg_postgis/proj-9.3.1/tmp_install/share/proj/proj.db"
 (compiled against PROJ 9.3.1) LIBXML="2.9.13" LIBJSON="0.17"
 LIBPROTOBUF="1.3.3" WAGYU="0.5.0 (Internal)"
 }}}
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5902>
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