Ticket #1455 (closed task: fixed)

Opened 5 months ago

Last modified 4 months ago

ST_GeomFromText should understand ISO WKT

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 2.0.0
Component: postgis Version: trunk
Keywords: Cc:

Description

Following #287 we should make ST_GeomFromText symmetric in accepting the ISO WKT for higher dimensions.

Change History

Changed 4 months ago by strk

Uff...:

SELECT St_GeomFromText(ST_AsText(g::geometry))
FROM ( SELECT 'POINT ZM (0 0 0)' ::text as g ) as foo;

ERROR:  can not mix dimensionality in a geometry
HINT:  "POINT ZM (0 0 0)" <-- parse error at position 16 within geometry

Changed 4 months ago by strk

Ah, all fine, 'POINT ZM (0 0 0)' is actually a broken syntax :)

Changed 4 months ago by strk

Ok, this is a real bug:

select 'GEOMETRYCOLLECTION Z (MULTILINESTRING Z ((0 0 5, 2 0 5),(1 1 5, 2 2 5)))'::geometry;
ERROR:  can not mix dimensionality in a geometry

The MULTILINESTRING Z on itself is parsed right.

Changed 4 months ago by strk

The version with M instead of Z is also fine !

Changed 4 months ago by strk

  • owner changed from pramsey to strk
  • status changed from new to assigned

It looks like wkt_dimensionality is getting confused by the double Z...

wkt_parser_collection_finalize enter: flagdims:4, dimensionality:Z (MULTILINESTRING Z ((0 0 5, 2 0 5),(1 1 5, 2 2 5)))

Changed 4 months ago by strk

  • status changed from assigned to closed
  • resolution set to fixed

Fixed with r8788. The GeomFromText? function was actually fine, but there were bugs in underlying liblwgeom parser. Now fixed, and everything put under regression testing at both cunit and postgis levels.

Note: See TracTickets for help on using tickets.