Current Path : /home/usr.opt/mysql57/mysql-test/suite/gis/r/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //home/usr.opt/mysql57/mysql-test/suite/gis/r/spatial_analysis_functions_area.result |
# Creating the spatial Geometry object USE test; CREATE TABLE gis_geometrycollection (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRY); SET @star_elem_vertical= 'POLYGON((5 0,15 25,25 0,15 5,5 0))'; SET @star_elem_horizontal= 'POLYGON((25 0,0 15,30 15,22 10,25 0))'; SET @star_center= 'POINT(15 10)'; SET @star_top= 'POINT(15 25)'; SET @star_bottom_left= 'POINT(5 0)'; SET @star_bottom_right= 'POINT(25 0)'; SET @star_bottom_points= 'MULTIPOINT(5 0,25 0)'; SET @star_all_points= 'MULTIPOINT(5 0,25 0,15 10,15 25)'; SET @star_line_horizontal= 'LINESTRING(10 15,20 15)'; SET @star_line_vertical= 'LINESTRING(15 5,15 25)'; SET @star_top_to_center= 'LINESTRING(15 25,15 10)'; SET @star_lines_near_horizontal= 'MULTILINESTRING((25 0,0 15,15 30,0 5))'; SET @star_lines_near_vertical= 'MULTILINESTRING((0 5,15 25,0 25))'; SET @star= 'POLYGON((5 0,7 10,0 15,10 15,15 25,20 15,30 15,22 10,25 0,15 5,5 0))'; SET @star_elem_vertical_val= '((5 0,15 25,25 0,15 5,5 0))'; SET @star_elem_horizontal_val= '((25 0,0 15,30 15,22 10,25 0))'; SET @star_of_elems='MULTIPOLYGON(((5 0,15 25,25 0,15 5,5 0)),((25 0,0 15,30 15,22 10,25 0)))'; SET @star_collection_elems='GEOMETRYCOLLECTION(MULTIPOLYGON(((5 0,15 25,25 0,15 5,5 0)),((25 0,0 15,30 15,22 10,25 0))),POLYGON((5 0,7 10,0 15,10 15,15 25,20 15,30 15,22 10,25 0,15 5,5 0)),LINESTRING(15 25,15 10),MULTIPOINT(5 0,25 0),POINT(15 25))'; SET @star_collection_multilinestr='GEOMETRYCOLLECTION(MULTIPOLYGON(((5 0,15 25,25 0,15 5,5 0)),((25 0,0 15,30 15,22 10,25 0))),POLYGON((5 0,7 10,0 15,10 15,15 25,20 15,30 15,22 10,25 0,15 5,5 0)),MULTILINESTRING((25 0,0 15,15 30,0 5)),LINESTRING(15 25,15 10),MULTIPOINT(5 0,25 0),POINT(15 25))'; # INSERT base star INSERT INTO gis_geometrycollection VALUES (100,ST_GEOMFROMTEXT(@star)), (101,ST_GEOMFROMTEXT(@star_elem_vertical)), (102,ST_GEOMFROMTEXT(@star_elem_horizontal)), (103,ST_GEOMFROMTEXT(@star_of_elems)), (104,ST_GEOMFROMTEXT(@star_top)), (105,ST_GEOMFROMTEXT(@star_center)), (106,ST_GEOMFROMTEXT(@star_bottom_left)), (107,ST_GEOMFROMTEXT(@star_bottom_right)), (108,ST_GEOMFROMTEXT(@star_bottom_points)), (109,ST_GEOMFROMTEXT(@star_all_points)), (110,ST_GEOMFROMTEXT(@star_line_horizontal)), (111,ST_GEOMFROMTEXT(@star_line_vertical)), (112,ST_GEOMFROMTEXT(@star_top_to_center)), (113,ST_GEOMFROMTEXT(@star_lines_near_horizontal)), (114,ST_GEOMFROMTEXT(@star_lines_near_vertical)), (115,ST_GEOMFROMTEXT(@star_collection_elems)), (116,ST_GEOMFROMTEXT(@star_collection_multilinestr)); # Checking the integrity of the above create/insert statements # 17 rows. SELECT count(ST_ASTEXT(g) != 'NULL') FROM gis_geometrycollection; count(ST_ASTEXT(g) != 'NULL') 17 ##################################################################################### # ST_AREA(point) ##################################################################################### SELECT ST_AREA(ST_GEOMFROMTEXT(@star_center)); ST_AREA(ST_GEOMFROMTEXT(@star_center)) 0 SELECT ST_AREA(ST_GEOMFROMTEXT(@star_top)); ST_AREA(ST_GEOMFROMTEXT(@star_top)) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('POINT(2.34 -2.34)')); ST_AREA(ST_GEOMFROMTEXT('POINT(2.34 -2.34)')) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('POINT(1e308 -1e308)')); ST_AREA(ST_GEOMFROMTEXT('POINT(1e308 -1e308)')) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('POINT(-0.0000 0.000001)')); ST_AREA(ST_GEOMFROMTEXT('POINT(-0.0000 0.000001)')) 0 SELECT ST_AREA(g) FROM gis_geometrycollection WHERE fid=105; ST_AREA(g) 0 ##################################################################################### # ST_AREA(multipoint) ##################################################################################### SELECT ST_AREA(ST_GEOMFROMTEXT(@star_all_points)); ST_AREA(ST_GEOMFROMTEXT(@star_all_points)) 0 SELECT ST_AREA(ST_GEOMFROMTEXT(@star_bottom_points)); ST_AREA(ST_GEOMFROMTEXT(@star_bottom_points)) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 0,0 0,0 0)')); ST_AREA(ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 0,0 0,0 0)')) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 5,5 5,5 0,0 0)')); ST_AREA(ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 5,5 5,5 0,0 0)')) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('MULTIPOINT(1 -1,1e308 -1e308,0.0001 0.000)')); ST_AREA(ST_GEOMFROMTEXT('MULTIPOINT(1 -1,1e308 -1e308,0.0001 0.000)')) 0 SELECT ST_AREA(g) FROM gis_geometrycollection WHERE fid=108; ST_AREA(g) 0 ##################################################################################### # ST_AREA(linestring) ##################################################################################### SELECT ST_AREA(ST_GEOMFROMTEXT(@star_top_to_center)); ST_AREA(ST_GEOMFROMTEXT(@star_top_to_center)) 0 SELECT ST_AREA(ST_GEOMFROMTEXT(@star_line_horizontal)); ST_AREA(ST_GEOMFROMTEXT(@star_line_horizontal)) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('LINESTRING(0 0,-0.00 0,0.0 0)')); ST_AREA(ST_GEOMFROMTEXT('LINESTRING(0 0,-0.00 0,0.0 0)')) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)')); ST_AREA(ST_GEOMFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)')) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('LINESTRING(1 -1,1e308 -1e308,0.0001 0.000)')); ST_AREA(ST_GEOMFROMTEXT('LINESTRING(1 -1,1e308 -1e308,0.0001 0.000)')) 0 SELECT ST_AREA(g) FROM gis_geometrycollection WHERE fid=110; ST_AREA(g) 0 ##################################################################################### # ST_AREA(multilinestring) ##################################################################################### SELECT ST_AREA(ST_GEOMFROMTEXT(@star_lines_near_vertical)); ST_AREA(ST_GEOMFROMTEXT(@star_lines_near_vertical)) 0 SELECT ST_AREA(ST_GEOMFROMTEXT(@star_lines_near_horizontal)); ST_AREA(ST_GEOMFROMTEXT(@star_lines_near_horizontal)) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,-0.00 0),(0.0 0))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,0 5,5 5,5 0,0 0))')); ST_AREA(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,0 5,5 5,5 0,0 0))')) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('MULTILINESTRING((0 10,10 0),(10 0,0 0),(0 0,10 10))')); ST_AREA(ST_GEOMFROMTEXT('MULTILINESTRING((0 10,10 0),(10 0,0 0),(0 0,10 10))')) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('MULTILINESTRING((1 -1,1e308 -1e308,0.0001 0.000),(2 2,4 -9.002))')); ST_AREA(ST_GEOMFROMTEXT('MULTILINESTRING((1 -1,1e308 -1e308,0.0001 0.000),(2 2,4 -9.002))')) 0 SELECT ST_AREA(g) FROM gis_geometrycollection WHERE fid=114; ST_AREA(g) 0 ##################################################################################### # ST_AREA(polygon) ##################################################################################### SELECT ST_AREA(ST_GEOMFROMTEXT(@star)); ST_AREA(ST_GEOMFROMTEXT(@star)) 287.5 SELECT ST_AREA(ST_GEOMFROMTEXT(@star_elem_vertical)); ST_AREA(ST_GEOMFROMTEXT(@star_elem_vertical)) 200 SELECT ST_AREA(ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5, 0 0))')); ST_AREA(ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5, 0 0))')) 12.5 SELECT ST_AREA(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0))')); ST_AREA(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0))')) 100 SELECT ST_AREA(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,-10 0,-10 -10,0 -10, 0 0))')); ST_AREA(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,-10 0,-10 -10,0 -10, 0 0))')) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))')); ST_AREA(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))')) 96 SELECT ST_AREA(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(0 0,0 10,10 10,10 0,0 0))')); ST_AREA(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(0 0,0 10,10 10,10 0,0 0))')) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('POLYGON((4 4,4 6,6 6,6 4,4 4),(0 0,0 10,10 10,10 0,0 0))')); ST_AREA(ST_GEOMFROMTEXT('POLYGON((4 4,4 6,6 6,6 4,4 4),(0 0,0 10,10 10,10 0,0 0))')) -96 SELECT ST_AREA(ST_GEOMFROMTEXT('POLYGON((4 4,4 6,6 6,6 4,4 4),(8 8,8 10,10 10,10 8,8 8))')); ST_AREA(ST_GEOMFROMTEXT('POLYGON((4 4,4 6,6 6,6 4,4 4),(8 8,8 10,10 10,10 8,8 8))')) 0 SELECT ST_AREA(g) FROM gis_geometrycollection WHERE fid=100; ST_AREA(g) 287.5 ##################################################################################### # ST_AREA(multipolygon) ##################################################################################### SELECT ST_AREA(ST_GEOMFROMTEXT(@star_of_elems)); ST_AREA(ST_GEOMFROMTEXT(@star_of_elems)) 377.5 SELECT ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5, 0 0)))')); ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5, 0 0)))')) 12.5 SELECT ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 10,10 0,0 0, 0 10)),((0 0,10 10,10 0, 0 0)))')); ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 10,10 0,0 0, 0 10)),((0 0,10 10,10 0, 0 0)))')) 100 SELECT ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10, 0 0)),((10 10,10 15,15 15,10 10)))')); ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10, 0 0)),((10 10,10 15,15 15,10 10)))')) 62.5 SELECT ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((4 4,4 6,6 6,6 4, 4 4)))')); ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((4 4,4 6,6 6,6 4, 4 4)))')) 104 SELECT ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0, 0 0),(4 4,4 6,6 6,6 4, 4 4)))')); ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0, 0 0),(4 4,4 6,6 6,6 4, 4 4)))')) 96 SELECT ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(0 0,0 10,10 10,10 0,0 0)))')); ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(0 0,0 10,10 10,10 0,0 0)))')) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((4 4,4 6,6 6,6 4,4 4),(0 0,0 10,10 10,10 0,0 0)))')); ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((4 4,4 6,6 6,6 4,4 4),(0 0,0 10,10 10,10 0,0 0)))')) -96 SELECT ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((4 4,4 6,6 6,6 4,4 4),(8 8,8 10,10 10,10 8,8 8)))')); ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((4 4,4 6,6 6,6 4,4 4),(8 8,8 10,10 10,10 8,8 8)))')) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((10 10,10 0,5 10,10 10)),((0 10,0 20,5 10,0 10)))')); ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((10 10,10 0,5 10,10 10)),((0 10,0 20,5 10,0 10)))')) 50 SELECT ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(0 0,0 10,10 10,10 0,0 0)),((0 0,0 10,10 10,10 0,0 0)))')); ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(0 0,0 10,10 10,10 0,0 0)),((0 0,0 10,10 10,10 0,0 0)))')) 100 SELECT ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(0 0,0 10,10 10,10 0,0 0)),((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6, 4 4)))')); ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(0 0,0 10,10 10,10 0,0 0)),((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6, 4 4)))')) 98 SELECT ST_AREA(g) FROM gis_geometrycollection WHERE fid=103; ST_AREA(g) 377.5 ##################################################################################### # ST_AREA(geometrycollection) ##################################################################################### SELECT ST_AREA(ST_GEOMFROMTEXT(@star_collection_elems)); ST_AREA(ST_GEOMFROMTEXT(@star_collection_elems)) 665 SELECT ST_AREA(ST_GEOMFROMTEXT(@star_collection_multilinestr)); ST_AREA(ST_GEOMFROMTEXT(@star_collection_multilinestr)) 665 SELECT ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()')); ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()')) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())')); ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())')) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(GEOMETRYCOLLECTION()))')); ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(GEOMETRYCOLLECTION()))')) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,10 10))')); ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,10 10))')) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,10 10)))')); ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,10 10)))')) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(1 1,2 2,3 3),MULTILINESTRING((0 0,0 10,10 10,10 0, 0 0),(10 10,10 15,15 15,10 10)))')); ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(1 1,2 2,3 3),MULTILINESTRING((0 0,0 10,10 10,10 0, 0 0),(10 10,10 15,15 15,10 10)))')) 0 SELECT ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10),' 'MULTIPOINT(0 0,10 10),' 'LINESTRING(1 1,2 2,3 3),' 'MULTILINESTRING((0 0,0 10,10 10,10 0, 0 0),(10 10,10 15,15 15,10 10)))')); ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10),' 'MULTIPOINT(0 0,10 10),' 'LINESTRING(1 1,2 2,3 3),' 0 SELECT ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0, 0 0)))')); ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0, 0 0)))')) 100 SELECT ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0, 0 0)))))')); ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0, 0 0)))))')) 100 SELECT ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4, 4 4)),' 'MULTIPOLYGON(((0 0,0 10,10 10,10 0, 0 0)),((10 10,10 15,15 15,15 10,10 10))))')); ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4, 4 4)),' 'MULTIPOLYGON(((0 0,0 10,10 10,10 0, 0 0)),((10 10,10 15,15 15,15 10,10 10))))')) 221 SELECT ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(10 10),' 'MULTIPOINT(0 0,10 10)),' 'GEOMETRYCOLLECTION(LINESTRING(1 1,2 2,3 3),' 'MULTILINESTRING((0 0,0 10,10 10,10 0, 0 0),(10 10,10 15,15 15,10 10))))')); ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(10 10),' 'MULTIPOINT(0 0,10 10)),' 'GEOMETRYCOLLECTION(LINESTRING(1 0 SELECT ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(10 10),' 'MULTIPOINT(0 0,10 10)),' 'GEOMETRYCOLLECTION(LINESTRING(1 1,2 2,3 3),' 'MULTILINESTRING((0 0,0 10,10 10,10 0, 0 0),(10 10,10 15,15 15,10 10))),' 'GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4, 4 4)),' 'MULTIPOLYGON(((0 0,0 10,10 10,10 0, 0 0)),((10 10,10 15,15 15,15 10,10 10)))))')); ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(10 10),' 'MULTIPOINT(0 0,10 10)),' 'GEOMETRYCOLLECTION(LINESTRING(1 221 SELECT ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(10 10),' 'MULTIPOINT(0 0,10 10)),' 'GEOMETRYCOLLECTION(LINESTRING(1 1,2 2,3 3),' 'MULTILINESTRING((0 0,0 10,10 10,10 0, 0 0),(10 10,10 15,15 15,10 10))),' 'GEOMETRYCOLLECTION(GEOMETRYCOLLECTION()))')); ST_AREA(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(10 10),' 'MULTIPOINT(0 0,10 10)),' 'GEOMETRYCOLLECTION(LINESTRING(1 0 SELECT ST_AREA(g) FROM gis_geometrycollection WHERE fid=115; ST_AREA(g) 665 ##################################################################################### # ST_AREA(geometry) with different SRID values ##################################################################################### SELECT ST_AREA(ST_GEOMFROMTEXT(@star_center,-1024)); ST_AREA(ST_GEOMFROMTEXT(@star_center,-1024)) 0 SELECT ST_AREA(ST_GEOMFROMTEXT(@star_all_points,-1)); ST_AREA(ST_GEOMFROMTEXT(@star_all_points,-1)) 0 SELECT ST_AREA(ST_GEOMFROMTEXT(@star_top_to_center,0)); ST_AREA(ST_GEOMFROMTEXT(@star_top_to_center,0)) 0 SELECT ST_AREA(ST_GEOMFROMTEXT(@star_lines_near_vertical,1000)); ST_AREA(ST_GEOMFROMTEXT(@star_lines_near_vertical,1000)) 0 SELECT ST_AREA(ST_GEOMFROMTEXT(@star,123456789)); ST_AREA(ST_GEOMFROMTEXT(@star,123456789)) 287.5 SELECT ST_AREA(ST_GEOMFROMTEXT(@star_elem_vertical,4294967295)); ST_AREA(ST_GEOMFROMTEXT(@star_elem_vertical,4294967295)) 200 SELECT ST_AREA(ST_GEOMFROMTEXT(@star_of_elems,4294967296)); ST_AREA(ST_GEOMFROMTEXT(@star_of_elems,4294967296)) 377.5 SELECT ST_AREA(ST_GEOMFROMTEXT(@star_collection_elems,4294967295000)); ST_AREA(ST_GEOMFROMTEXT(@star_collection_elems,4294967295000)) 665 ##################################################################################### # Invalid function calls ##################################################################################### SELECT ST_AREA(); ERROR 42000: Incorrect parameter count in the call to native function 'ST_AREA' SELECT ST_AREA(NULL); ST_AREA(NULL) NULL SELECT ST_AREA(ST_GEOMFROMTEXT('POINT()')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('LINESTRING()')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('POLYGON(())')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('MULTIPOINT()')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('MULTILINESTRING(())')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON((()))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('POINT(a 0)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('POINT(! 0)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('POINT('!' 0)')); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '!' 0)'))' at line 1 SELECT ST_AREA(ST_GEOMFROMTEXT('POINT(12,34 0)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('LINESTRING(a 0,10 10)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('LINESTRING(0 0,! 10)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('LINESTRING('!' 0,10 10)')); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '!' 0,10 10)'))' at line 1 SELECT ST_AREA(ST_GEOMFROMTEXT('LINESTRING(12,34 0,10 10)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('POLYGON((a 0,10 10,10 0,0 0))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('POLYGON((0 0,! 10,10 0,0 0))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('POLYGON(('!' 0,10 10,10 0,0 0))')); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '!' 0,10 10,10 0,0 0))'))' at line 1 SELECT ST_AREA(ST_GEOMFROMTEXT('POLYGON((12,34 0,10 10,10 0,0 0))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('POLYGON((0 0))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('POLYGON((0 0,5 5))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('POLYGON((0 0,5 5,10 10))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('POLYGON((0 0,0 5,10 10),(0 0))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,5 5,10 10)),((10 10)))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,5 5,10 10)),((10 10))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_AREA(0x000000000200000000000000000000000000000000); ERROR HY000: Geometry byte string must be little endian. SELECT ST_AREA(0x010100000001000000010100000000000000000000); ERROR HY000: Geometry byte string must be little endian. SELECT ST_AREA(0x010100000002000000000000000000000000000000); ERROR HY000: Geometry byte string must be little endian. SELECT ST_AREA(0x000000000600000001000000000200000002000000); ERROR HY000: Geometry byte string must be little endian. SELECT ST_AREA(0x000000000200000001000000050000000000000000); ERROR HY000: Geometry byte string must be little endian. SELECT ST_AREA(0x010300000002000000010300000002000000050000); ERROR HY000: Geometry byte string must be little endian. SELECT ST_AREA(0x010400000002000000010100000000000000000000); ERROR HY000: Geometry byte string must be little endian. # Clean up DROP TABLE gis_geometrycollection;