Opened 12 years ago

Closed 12 years ago

#1455 closed task (fixed)

ST_GeomFromText should understand ISO WKT

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

Description

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

Change History (6)

comment:1 by strk, 12 years ago

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

comment:2 by strk, 12 years ago

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

comment:3 by strk, 12 years ago

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.

comment:4 by strk, 12 years ago

The version with M instead of Z is also fine !

comment:5 by strk, 12 years ago

Owner: changed from pramsey to strk
Status: newassigned

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)))

comment:6 by strk, 12 years ago

Resolution: fixed
Status: assignedclosed

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.