[MDEV-2710] LP:848926 - GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY" Created: 2011-09-13  Updated: 2012-10-04  Resolved: 2012-10-04

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Philip Stoev (Inactive) Assignee: Alexey Botchkov
Resolution: Fixed Votes: 0
Labels: Launchpad

Attachments: XML File LPexportBug848926.xml    

 Description   

MariaDB [test]> select astext(ST_INTERSECTION( MULTILINESTRINGFROMTEXT(' MULTILINESTRING( (3 5, 2 4, 2 5, 3 5) ) ') , LINESTRINGFROMTEXT(' LINESTRING( 5 5 , 9 3 , 5 5 , 6 1 ) ') ))\G

                                                      • 1. row ***************************
                                                        astext(ST_INTERSECTION( MULTILINESTRINGFROMTEXT(' MULTILINESTRING( (3 5, 2 4, 2 5, 3 5) ) ') , LINESTRINGFROMTEXT(' LINESTRING( 5 5 , 9 3 , 5 5 , 6 1 ) ') )): GEOMETRYCOLLECTION()
                                                        1 row in set (0.00 sec)

GEOMETRYCOLLECTION() is not recognized by PostGIS as a valid value. PostGIS returns "GEOMETRYCOLLECTION EMPTY".

Also, trying to use GEOMETRYCOLLECTION() in a calculation results in a totally bogus result:

MariaDB [test]> SELECT ASTEXT(ENVELOPE(GEOMETRYFROMTEXT('GEOMETRYCOLLECTION()')))\G

                                                      • 1. row ***************************
                                                        ASTEXT(ENVELOPE(GEOMETRYFROMTEXT('GEOMETRYCOLLECTION()'))): POLYGON((1.79769313486232e+308 1.79769313486232e+308,-1.79769313486232e+308 1.79769313486232e+308,-1.79769313486232e+308 -1.79769313486232e+308,1.79769313486232e+308 -1.79769313486232e+308,1.79769313486232e+308 1.79769313486232e+308))


 Comments   
Comment by Philip Stoev (Inactive) [ 2011-09-21 ]

Re: GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY"
Same applies for other functions, e.g.

select ASTEXT(ST_DIFFERENCE( MULTIPOLYGONFROMTEXT(' MULTIPOLYGON( ( (3 5, 2 5, 2 4, 3 4, 3 5) ) ) ') , POLYGONFROMTEXT(' POLYGON( (3 5, 2 5, 2 4, 3 4, 3 5) ) ') )) ;

Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ]

Launchpad bug id: 848926

Generated at Thu Feb 08 06:43:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.