From 9540a582f6b53fadcba4dba42c3b65806703aa25 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Wed, 11 Jan 2012 11:17:10 +0000 Subject: [PATCH] Add regress test for WKB (#1448) and enable the existing one for WKT git-svn-id: http://svn.osgeo.org/postgis/trunk@8770 b70326c6-7e19-0410-871a-916f4a2858ee --- regress/Makefile.in | 4 +- regress/wkb.sql | 229 +++++++++++++++++++++++++++++++++++++++++++ regress/wkb_expected | 54 ++++++++++ regress/wkt_expected | 15 +-- 4 files changed, 293 insertions(+), 9 deletions(-) create mode 100644 regress/wkb.sql create mode 100644 regress/wkb_expected diff --git a/regress/Makefile.in b/regress/Makefile.in index 8b1e957cd..2bc0ddb21 100644 --- a/regress/Makefile.in +++ b/regress/Makefile.in @@ -22,8 +22,6 @@ PATH := $(PGSQL_BINDIR):$(PATH) export PATH -#wkt \ - TESTS = \ loader/Point \ loader/PointM \ @@ -86,6 +84,8 @@ TESTS = \ dump \ dumppoints \ wmsservers_new \ + wkt \ + wkb \ tickets \ remove_repeated_points \ split \ diff --git a/regress/wkb.sql b/regress/wkb.sql new file mode 100644 index 000000000..f3043689a --- /dev/null +++ b/regress/wkb.sql @@ -0,0 +1,229 @@ +-- POINT +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'POINT EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'POINT Z EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'POINT M EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'POINT ZM EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'POINT(0 0)' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'POINT Z (1 2 3)' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'POINT M (1 2 3)' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'POINT ZM (1 2 3 4)' +::text as g ) as foo; + +-- MULTIPOINT +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTIPOINT EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTIPOINT Z EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTIPOINT M EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTIPOINT ZM EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTIPOINT((0 0), (2 0))' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTIPOINT Z ((0 0 0), (2 0 1))' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTIPOINT M ((0 0 2), (2 0 1))' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTIPOINT ZM ((0 1 2 3), (3 2 1 0))' +::text as g ) as foo; + +-- LINESTRING +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'LINESTRING EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'LINESTRING Z EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'LINESTRING M EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'LINESTRING ZM EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'LINESTRING(0 0, 1 1)' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'LINESTRING Z (0 0 2, 1 1 3)' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'LINESTRING M (0 0 2, 1 1 3)' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'LINESTRING ZM (0 0 2 3, 1 1 4 5)' +::text as g ) as foo; + +-- MULTILINESTRING +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTILINESTRING EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTILINESTRING Z EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTILINESTRING M EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTILINESTRING ZM EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTILINESTRING((0 0, 2 0))' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTILINESTRING((0 0, 2 0), (1 1, 2 2))' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTILINESTRING Z ((0 0 1, 2 0 2), (1 1 3, 2 2 4))' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTILINESTRING M ((0 0 1, 2 0 2), (1 1 3, 2 2 4))' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTILINESTRING ZM ((0 0 1 5, 2 0 2 4), (1 1 3 3, 2 2 4 2))' +::text as g ) as foo; + +-- POLYGON +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'POLYGON EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'POLYGON Z EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'POLYGON M EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'POLYGON ZM EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'POLYGON((0 0,1 0,1 1,0 1,0 0))' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'POLYGON((0 0,10 0,10 10,0 10,0 0),(2 2,2 5,5 5,5 2,2 2))' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'POLYGON Z ((0 0 1,10 0 2 ,10 10 2,0 10 2,0 0 1),(2 2 5 ,2 5 4,5 5 3,5 2 3,2 2 5))' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'POLYGON M ((0 0 1,10 0 2 ,10 10 2,0 10 2,0 0 1),(2 2 5 ,2 5 4,5 5 3,5 2 3,2 2 5))' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'POLYGON ZM ((0 0 1 -1,10 0 2 -2,10 10 2 -2,0 10 2 -4,0 0 1 -1),(2 2 5 0,2 5 4 1,5 5 3 2,5 2 3 1,2 2 5 0))' +::text as g ) as foo; + +-- MULTIPOLYGON +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTIPOLYGON EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTIPOLYGON Z EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTIPOLYGON M EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTIPOLYGON ZM EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(2 2,2 5,5 5,5 2,2 2)))' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTIPOLYGON Z (((0 0 3,10 0 3,10 10 3,0 10 3,0 0 3),(2 2 3,2 5 3,5 5 3,5 2 3,2 2 3)))' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTIPOLYGON M (((0 0 3,10 0 3,10 10 3,0 10 3,0 0 3),(2 2 3,2 5 3,5 5 3,5 2 3,2 2 3)))' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'MULTIPOLYGON ZM (((0 0 3 2,10 0 3 2,10 10 3 2,0 10 3 2,0 0 3 2),(2 2 3 2,2 5 3 2,5 5 3 2,5 2 3 2,2 2 3 2)))' +::text as g ) as foo; + +-- GEOMETRYCOLLECTION +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'GEOMETRYCOLLECTION EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'GEOMETRYCOLLECTION Z EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'GEOMETRYCOLLECTION M EMPTY' +::text as g ) as foo; +select g, encode(st_asbinary(g::geometry, 'ndr'), 'hex'), + encode(st_asbinary(g::geometry, 'xdr'), 'hex') FROM ( SELECT + 'GEOMETRYCOLLECTION ZM EMPTY' +::text as g ) as foo; diff --git a/regress/wkb_expected b/regress/wkb_expected new file mode 100644 index 000000000..5aef78ccc --- /dev/null +++ b/regress/wkb_expected @@ -0,0 +1,54 @@ +POINT EMPTY|010400000000000000|000000000400000000 +POINT Z EMPTY|010400000000000000|000000000400000000 +POINT M EMPTY|010400000000000000|000000000400000000 +POINT ZM EMPTY|010400000000000000|000000000400000000 +POINT(0 0)|010100000000000000000000000000000000000000|000000000100000000000000000000000000000000 +POINT Z (1 2 3)|01e9030000000000000000f03f00000000000000400000000000000840|00000003e93ff000000000000040000000000000004008000000000000 +POINT M (1 2 3)|01d1070000000000000000f03f00000000000000400000000000000840|00000007d13ff000000000000040000000000000004008000000000000 +POINT ZM (1 2 3 4)|01b90b0000000000000000f03f000000000000004000000000000008400000000000001040|0000000bb93ff0000000000000400000000000000040080000000000004010000000000000 +MULTIPOINT EMPTY|010400000000000000|000000000400000000 +MULTIPOINT Z EMPTY|01bc0b000000000000|0000000bbc00000000 +MULTIPOINT M EMPTY|01d407000000000000|00000007d400000000 +MULTIPOINT ZM EMPTY|01bc0b000000000000|0000000bbc00000000 +MULTIPOINT((0 0), (2 0))|010400000002000000010100000000000000000000000000000000000000010100000000000000000000400000000000000000|000000000400000002000000000100000000000000000000000000000000000000000140000000000000000000000000000000 +MULTIPOINT Z ((0 0 0), (2 0 1))|01ec0300000200000001e903000000000000000000000000000000000000000000000000000001e903000000000000000000400000000000000000000000000000f03f|00000003ec0000000200000003e900000000000000000000000000000000000000000000000000000003e9400000000000000000000000000000003ff0000000000000 +MULTIPOINT M ((0 0 2), (2 0 1))|01d40700000200000001d107000000000000000000000000000000000000000000000000004001d107000000000000000000400000000000000000000000000000f03f|00000007d40000000200000007d100000000000000000000000000000000400000000000000000000007d1400000000000000000000000000000003ff0000000000000 +MULTIPOINT ZM ((0 1 2 3), (3 2 1 0))|01bc0b00000200000001b90b00000000000000000000000000000000f03f0000000000000040000000000000084001b90b000000000000000008400000000000000040000000000000f03f0000000000000000|0000000bbc000000020000000bb900000000000000003ff0000000000000400000000000000040080000000000000000000bb9400800000000000040000000000000003ff00000000000000000000000000000 +LINESTRING EMPTY|010200000000000000|000000000200000000 +LINESTRING Z EMPTY|01ba0b000000000000|0000000bba00000000 +LINESTRING M EMPTY|01d207000000000000|00000007d200000000 +LINESTRING ZM EMPTY|01ba0b000000000000|0000000bba00000000 +LINESTRING(0 0, 1 1)|01020000000200000000000000000000000000000000000000000000000000f03f000000000000f03f|000000000200000002000000000000000000000000000000003ff00000000000003ff0000000000000 +LINESTRING Z (0 0 2, 1 1 3)|01ea03000002000000000000000000000000000000000000000000000000000040000000000000f03f000000000000f03f0000000000000840|00000003ea000000020000000000000000000000000000000040000000000000003ff00000000000003ff00000000000004008000000000000 +LINESTRING M (0 0 2, 1 1 3)|01d207000002000000000000000000000000000000000000000000000000000040000000000000f03f000000000000f03f0000000000000840|00000007d2000000020000000000000000000000000000000040000000000000003ff00000000000003ff00000000000004008000000000000 +LINESTRING ZM (0 0 2 3, 1 1 4 5)|01ba0b0000020000000000000000000000000000000000000000000000000000400000000000000840000000000000f03f000000000000f03f00000000000010400000000000001440|0000000bba0000000200000000000000000000000000000000400000000000000040080000000000003ff00000000000003ff000000000000040100000000000004014000000000000 +MULTILINESTRING EMPTY|010500000000000000|000000000500000000 +MULTILINESTRING Z EMPTY|01bd0b000000000000|0000000bbd00000000 +MULTILINESTRING M EMPTY|01d507000000000000|00000007d500000000 +MULTILINESTRING ZM EMPTY|01bd0b000000000000|0000000bbd00000000 +MULTILINESTRING((0 0, 2 0))|0105000000010000000102000000020000000000000000000000000000000000000000000000000000400000000000000000|0000000005000000010000000002000000020000000000000000000000000000000040000000000000000000000000000000 +MULTILINESTRING((0 0, 2 0), (1 1, 2 2))|0105000000020000000102000000020000000000000000000000000000000000000000000000000000400000000000000000010200000002000000000000000000f03f000000000000f03f00000000000000400000000000000040|00000000050000000200000000020000000200000000000000000000000000000000400000000000000000000000000000000000000002000000023ff00000000000003ff000000000000040000000000000004000000000000000 +MULTILINESTRING Z ((0 0 1, 2 0 2), (1 1 3, 2 2 4))|01ed0300000200000001ea0300000200000000000000000000000000000000000000000000000000f03f00000000000000400000000000000000000000000000004001ea03000002000000000000000000f03f000000000000f03f0000000000000840000000000000004000000000000000400000000000001040|00000003ed0000000200000003ea00000002000000000000000000000000000000003ff000000000000040000000000000000000000000000000400000000000000000000003ea000000023ff00000000000003ff00000000000004008000000000000400000000000000040000000000000004010000000000000 +MULTILINESTRING M ((0 0 1, 2 0 2), (1 1 3, 2 2 4))|01d50700000200000001d20700000200000000000000000000000000000000000000000000000000f03f00000000000000400000000000000000000000000000004001d207000002000000000000000000f03f000000000000f03f0000000000000840000000000000004000000000000000400000000000001040|00000007d50000000200000007d200000002000000000000000000000000000000003ff000000000000040000000000000000000000000000000400000000000000000000007d2000000023ff00000000000003ff00000000000004008000000000000400000000000000040000000000000004010000000000000 +MULTILINESTRING ZM ((0 0 1 5, 2 0 2 4), (1 1 3 3, 2 2 4 2))|01bd0b00000200000001ba0b00000200000000000000000000000000000000000000000000000000f03f0000000000001440000000000000004000000000000000000000000000000040000000000000104001ba0b000002000000000000000000f03f000000000000f03f000000000000084000000000000008400000000000000040000000000000004000000000000010400000000000000040|0000000bbd000000020000000bba00000002000000000000000000000000000000003ff0000000000000401400000000000040000000000000000000000000000000400000000000000040100000000000000000000bba000000023ff00000000000003ff0000000000000400800000000000040080000000000004000000000000000400000000000000040100000000000004000000000000000 +POLYGON EMPTY|010300000000000000|000000000300000000 +POLYGON Z EMPTY|01bb0b000000000000|0000000bbb00000000 +POLYGON M EMPTY|01d307000000000000|00000007d300000000 +POLYGON ZM EMPTY|01bb0b000000000000|0000000bbb00000000 +POLYGON((0 0,1 0,1 1,0 1,0 0))|0103000000010000000500000000000000000000000000000000000000000000000000f03f0000000000000000000000000000f03f000000000000f03f0000000000000000000000000000f03f00000000000000000000000000000000|00000000030000000100000005000000000000000000000000000000003ff000000000000000000000000000003ff00000000000003ff000000000000000000000000000003ff000000000000000000000000000000000000000000000 +POLYGON((0 0,10 0,10 10,0 10,0 0),(2 2,2 5,5 5,5 2,2 2))|010300000002000000050000000000000000000000000000000000000000000000000024400000000000000000000000000000244000000000000024400000000000000000000000000000244000000000000000000000000000000000050000000000000000000040000000000000004000000000000000400000000000001440000000000000144000000000000014400000000000001440000000000000004000000000000000400000000000000040|000000000300000002000000050000000000000000000000000000000040240000000000000000000000000000402400000000000040240000000000000000000000000000402400000000000000000000000000000000000000000000000000054000000000000000400000000000000040000000000000004014000000000000401400000000000040140000000000004014000000000000400000000000000040000000000000004000000000000000 +POLYGON Z ((0 0 1,10 0 2 ,10 10 2,0 10 2,0 0 1),(2 2 5 ,2 5 4,5 5 3,5 2 3,2 2 5))|01eb030000020000000500000000000000000000000000000000000000000000000000f03f00000000000024400000000000000000000000000000004000000000000024400000000000002440000000000000004000000000000000000000000000002440000000000000004000000000000000000000000000000000000000000000f03f05000000000000000000004000000000000000400000000000001440000000000000004000000000000014400000000000001040000000000000144000000000000014400000000000000840000000000000144000000000000000400000000000000840000000000000004000000000000000400000000000001440|00000003eb0000000200000005000000000000000000000000000000003ff0000000000000402400000000000000000000000000004000000000000000402400000000000040240000000000004000000000000000000000000000000040240000000000004000000000000000000000000000000000000000000000003ff000000000000000000005400000000000000040000000000000004014000000000000400000000000000040140000000000004010000000000000401400000000000040140000000000004008000000000000401400000000000040000000000000004008000000000000400000000000000040000000000000004014000000000000 +POLYGON M ((0 0 1,10 0 2 ,10 10 2,0 10 2,0 0 1),(2 2 5 ,2 5 4,5 5 3,5 2 3,2 2 5))|01d3070000020000000500000000000000000000000000000000000000000000000000f03f00000000000024400000000000000000000000000000004000000000000024400000000000002440000000000000004000000000000000000000000000002440000000000000004000000000000000000000000000000000000000000000f03f05000000000000000000004000000000000000400000000000001440000000000000004000000000000014400000000000001040000000000000144000000000000014400000000000000840000000000000144000000000000000400000000000000840000000000000004000000000000000400000000000001440|00000007d30000000200000005000000000000000000000000000000003ff0000000000000402400000000000000000000000000004000000000000000402400000000000040240000000000004000000000000000000000000000000040240000000000004000000000000000000000000000000000000000000000003ff000000000000000000005400000000000000040000000000000004014000000000000400000000000000040140000000000004010000000000000401400000000000040140000000000004008000000000000401400000000000040000000000000004008000000000000400000000000000040000000000000004014000000000000 +POLYGON ZM ((0 0 1 -1,10 0 2 -2,10 10 2 -2,0 10 2 -4,0 0 1 -1),(2 2 5 0,2 5 4 1,5 5 3 2,5 2 3 1,2 2 5 0))|01bb0b0000020000000500000000000000000000000000000000000000000000000000f03f000000000000f0bf00000000000024400000000000000000000000000000004000000000000000c000000000000024400000000000002440000000000000004000000000000000c000000000000000000000000000002440000000000000004000000000000010c000000000000000000000000000000000000000000000f03f000000000000f0bf050000000000000000000040000000000000004000000000000014400000000000000000000000000000004000000000000014400000000000001040000000000000f03f0000000000001440000000000000144000000000000008400000000000000040000000000000144000000000000000400000000000000840000000000000f03f0000000000000040000000000000004000000000000014400000000000000000|0000000bbb0000000200000005000000000000000000000000000000003ff0000000000000bff0000000000000402400000000000000000000000000004000000000000000c000000000000000402400000000000040240000000000004000000000000000c000000000000000000000000000000040240000000000004000000000000000c010000000000000000000000000000000000000000000003ff0000000000000bff00000000000000000000540000000000000004000000000000000401400000000000000000000000000004000000000000000401400000000000040100000000000003ff000000000000040140000000000004014000000000000400800000000000040000000000000004014000000000000400000000000000040080000000000003ff00000000000004000000000000000400000000000000040140000000000000000000000000000 +MULTIPOLYGON EMPTY|010600000000000000|000000000600000000 +MULTIPOLYGON Z EMPTY|01be0b000000000000|0000000bbe00000000 +MULTIPOLYGON M EMPTY|01d607000000000000|00000007d600000000 +MULTIPOLYGON ZM EMPTY|01be0b000000000000|0000000bbe00000000 +MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(2 2,2 5,5 5,5 2,2 2)))|010600000001000000010300000002000000050000000000000000000000000000000000000000000000000024400000000000000000000000000000244000000000000024400000000000000000000000000000244000000000000000000000000000000000050000000000000000000040000000000000004000000000000000400000000000001440000000000000144000000000000014400000000000001440000000000000004000000000000000400000000000000040|000000000600000001000000000300000002000000050000000000000000000000000000000040240000000000000000000000000000402400000000000040240000000000000000000000000000402400000000000000000000000000000000000000000000000000054000000000000000400000000000000040000000000000004014000000000000401400000000000040140000000000004014000000000000400000000000000040000000000000004000000000000000 +MULTIPOLYGON Z (((0 0 3,10 0 3,10 10 3,0 10 3,0 0 3),(2 2 3,2 5 3,5 5 3,5 2 3,2 2 3)))|01ee0300000100000001eb030000020000000500000000000000000000000000000000000000000000000000084000000000000024400000000000000000000000000000084000000000000024400000000000002440000000000000084000000000000000000000000000002440000000000000084000000000000000000000000000000000000000000000084005000000000000000000004000000000000000400000000000000840000000000000004000000000000014400000000000000840000000000000144000000000000014400000000000000840000000000000144000000000000000400000000000000840000000000000004000000000000000400000000000000840|00000003ee0000000100000003eb000000020000000500000000000000000000000000000000400800000000000040240000000000000000000000000000400800000000000040240000000000004024000000000000400800000000000000000000000000004024000000000000400800000000000000000000000000000000000000000000400800000000000000000005400000000000000040000000000000004008000000000000400000000000000040140000000000004008000000000000401400000000000040140000000000004008000000000000401400000000000040000000000000004008000000000000400000000000000040000000000000004008000000000000 +MULTIPOLYGON M (((0 0 3,10 0 3,10 10 3,0 10 3,0 0 3),(2 2 3,2 5 3,5 5 3,5 2 3,2 2 3)))|01d60700000100000001d3070000020000000500000000000000000000000000000000000000000000000000084000000000000024400000000000000000000000000000084000000000000024400000000000002440000000000000084000000000000000000000000000002440000000000000084000000000000000000000000000000000000000000000084005000000000000000000004000000000000000400000000000000840000000000000004000000000000014400000000000000840000000000000144000000000000014400000000000000840000000000000144000000000000000400000000000000840000000000000004000000000000000400000000000000840|00000007d60000000100000007d3000000020000000500000000000000000000000000000000400800000000000040240000000000000000000000000000400800000000000040240000000000004024000000000000400800000000000000000000000000004024000000000000400800000000000000000000000000000000000000000000400800000000000000000005400000000000000040000000000000004008000000000000400000000000000040140000000000004008000000000000401400000000000040140000000000004008000000000000401400000000000040000000000000004008000000000000400000000000000040000000000000004008000000000000 +MULTIPOLYGON ZM (((0 0 3 2,10 0 3 2,10 10 3 2,0 10 3 2,0 0 3 2),(2 2 3 2,2 5 3 2,5 5 3 2,5 2 3 2,2 2 3 2)))|01be0b00000100000001bb0b00000200000005000000000000000000000000000000000000000000000000000840000000000000004000000000000024400000000000000000000000000000084000000000000000400000000000002440000000000000244000000000000008400000000000000040000000000000000000000000000024400000000000000840000000000000004000000000000000000000000000000000000000000000084000000000000000400500000000000000000000400000000000000040000000000000084000000000000000400000000000000040000000000000144000000000000008400000000000000040000000000000144000000000000014400000000000000840000000000000004000000000000014400000000000000040000000000000084000000000000000400000000000000040000000000000004000000000000008400000000000000040|0000000bbe000000010000000bbb0000000200000005000000000000000000000000000000004008000000000000400000000000000040240000000000000000000000000000400800000000000040000000000000004024000000000000402400000000000040080000000000004000000000000000000000000000000040240000000000004008000000000000400000000000000000000000000000000000000000000000400800000000000040000000000000000000000540000000000000004000000000000000400800000000000040000000000000004000000000000000401400000000000040080000000000004000000000000000401400000000000040140000000000004008000000000000400000000000000040140000000000004000000000000000400800000000000040000000000000004000000000000000400000000000000040080000000000004000000000000000 +GEOMETRYCOLLECTION EMPTY|010700000000000000|000000000700000000 +GEOMETRYCOLLECTION Z EMPTY|01bf0b000000000000|0000000bbf00000000 +GEOMETRYCOLLECTION M EMPTY|01d707000000000000|00000007d700000000 +GEOMETRYCOLLECTION ZM EMPTY|01bf0b000000000000|0000000bbf00000000 diff --git a/regress/wkt_expected b/regress/wkt_expected index 3846073dd..e959d7814 100644 --- a/regress/wkt_expected +++ b/regress/wkt_expected @@ -1,17 +1,17 @@ -GEOMETRYCOLLECTION EMPTY +POINT EMPTY ERROR: parse error - invalid geometry HINT: "POINT(EMPTY" <-- parse error at position 11 within geometry POINT(0 0) ERROR: parse error - invalid geometry HINT: "POINT((" <-- parse error at position 7 within geometry -GEOMETRYCOLLECTION EMPTY +MULTIPOINT EMPTY ERROR: parse error - invalid geometry HINT: "MULTIPOINT(EMPTY" <-- parse error at position 16 within geometry MULTIPOINT(0 0,2 0) MULTIPOINT(0 0,2 0) ERROR: parse error - invalid geometry HINT: "MULTIPOINT((0 0), (2 0), EMPTY" <-- parse error at position 30 within geometry -GEOMETRYCOLLECTION EMPTY +LINESTRING EMPTY ERROR: parse error - invalid geometry HINT: "LINESTRING(EMPTY" <-- parse error at position 16 within geometry LINESTRING(0 0,1 1) @@ -19,7 +19,7 @@ ERROR: parse error - invalid geometry HINT: "LINESTRING((" <-- parse error at position 12 within geometry ERROR: parse error - invalid geometry HINT: "LINESTRING((" <-- parse error at position 12 within geometry -GEOMETRYCOLLECTION EMPTY +MULTILINESTRING EMPTY ERROR: parse error - invalid geometry HINT: "MULTILINESTRING(EMPTY" <-- parse error at position 21 within geometry ERROR: parse error - invalid geometry @@ -30,18 +30,19 @@ ERROR: parse error - invalid geometry HINT: "...ESTRING((0 0, 2 0), (1 1, 2 2), EMPTY" <-- parse error at position 45 within geometry ERROR: parse error - invalid geometry HINT: "...STRING((0 0, 2 0), (1 1, 2 2), (EMPTY" <-- parse error at position 46 within geometry -GEOMETRYCOLLECTION EMPTY +POLYGON EMPTY ERROR: parse error - invalid geometry HINT: "POLYGON(EMPTY" <-- parse error at position 13 within geometry POLYGON((0 0,1 0,1 1,0 1,0 0)) POLYGON((0 0,10 0,10 10,0 10,0 0),(2 2,2 5,5 5,5 2,2 2)) -GEOMETRYCOLLECTION EMPTY +MULTIPOLYGON EMPTY ERROR: parse error - invalid geometry HINT: "MULTIPOLYGON(EMPTY" <-- parse error at position 18 within geometry ERROR: parse error - invalid geometry HINT: "MULTIPOLYGON((EMPTY" <-- parse error at position 19 within geometry MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(2 2,2 5,5 5,5 2,2 2))) GEOMETRYCOLLECTION EMPTY -GEOMETRYCOLLECTION EMPTY +ERROR: parse error - invalid geometry +HINT: "GEOMETRYCOLLECTION(EMPTY" <-- parse error at position 24 within geometry ERROR: parse error - invalid geometry HINT: "GEOMETRYCOLLECTION((" <-- parse error at position 20 within geometry -- 2.40.0