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/geometry_property_functions.result |
# Creating the spatial objects USE test; CREATE TABLE gis_point (fid INTEGER NOT NULL PRIMARY KEY, g POINT); CREATE TABLE gis_linestring (fid INTEGER NOT NULL PRIMARY KEY, g LINESTRING); CREATE TABLE gis_polygon (fid INTEGER NOT NULL PRIMARY KEY, g POLYGON); CREATE TABLE gis_multi_point (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOINT); CREATE TABLE gis_multi_linestring (fid INTEGER NOT NULL PRIMARY KEY, g MULTILINESTRING); CREATE TABLE gis_multi_polygon (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOLYGON); CREATE TABLE gis_geometrycollection (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRYCOLLECTION); # Inserting POINT Geometry Values INSERT INTO gis_point VALUES (101, ST_POINTFROMTEXT('POINT(0 0)')), (102, ST_POINTFROMTEXT('POINT(1 0)')), (103, ST_POINTFROMTEXT('POINT(0 1)')), (104, ST_POINTFROMTEXT('POINT(1 1)')), (105, ST_POINTFROMTEXT('POINT(-1 1)')); INSERT INTO gis_point VALUES (106, ST_POINTFROMWKB(POINT(0,0))), (107, ST_POINTFROMWKB(POINT(10,0))), (108, ST_POINTFROMWKB(POINT(0,10))), (109, ST_POINTFROMWKB(POINT(-10,0))), (110, ST_POINTFROMWKB(POINT(0,-10))); Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. INSERT INTO gis_point VALUES (111, ST_POINTFROMWKB(ST_ASWKB(ST_POINTFROMTEXT('POINT(1 1)')))), (112, ST_POINTFROMWKB(ST_ASWKB(ST_POINTFROMTEXT('POINT(1e308 1e308)')))), (113, ST_POINTFROMWKB(ST_ASWKB(ST_POINTFROMTEXT('POINT(1e308 -1e308)')))), (114, ST_POINTFROMWKB(ST_ASWKB(ST_POINTFROMTEXT('POINT(-1e308 1e308)')))), (115, ST_POINTFROMWKB(ST_ASWKB(ST_POINTFROMTEXT('POINT(-1e308 -1e308)')))); # Displaying the inserted POINT Geometry Data SELECT fid, ST_ASTEXT(g) FROM gis_point; fid ST_ASTEXT(g) 101 POINT(0 0) 102 POINT(1 0) 103 POINT(0 1) 104 POINT(1 1) 105 POINT(-1 1) 106 POINT(0 0) 107 POINT(10 0) 108 POINT(0 10) 109 POINT(-10 0) 110 POINT(0 -10) 111 POINT(1 1) 112 POINT(1e308 1e308) 113 POINT(1e308 -1e308) 114 POINT(-1e308 1e308) 115 POINT(-1e308 -1e308) # Checking the integrity of the above insert statements SELECT COUNT(g) FROM gis_point; COUNT(g) 15 SELECT COUNT(ST_ASTEXT(g)) FROM gis_point; COUNT(ST_ASTEXT(g)) 15 SELECT COUNT(DISTINCT(g)) FROM gis_point; COUNT(DISTINCT(g)) 13 SELECT COUNT(DISTINCT(ST_ASTEXT(g))) FROM gis_point; COUNT(DISTINCT(ST_ASTEXT(g))) 13 # Inserting LINESTRING Geometry Values INSERT INTO gis_linestring VALUES (201, ST_LINEFROMTEXT('LINESTRING(0 0,5 5)')), (202, ST_LINEFROMTEXT('LINESTRING(0 0,2 2,4 4)')), (203, ST_LINEFROMTEXT('LINESTRING(0 0,5 5,10 10)')); INSERT INTO gis_linestring VALUES (204, ST_LINESTRINGFROMTEXT('LINESTRING(10 10,5 5)')), (205, ST_LINESTRINGFROMTEXT('LINESTRING(0 0,12 12,24 24)')), (206, ST_LINESTRINGFROMTEXT('LINESTRING(0 0,50 50,100 100)')); INSERT INTO gis_linestring VALUES (207, ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5)))), (208, ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(-5,-5), POINT(-10,10)))), (209, ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(2,2), POINT(4,4), POINT(6,6), POINT(8,8)))); Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. INSERT INTO gis_linestring VALUES (210, ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(5,5)))), (211, ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(-50,-50), POINT(10,-10)))), (212, ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(1e308,1e308), POINT(1e308,-1e308)))); Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. INSERT INTO gis_linestring VALUES (213, ST_LINEFROMWKB(ST_ASWKB(ST_LINEFROMTEXT('LINESTRING(1e308 1e308,1e308 -1e308)')))), (214, ST_LINEFROMWKB(ST_ASWKB(ST_LINEFROMTEXT('LINESTRING(1 1,2 2,3 3,4 4,5 5,6 6,7 7,8 8,9 9)')))), (215, ST_LINESTRINGFROMWKB(ST_ASWKB(ST_LINESTRINGFROMTEXT('LINESTRING(10 10,10 -10,-10 -10,-10 10,10 10)')))); # Displaying the inserted LINESTRING Geometry Data SELECT fid, ST_ASTEXT(g) FROM gis_linestring; fid ST_ASTEXT(g) 201 LINESTRING(0 0,5 5) 202 LINESTRING(0 0,2 2,4 4) 203 LINESTRING(0 0,5 5,10 10) 204 LINESTRING(10 10,5 5) 205 LINESTRING(0 0,12 12,24 24) 206 LINESTRING(0 0,50 50,100 100) 207 LINESTRING(0 0,5 5) 208 LINESTRING(0 0,-5 -5,-10 10) 209 LINESTRING(0 0,2 2,4 4,6 6,8 8) 210 LINESTRING(0 0,5 5) 211 LINESTRING(0 0,-50 -50,10 -10) 212 LINESTRING(0 0,1e308 1e308,1e308 -1e308) 213 LINESTRING(1e308 1e308,1e308 -1e308) 214 LINESTRING(1 1,2 2,3 3,4 4,5 5,6 6,7 7,8 8,9 9) 215 LINESTRING(10 10,10 -10,-10 -10,-10 10,10 10) # Checking the integrity of the above insert statements SELECT COUNT(g) FROM gis_linestring; COUNT(g) 15 SELECT COUNT(ST_ASTEXT(g)) FROM gis_linestring; COUNT(ST_ASTEXT(g)) 15 SELECT COUNT(DISTINCT(g)) FROM gis_linestring; COUNT(DISTINCT(g)) 13 SELECT COUNT(DISTINCT(ST_ASTEXT(g))) FROM gis_linestring; COUNT(DISTINCT(ST_ASTEXT(g))) 13 # Inserting POLYGON Geometry Values INSERT INTO gis_polygon VALUES (301, ST_POLYFROMTEXT('POLYGON((0 0,0 5,5 5, 0 0))')), (302, ST_POLYFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))')), (303, ST_POLYFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0))')); INSERT INTO gis_polygon VALUES (304, ST_POLYGONFROMTEXT('POLYGON((0 0,0 50,50 50,50 0,0 0))')), (305, ST_POLYGONFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))')), (306, ST_POLYGONFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2),(6 6,6 8,8 8,8 6,6 6))')); INSERT INTO gis_polygon VALUES (307, ST_POLYFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,5), POINT(5,5), POINT(0,0))))), (308, ST_POLYFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,15), POINT(15,15), POINT(15,0), POINT(0,0))))), (309, ST_POLYFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,10), POINT(10,10), POINT(10,0), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4))))); Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. INSERT INTO gis_polygon VALUES (310, ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,5), POINT(5,5), POINT(0,0))))), (311, ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(10,10), POINT(10,15), POINT(15,15), POINT(15,10), POINT(10,10))))), (312, ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(10,10), POINT(10,20), POINT(20,20), POINT(20,10), POINT(10,10)), LINESTRING(POINT(14,14), POINT(14,16), POINT(16,16), POINT(16,14), POINT(14,14))))); Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. INSERT INTO gis_polygon VALUES (313, ST_POLYFROMWKB(ST_ASWKB(ST_POLYFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,5 5,0 0))')))), (314, ST_POLYFROMWKB(ST_ASWKB(ST_POLYGONFROMTEXT('POLYGON((10 0,10 10,0 10,-10 10,-10 0,-10 -10,0 10,10 -10,10 0))')))), (315, ST_POLYGONFROMWKB(ST_ASWKB(ST_POLYGONFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2),(6 6,6 8,8 8,8 6,6 6))')))); # Displaying the inserted POLYGON Geometry Data SELECT fid, ST_ASTEXT(g) FROM gis_polygon; fid ST_ASTEXT(g) 301 POLYGON((0 0,0 5,5 5,0 0)) 302 POLYGON((0 0,0 5,5 5,5 0,0 0)) 303 POLYGON((0 0,0 10,10 10,10 0,0 0)) 304 POLYGON((0 0,0 50,50 50,50 0,0 0)) 305 POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)) 306 POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2),(6 6,6 8,8 8,8 6,6 6)) 307 POLYGON((0 0,0 5,5 5,0 0)) 308 POLYGON((0 0,0 15,15 15,15 0,0 0)) 309 POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)) 310 POLYGON((0 0,0 5,5 5,0 0)) 311 POLYGON((10 10,10 15,15 15,15 10,10 10)) 312 POLYGON((10 10,10 20,20 20,20 10,10 10),(14 14,14 16,16 16,16 14,14 14)) 313 POLYGON((0 0,0 10,10 10,10 0,5 5,0 0)) 314 POLYGON((10 0,10 10,0 10,-10 10,-10 0,-10 -10,0 10,10 -10,10 0)) 315 POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2),(6 6,6 8,8 8,8 6,6 6)) # Checking the integrity of the above insert statements SELECT COUNT(g) FROM gis_polygon; COUNT(g) 15 SELECT COUNT(ST_ASTEXT(g)) FROM gis_polygon; COUNT(ST_ASTEXT(g)) 15 SELECT COUNT(DISTINCT(g)) FROM gis_polygon; COUNT(DISTINCT(g)) 11 SELECT COUNT(DISTINCT(ST_ASTEXT(g))) FROM gis_polygon; COUNT(DISTINCT(ST_ASTEXT(g))) 11 # Inserting MULTIPOINT Geometry Values INSERT INTO gis_multi_point VALUES (401, ST_MPOINTFROMTEXT('MULTIPOINT(0 0)')), (402, ST_MPOINTFROMTEXT('MULTIPOINT(0 0,2 2,4 4)')), (403, ST_MPOINTFROMTEXT('MULTIPOINT(0 0,5 5,10 10)')); INSERT INTO gis_multi_point VALUES (404, ST_MULTIPOINTFROMTEXT('MULTIPOINT(0 0,100 100)')), (405, ST_MULTIPOINTFROMTEXT('MULTIPOINT(0 0,1e308 1e308)')), (406, ST_MULTIPOINTFROMTEXT('MULTIPOINT(1e308 1e308,1e308 -1e308,-1e308 1e308,-1e308 -1e308)')); INSERT INTO gis_multi_point VALUES (407, ST_MPOINTFROMWKB(MULTIPOINT(POINT(0,0)))), (408, ST_MPOINTFROMWKB(MULTIPOINT(POINT(0,0), POINT(10,10)))), (409, ST_MPOINTFROMWKB(MULTIPOINT(POINT(0,0), POINT(2,2), POINT(4,4), POINT(6,6)))); Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. INSERT INTO gis_multi_point VALUES (410, ST_MULTIPOINTFROMWKB(MULTIPOINT(POINT(0,0)))), (411, ST_MULTIPOINTFROMWKB(MULTIPOINT(POINT(0,0), POINT(1e308,1e308)))), (412, ST_MULTIPOINTFROMWKB(MULTIPOINT(POINT(1e308,1e308), POINT(-1e308,1e308), POINT(1e308,-1e308), POINT(-1e308,-1e308)))); Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. INSERT INTO gis_multi_point VALUES (413, ST_MPOINTFROMWKB(ST_ASWKB(ST_MPOINTFROMTEXT('MULTIPOINT(0 0)')))), (414, ST_MPOINTFROMWKB(ST_ASWKB(ST_MPOINTFROMTEXT('MULTIPOINT(0 0,1e308 1e308,-1e308 -1e308)')))), (415, ST_MPOINTFROMWKB(ST_ASWKB(ST_MPOINTFROMTEXT('MULTIPOINT(1e308 1e308,1e308 -1e308,-1e308 1e308,-1e308 -1e308,1e308 1e308)')))); # Displaying the inserted MULTIPOINT Geometry Data SELECT fid, ST_ASTEXT(g) FROM gis_multi_point; fid ST_ASTEXT(g) 401 MULTIPOINT((0 0)) 402 MULTIPOINT((0 0),(2 2),(4 4)) 403 MULTIPOINT((0 0),(5 5),(10 10)) 404 MULTIPOINT((0 0),(100 100)) 405 MULTIPOINT((0 0),(1e308 1e308)) 406 MULTIPOINT((1e308 1e308),(1e308 -1e308),(-1e308 1e308),(-1e308 -1e308)) 407 MULTIPOINT((0 0)) 408 MULTIPOINT((0 0),(10 10)) 409 MULTIPOINT((0 0),(2 2),(4 4),(6 6)) 410 MULTIPOINT((0 0)) 411 MULTIPOINT((0 0),(1e308 1e308)) 412 MULTIPOINT((1e308 1e308),(-1e308 1e308),(1e308 -1e308),(-1e308 -1e308)) 413 MULTIPOINT((0 0)) 414 MULTIPOINT((0 0),(1e308 1e308),(-1e308 -1e308)) 415 MULTIPOINT((1e308 1e308),(1e308 -1e308),(-1e308 1e308),(-1e308 -1e308),(1e308 1e308)) # Checking the integrity of the above insert statements SELECT COUNT(g) FROM gis_multi_point; COUNT(g) 15 SELECT COUNT(ST_ASTEXT(g)) FROM gis_multi_point; COUNT(ST_ASTEXT(g)) 15 SELECT COUNT(DISTINCT(g)) FROM gis_multi_point; COUNT(DISTINCT(g)) 11 SELECT COUNT(DISTINCT(ST_ASTEXT(g))) FROM gis_multi_point; COUNT(DISTINCT(ST_ASTEXT(g))) 11 # Inserting MULTILINESTRING Geometry Values INSERT INTO gis_multi_linestring VALUES (501, ST_MLINEFROMTEXT('MULTILINESTRING((0 0,2 2))')), (502, ST_MLINEFROMTEXT('MULTILINESTRING((0 0,2 2,4 4))')), (503, ST_MLINEFROMTEXT('MULTILINESTRING((0 0,2 2,4 4),(6 6,8 8,10 10))')); INSERT INTO gis_multi_linestring VALUES (504, ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((0 0,100 100,-100 -100))')), (505, ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((1e308 1e308,-1e308 -1e308))')), (506, ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((1e308 1e308,-1e308 -1e308),(1e308 -1e308,-1e308 1e308))')); INSERT INTO gis_multi_linestring VALUES (507, ST_MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(2,2))))), (508, ST_MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(12,12), POINT(24,24))))), (509, ST_MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(2,2), POINT(4,4)), LINESTRING(POINT(6,6), POINT(8,8), POINT(10,10))))); Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. INSERT INTO gis_multi_linestring VALUES (510, ST_MULTILINESTRINGFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(2,2), POINT(4,4))))), (511, ST_MULTILINESTRINGFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(1,1), POINT(2,2))))), (512, ST_MULTILINESTRINGFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(12,12), POINT(24,24)), LINESTRING(POINT(36,36), POINT(48,48), POINT(50,50))))); Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. INSERT INTO gis_multi_linestring VALUES (513, ST_MLINEFROMWKB(ST_ASWKB(ST_MLINEFROMTEXT('MULTILINESTRING((0 0,10 10),(0 10,10 0))')))), (514, ST_MLINEFROMWKB(ST_ASWKB(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((0 0,10 10,-10 10,0 0),(0 0,-10 -10,10 -10,0 0))')))), (515, ST_MULTILINESTRINGFROMWKB(ST_ASWKB(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((0 0,0 100),(0 0,100 0),(0 0,0 -100),(0 0,-100 0))')))); # Displaying the inserted MULTILINESTRING Geometry Data SELECT fid, ST_ASTEXT(g) FROM gis_multi_linestring; fid ST_ASTEXT(g) 501 MULTILINESTRING((0 0,2 2)) 502 MULTILINESTRING((0 0,2 2,4 4)) 503 MULTILINESTRING((0 0,2 2,4 4),(6 6,8 8,10 10)) 504 MULTILINESTRING((0 0,100 100,-100 -100)) 505 MULTILINESTRING((1e308 1e308,-1e308 -1e308)) 506 MULTILINESTRING((1e308 1e308,-1e308 -1e308),(1e308 -1e308,-1e308 1e308)) 507 MULTILINESTRING((0 0,2 2)) 508 MULTILINESTRING((0 0,12 12,24 24)) 509 MULTILINESTRING((0 0,2 2,4 4),(6 6,8 8,10 10)) 510 MULTILINESTRING((0 0,2 2,4 4)) 511 MULTILINESTRING((0 0,1 1,2 2)) 512 MULTILINESTRING((0 0,12 12,24 24),(36 36,48 48,50 50)) 513 MULTILINESTRING((0 0,10 10),(0 10,10 0)) 514 MULTILINESTRING((0 0,10 10,-10 10,0 0),(0 0,-10 -10,10 -10,0 0)) 515 MULTILINESTRING((0 0,0 100),(0 0,100 0),(0 0,0 -100),(0 0,-100 0)) # Checking the integrity of the above insert statements SELECT COUNT(g) FROM gis_multi_linestring; COUNT(g) 15 SELECT COUNT(ST_ASTEXT(g)) FROM gis_multi_linestring; COUNT(ST_ASTEXT(g)) 15 SELECT COUNT(DISTINCT(g)) FROM gis_multi_linestring; COUNT(DISTINCT(g)) 12 SELECT COUNT(DISTINCT(ST_ASTEXT(g))) FROM gis_multi_linestring; COUNT(DISTINCT(ST_ASTEXT(g))) 12 # Inserting MULTIPOLGYON Geometry Values INSERT INTO gis_multi_polygon VALUES (601, ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,0 0)))')), (602, ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,0 0)),((5 5,5 10,10 10,5 5)))')), (603, ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)))')); INSERT INTO gis_multi_polygon VALUES (604, ST_MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5, 0 0)))')), (605, ST_MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4, 4 4)),((0 0,0 -2,-2 -2, 0 0)))')), (606, ST_MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((0 0,5 5,-5 5,0 0)),((0 0,-5 -5,5 -5,0 0)))')); INSERT INTO gis_multi_polygon VALUES (607, ST_MPOLYFROMWKB(MULTIPOLYGON(POLYGON(LINESTRING(POINT(0,0), POINT(5,0), POINT(5,5), POINT(0,5), POINT(0,0)))))), (608, ST_MPOLYFROMWKB(MULTIPOLYGON(POLYGON(LINESTRING(POINT(0,0), POINT(10,0), POINT(10,10), POINT(0,10), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4)))))), (609, ST_MPOLYFROMWKB(MULTIPOLYGON(POLYGON(LINESTRING(POINT(0,0), POINT(5,0), POINT(5,5), POINT(0,5), POINT(0,0))), POLYGON(LINESTRING(POINT(0,0), POINT(-5,0), POINT(-5,-5), POINT(0,-5), POINT(0,0)))))); Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. INSERT INTO gis_multi_polygon VALUES (610, ST_MULTIPOLYGONFROMWKB(MULTIPOLYGON(POLYGON(LINESTRING(POINT(0,0), POINT(-5,0), POINT(-5,-5), POINT(0,-5), POINT(0,0)))))), (611, ST_MULTIPOLYGONFROMWKB(MULTIPOLYGON(POLYGON(LINESTRING(POINT(10,10), POINT(20,10), POINT(20,20), POINT(10,20), POINT(10,10)), LINESTRING(POINT(14,14), POINT(14,16), POINT(16,16), POINT(16,14), POINT(14,14)))))), (612, ST_MULTIPOLYGONFROMWKB(MULTIPOLYGON(POLYGON(LINESTRING(POINT(0,0), POINT(0,10), POINT(10,10), POINT(10,0), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4))), POLYGON(LINESTRING(POINT(0,0), POINT(-5,0), POINT(-5,-5), POINT(0,-5), POINT(0,0)))))); Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. INSERT INTO gis_multi_polygon VALUES (613, ST_MPOLYFROMWKB(ST_ASWKB(ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,5 5,5 -5,0 0)),((0 0,-5 5,-5 -5,0 0)))')))), (614, ST_MPOLYFROMWKB(ST_ASWKB(ST_MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((0 0,10 10,-10 10,0 0)),((0 0,-10 -10,10 -10,0 0)))')))), (615, ST_MULTIPOLYGONFROMWKB(ST_ASWKB(ST_MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((0 0,5 5,10 0,5 -5,0 0)))')))); # Displaying the inserted MULTIPOLYGON Geometry Data SELECT fid, ST_ASTEXT(g) FROM gis_multi_polygon; fid ST_ASTEXT(g) 601 MULTIPOLYGON(((0 0,0 5,5 5,0 0))) 602 MULTIPOLYGON(((0 0,0 5,5 5,0 0)),((5 5,5 10,10 10,5 5))) 603 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))) 604 MULTIPOLYGON(((0 0,0 5,5 5,0 0))) 605 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,0 -2,-2 -2,0 0))) 606 MULTIPOLYGON(((0 0,5 5,-5 5,0 0)),((0 0,-5 -5,5 -5,0 0))) 607 MULTIPOLYGON(((0 0,5 0,5 5,0 5,0 0))) 608 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4))) 609 MULTIPOLYGON(((0 0,5 0,5 5,0 5,0 0)),((0 0,-5 0,-5 -5,0 -5,0 0))) 610 MULTIPOLYGON(((0 0,-5 0,-5 -5,0 -5,0 0))) 611 MULTIPOLYGON(((10 10,20 10,20 20,10 20,10 10),(14 14,14 16,16 16,16 14,14 14))) 612 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-5 0,-5 -5,0 -5,0 0))) 613 MULTIPOLYGON(((0 0,5 5,5 -5,0 0)),((0 0,-5 5,-5 -5,0 0))) 614 MULTIPOLYGON(((0 0,10 10,-10 10,0 0)),((0 0,-10 -10,10 -10,0 0))) 615 MULTIPOLYGON(((0 0,5 5,10 0,5 -5,0 0))) # Checking the integrity of the above insert statements SELECT COUNT(g) FROM gis_multi_polygon; COUNT(g) 15 SELECT COUNT(ST_ASTEXT(g)) FROM gis_multi_polygon; COUNT(ST_ASTEXT(g)) 15 SELECT COUNT(DISTINCT(g)) FROM gis_multi_polygon; COUNT(DISTINCT(g)) 14 SELECT COUNT(DISTINCT(ST_ASTEXT(g))) FROM gis_multi_polygon; COUNT(DISTINCT(ST_ASTEXT(g))) 14 # Inserting GEOMETRYCOLLECTION Geometry Values INSERT INTO gis_geometrycollection VALUES (701, ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0))')), (702, ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), (703, ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(5 5), POLYGON((0 0,0 10,10 10,10 0,0 0)))')); INSERT INTO gis_geometrycollection VALUES (704, ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), (705, ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0),' 'LINESTRING(0 0,10 10),' 'POLYGON((0 0,0 10,10 10,10 0, 0 0)))')), (706, ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(MULTIPOINT(0 0,5 5,10 10),' 'MULTILINESTRING((0 0,10 10),(0 10,10 0)),' 'MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),' '((0 0,-10 0,-10 -10,0 -10,0 0))))')); INSERT INTO gis_geometrycollection VALUES (707, ST_GEOMCOLLFROMWKB(GEOMETRYCOLLECTION(POINT(0,0)))), (708, ST_GEOMCOLLFROMWKB(GEOMETRYCOLLECTION(POINT(0,0), LINESTRING(POINT(0,0), POINT(2,2), POINT(4,4), POINT(6,6), POINT(8,8)), POLYGON(LINESTRING(POINT(0,0), POINT(0,10), POINT(10,10), POINT(10,0), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4)))))), (709, ST_GEOMCOLLFROMWKB(GEOMETRYCOLLECTION(MULTIPOINT(POINT(0,0), POINT(5,5), POINT(10,10)), MULTILINESTRING(LINESTRING(POINT(0,0), POINT(2,2), POINT(4,4), POINT(6,6), POINT(8,8)), LINESTRING(POINT(10,10), POINT(5,5), POINT(0,10))), MULTIPOLYGON(POLYGON(LINESTRING(POINT(0,0), POINT(0,10), POINT(10,10), POINT(10,0), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4))), POLYGON(LINESTRING(POINT(0,0), POINT(-10,0), POINT(-10,-10), POINT(0,0))))))); Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. INSERT INTO gis_geometrycollection VALUES (710, ST_GEOMETRYCOLLECTIONFROMWKB(GEOMETRYCOLLECTION(POINT(0,0), LINESTRING(POINT(0,0), POINT(100,100))))), (711, ST_GEOMETRYCOLLECTIONFROMWKB(GEOMETRYCOLLECTION(POINT(10,10), LINESTRING(POINT(10,10), POINT(12,12), POINT(14,14), POINT(16,16), POINT(18,18)), POLYGON(LINESTRING(POINT(0,0), POINT(0,10), POINT(10,10), POINT(10,0), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4)))))), (712, ST_GEOMETRYCOLLECTIONFROMWKB(GEOMETRYCOLLECTION(MULTIPOINT(POINT(10,10), POINT(15,15), POINT(20,20)), MULTILINESTRING(LINESTRING(POINT(0,0), POINT(2,2), POINT(4,4), POINT(6,6), POINT(8,8)), LINESTRING(POINT(10,10), POINT(5,5), POINT(0,10))), MULTIPOLYGON(POLYGON(LINESTRING(POINT(0,0), POINT(0,10), POINT(10,10), POINT(10,0), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4))), POLYGON(LINESTRING(POINT(0,0), POINT(-10,0), POINT(-10,-10), POINT(0,0))))))); Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. INSERT INTO gis_geometrycollection VALUES (713, ST_GEOMCOLLFROMWKB(ST_ASWKB(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(' 'POINT(0 0),' 'LINESTRING(0 0,10 10),' 'POLYGON((0 0,0 10,10 10,10 0, 0 0)),' 'MULTIPOINT(0 0,2 2,4 4,6 6,8 8,10 10),' 'MULTILINESTRING((0 0,10 10),(0 10,10 0)),' 'MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5))))')))), (714, ST_GEOMCOLLFROMWKB(ST_ASWKB(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(' 'GEOMETRYCOLLECTION(' 'POINT(0 0)),' 'GEOMETRYCOLLECTION(' 'LINESTRING(0 0,10 10)),' 'GEOMETRYCOLLECTION(' 'POLYGON((0 0,0 10,10 10,10 0, 0 0))),' 'GEOMETRYCOLLECTION(' 'MULTIPOINT(0 0,2 2,4 4,6 6,8 8,10 10)),' 'GEOMETRYCOLLECTION(' 'MULTILINESTRING((0 0,10 10),(0 10,10 0))),' 'GEOMETRYCOLLECTION(' 'MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5)))))')))), (715, ST_GEOMCOLLFROMWKB(ST_ASWKB(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(' 'GEOMETRYCOLLECTION(),' 'POINT(0 0),' 'GEOMETRYCOLLECTION(' 'LINESTRING(0 0,10 10),' 'GEOMETRYCOLLECTION(' 'GEOMETRYCOLLECTION())),' 'GEOMETRYCOLLECTION(),' 'GEOMETRYCOLLECTION(' 'GEOMETRYCOLLECTION()),' 'POLYGON((0 0,0 10,10 10,10 0, 0 0)),' 'MULTIPOINT(0 0,2 2,4 4,6 6,8 8,10 10),' 'MULTILINESTRING((0 0,10 10),(0 10,10 0)),' 'MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5))))')))); # Displaying the inserted GEOMETRYCOLLECTION Geometry Data SELECT fid, ST_ASTEXT(g) FROM gis_geometrycollection; fid ST_ASTEXT(g) 701 GEOMETRYCOLLECTION(POINT(0 0)) 702 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) 703 GEOMETRYCOLLECTION(POINT(5 5),POLYGON((0 0,0 10,10 10,10 0,0 0))) 704 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) 705 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10),POLYGON((0 0,0 10,10 10,10 0,0 0))) 706 GEOMETRYCOLLECTION(MULTIPOINT((0 0),(5 5),(10 10)),MULTILINESTRING((0 0,10 10),(0 10,10 0)),MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,-10 0,-10 -10,0 -10,0 0)))) 707 GEOMETRYCOLLECTION(POINT(0 0)) 708 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,2 2,4 4,6 6,8 8),POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))) 709 GEOMETRYCOLLECTION(MULTIPOINT((0 0),(5 5),(10 10)),MULTILINESTRING((0 0,2 2,4 4,6 6,8 8),(10 10,5 5,0 10)),MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-10 0,-10 -10,0 0)))) 710 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,100 100)) 711 GEOMETRYCOLLECTION(POINT(10 10),LINESTRING(10 10,12 12,14 14,16 16,18 18),POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))) 712 GEOMETRYCOLLECTION(MULTIPOINT((10 10),(15 15),(20 20)),MULTILINESTRING((0 0,2 2,4 4,6 6,8 8),(10 10,5 5,0 10)),MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-10 0,-10 -10,0 0)))) 713 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOINT((0 0),(2 2),(4 4),(6 6),(8 8),(10 10)),MULTILINESTRING((0 0,10 10),(0 10,10 0)),MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5)))) 714 GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(0 0)),GEOMETRYCOLLECTION(LINESTRING(0 0,10 10)),GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0))),GEOMETRYCOLLECTION(MULTIPOINT((0 0),(2 2),(4 4),(6 6),(8 8),(10 10))),GEOMETRYCOLLECTION(MULTILINESTRING((0 0,10 10),(0 10,10 0))),GEOMETRYCOLLECTION(MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5))))) 715 GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(),POINT(0 0),GEOMETRYCOLLECTION(LINESTRING(0 0,10 10),GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())),GEOMETRYCOLLECTION(),GEOMETRYCOLLECTION(GEOMETRYCOLLECTION()),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOINT((0 0),(2 2),(4 4),(6 6),(8 8),(10 10)),MULTILINESTRING((0 0,10 10),(0 10,10 0)),MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5)))) # Checking the integrity of the above insert statements SELECT COUNT(g) FROM gis_geometrycollection; COUNT(g) 15 SELECT COUNT(ST_ASTEXT(g)) FROM gis_geometrycollection; COUNT(ST_ASTEXT(g)) 15 SELECT COUNT(DISTINCT(g)) FROM gis_geometrycollection; COUNT(DISTINCT(g)) 13 SELECT COUNT(DISTINCT(ST_ASTEXT(g))) FROM gis_geometrycollection; COUNT(DISTINCT(ST_ASTEXT(g))) 13 #==================================================================================== # ST_X(point) #==================================================================================== SELECT ST_X(ST_POINTFROMTEXT('POINT(0 0)')); ST_X(ST_POINTFROMTEXT('POINT(0 0)')) 0 SELECT ST_X(ST_POINTFROMTEXT('POINT(10 10)')); ST_X(ST_POINTFROMTEXT('POINT(10 10)')) 10 SELECT ST_X(ST_POINTFROMTEXT('POINT(1e308 1e308)')); ST_X(ST_POINTFROMTEXT('POINT(1e308 1e308)')) 1e308 SELECT ST_X(ST_POINTFROMWKB(POINT(1.1111,-1.1111))); ST_X(ST_POINTFROMWKB(POINT(1.1111,-1.1111))) 1.1111 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_X(ST_POINTFROMWKB(POINT(10.0000,10.0000))); ST_X(ST_POINTFROMWKB(POINT(10.0000,10.0000))) 10 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_X(ST_POINTFROMWKB(POINT(-1e308,-1e308))); ST_X(ST_POINTFROMWKB(POINT(-1e308,-1e308))) -1e308 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. #==================================================================================== # ST_Y(point) #==================================================================================== SELECT ST_Y(ST_POINTFROMTEXT('POINT(0 0)')); ST_Y(ST_POINTFROMTEXT('POINT(0 0)')) 0 SELECT ST_Y(ST_POINTFROMTEXT('POINT(10 10)')); ST_Y(ST_POINTFROMTEXT('POINT(10 10)')) 10 SELECT ST_Y(ST_POINTFROMTEXT('POINT(1e308 1e308)')); ST_Y(ST_POINTFROMTEXT('POINT(1e308 1e308)')) 1e308 SELECT ST_Y(ST_POINTFROMWKB(POINT(1.1111,-1.1111))); ST_Y(ST_POINTFROMWKB(POINT(1.1111,-1.1111))) -1.1111 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_Y(ST_POINTFROMWKB(POINT(10.0000,10.0000))); ST_Y(ST_POINTFROMWKB(POINT(10.0000,10.0000))) 10 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_Y(ST_POINTFROMWKB(POINT(-1e308,-1e308))); ST_Y(ST_POINTFROMWKB(POINT(-1e308,-1e308))) -1e308 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. #==================================================================================== # ST_ISCLOSED(linestring) #==================================================================================== SELECT ST_ISCLOSED(ST_LINEFROMTEXT('LINESTRING(0 0,2 2)')); ST_ISCLOSED(ST_LINEFROMTEXT('LINESTRING(0 0,2 2)')) 0 SELECT ST_ISCLOSED(ST_LINEFROMTEXT('LINESTRING(0 0,2 2,0 0)')); ST_ISCLOSED(ST_LINEFROMTEXT('LINESTRING(0 0,2 2,0 0)')) 1 SELECT ST_ISCLOSED(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0)')); ST_ISCLOSED(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0)')) 0 SELECT ST_ISCLOSED(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)')); ST_ISCLOSED(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)')) 1 SELECT ST_ISCLOSED(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(10,10)))); ST_ISCLOSED(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(10,10)))) 0 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ISCLOSED(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(10,10), POINT(0,0)))); ST_ISCLOSED(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(10,10), POINT(0,0)))) 1 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ISCLOSED(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10)))); ST_ISCLOSED(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10)))) 0 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ISCLOSED(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10), POINT(0,0)))); ST_ISCLOSED(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10), POINT(0,0)))) 1 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. #==================================================================================== # ST_LENGTH(linestring) #==================================================================================== SELECT ST_LENGTH(ST_LINEFROMTEXT('LINESTRING(0 0,2 2)')); ST_LENGTH(ST_LINEFROMTEXT('LINESTRING(0 0,2 2)')) 2.8284271247461903 SELECT ST_LENGTH(ST_LINEFROMTEXT('LINESTRING(0 0,1e308 1e308)')); ST_LENGTH(ST_LINEFROMTEXT('LINESTRING(0 0,1e308 1e308)')) NULL SELECT ST_LENGTH(ST_LINESTRINGFROMTEXT('LINESTRING(1e308 1e308,-1e308 -1e308)')); ST_LENGTH(ST_LINESTRINGFROMTEXT('LINESTRING(1e308 1e308,-1e308 -1e308)')) NULL SELECT ST_LENGTH(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)')); ST_LENGTH(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)')) 20 SELECT ST_LENGTH(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(-10,-10)))); ST_LENGTH(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(-10,-10)))) 28.284271247461902 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_LENGTH(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(-5,5), POINT(0,0)))); ST_LENGTH(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(-5,5), POINT(0,0)))) 24.14213562373095 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_LENGTH(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10)))); ST_LENGTH(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10)))) 38.2842712474619 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_LENGTH(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10), POINT(0,0)))); ST_LENGTH(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10), POINT(0,0)))) 48.2842712474619 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. #==================================================================================== # ST_NUMPOINTS(linestring) #==================================================================================== SELECT ST_NUMPOINTS(ST_LINEFROMTEXT('LINESTRING(0 0,2 2)')); ST_NUMPOINTS(ST_LINEFROMTEXT('LINESTRING(0 0,2 2)')) 2 SELECT ST_NUMPOINTS(ST_LINEFROMTEXT('LINESTRING(0 0,1e308 1e308)')); ST_NUMPOINTS(ST_LINEFROMTEXT('LINESTRING(0 0,1e308 1e308)')) 2 SELECT ST_NUMPOINTS(ST_LINESTRINGFROMTEXT('LINESTRING(1e308 1e308,-1e308 -1e308)')); ST_NUMPOINTS(ST_LINESTRINGFROMTEXT('LINESTRING(1e308 1e308,-1e308 -1e308)')) 2 SELECT ST_NUMPOINTS(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)')); ST_NUMPOINTS(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)')) 5 SELECT ST_NUMPOINTS(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(-10,-10)))); ST_NUMPOINTS(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(-10,-10)))) 3 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_NUMPOINTS(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(-5,5), POINT(0,0)))); ST_NUMPOINTS(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(-5,5), POINT(0,0)))) 4 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_NUMPOINTS(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10)))); ST_NUMPOINTS(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10)))) 4 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_NUMPOINTS(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10), POINT(0,0)))); ST_NUMPOINTS(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10), POINT(0,0)))) 5 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. #==================================================================================== # ST_STARTPOINT(linestring) #==================================================================================== SELECT ST_ASTEXT(ST_STARTPOINT(ST_LINEFROMTEXT('LINESTRING(0 0,2 2)'))); ST_ASTEXT(ST_STARTPOINT(ST_LINEFROMTEXT('LINESTRING(0 0,2 2)'))) POINT(0 0) SELECT ST_ASTEXT(ST_STARTPOINT(ST_LINEFROMTEXT('LINESTRING(0 0,1e308 1e308)'))); ST_ASTEXT(ST_STARTPOINT(ST_LINEFROMTEXT('LINESTRING(0 0,1e308 1e308)'))) POINT(0 0) SELECT ST_ASTEXT(ST_STARTPOINT(ST_LINESTRINGFROMTEXT('LINESTRING(1e308 1e308,-1e308 -1e308)'))); ST_ASTEXT(ST_STARTPOINT(ST_LINESTRINGFROMTEXT('LINESTRING(1e308 1e308,-1e308 -1e308)'))) POINT(1e308 1e308) SELECT ST_ASTEXT(ST_STARTPOINT(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)'))); ST_ASTEXT(ST_STARTPOINT(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)'))) POINT(0 0) SELECT ST_ASTEXT(ST_STARTPOINT(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(-10,-10))))); ST_ASTEXT(ST_STARTPOINT(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(-10,-10))))) POINT(0 0) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ASTEXT(ST_STARTPOINT(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(-5,5), POINT(0,0))))); ST_ASTEXT(ST_STARTPOINT(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(-5,5), POINT(0,0))))) POINT(0 0) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ASTEXT(ST_STARTPOINT(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10))))); ST_ASTEXT(ST_STARTPOINT(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10))))) POINT(0 0) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ASTEXT(ST_STARTPOINT(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10), POINT(0,0))))); ST_ASTEXT(ST_STARTPOINT(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10), POINT(0,0))))) POINT(0 0) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. #==================================================================================== # ST_ENDPOINT(linestring) #==================================================================================== SELECT ST_ASTEXT(ST_ENDPOINT(ST_LINEFROMTEXT('LINESTRING(0 0,2 2)'))); ST_ASTEXT(ST_ENDPOINT(ST_LINEFROMTEXT('LINESTRING(0 0,2 2)'))) POINT(2 2) SELECT ST_ASTEXT(ST_ENDPOINT(ST_LINEFROMTEXT('LINESTRING(0 0,1e308 1e308)'))); ST_ASTEXT(ST_ENDPOINT(ST_LINEFROMTEXT('LINESTRING(0 0,1e308 1e308)'))) POINT(1e308 1e308) SELECT ST_ASTEXT(ST_ENDPOINT(ST_LINESTRINGFROMTEXT('LINESTRING(1e308 1e308,-1e308 -1e308)'))); ST_ASTEXT(ST_ENDPOINT(ST_LINESTRINGFROMTEXT('LINESTRING(1e308 1e308,-1e308 -1e308)'))) POINT(-1e308 -1e308) SELECT ST_ASTEXT(ST_ENDPOINT(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)'))); ST_ASTEXT(ST_ENDPOINT(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)'))) POINT(0 0) SELECT ST_ASTEXT(ST_ENDPOINT(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(-10,-10))))); ST_ASTEXT(ST_ENDPOINT(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(-10,-10))))) POINT(-10 -10) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ASTEXT(ST_ENDPOINT(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(-5,5), POINT(0,0))))); ST_ASTEXT(ST_ENDPOINT(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(-5,5), POINT(0,0))))) POINT(0 0) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ASTEXT(ST_ENDPOINT(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10))))); ST_ASTEXT(ST_ENDPOINT(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10))))) POINT(0 10) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ASTEXT(ST_ENDPOINT(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10), POINT(0,0))))); ST_ASTEXT(ST_ENDPOINT(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10), POINT(0,0))))) POINT(0 0) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. #==================================================================================== # ST_POINTN(linestring, number) #==================================================================================== SELECT ST_ASTEXT(ST_POINTN(ST_LINEFROMTEXT('LINESTRING(0 0,2 2)'), 1)); ST_ASTEXT(ST_POINTN(ST_LINEFROMTEXT('LINESTRING(0 0,2 2)'), 1)) POINT(0 0) SELECT ST_ASTEXT(ST_POINTN(ST_LINEFROMTEXT('LINESTRING(0 0,1e308 1e308)'), 2)); ST_ASTEXT(ST_POINTN(ST_LINEFROMTEXT('LINESTRING(0 0,1e308 1e308)'), 2)) POINT(1e308 1e308) SELECT ST_ASTEXT(ST_POINTN(ST_LINESTRINGFROMTEXT('LINESTRING(1e308 1e308,-1e308 -1e308)'), 2)); ST_ASTEXT(ST_POINTN(ST_LINESTRINGFROMTEXT('LINESTRING(1e308 1e308,-1e308 -1e308)'), 2)) POINT(-1e308 -1e308) SELECT ST_ASTEXT(ST_POINTN(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)'), 3)); ST_ASTEXT(ST_POINTN(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)'), 3)) POINT(5 5) SELECT ST_ASTEXT(ST_POINTN(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(-10,-10))), 3)); ST_ASTEXT(ST_POINTN(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(-10,-10))), 3)) POINT(-10 -10) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ASTEXT(ST_POINTN(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(-5,5), POINT(0,0))), 4)); ST_ASTEXT(ST_POINTN(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(5,5), POINT(-5,5), POINT(0,0))), 4)) POINT(0 0) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ASTEXT(ST_POINTN(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10))), 4)); ST_ASTEXT(ST_POINTN(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10))), 4)) POINT(0 10) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ASTEXT(ST_POINTN(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10), POINT(0,0))), 4)); ST_ASTEXT(ST_POINTN(ST_LINESTRINGFROMWKB(LINESTRING(POINT(0,0), POINT(10,10), POINT(10,0), POINT(0,10), POINT(0,0))), 4)) POINT(0 10) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. #==================================================================================== # ST_NUMINTERIORRINGS(polygon) #==================================================================================== SELECT ST_NUMINTERIORRINGS(ST_POLYFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))')); ST_NUMINTERIORRINGS(ST_POLYFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))')) 0 SELECT ST_NUMINTERIORRINGS(ST_POLYFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))')); ST_NUMINTERIORRINGS(ST_POLYFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))')) 1 SELECT ST_NUMINTERIORRINGS(ST_POLYGONFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2),(6 6,6 8,8 8,8 6,6 6))')); ST_NUMINTERIORRINGS(ST_POLYGONFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2),(6 6,6 8,8 8,8 6,6 6))')) 2 SELECT ST_NUMINTERIORRINGS(ST_POLYGONFROMTEXT('POLYGON((0 0,0 -115,-115 -115,-115 0,0 0))')); ST_NUMINTERIORRINGS(ST_POLYGONFROMTEXT('POLYGON((0 0,0 -115,-115 -115,-115 0,0 0))')) 0 SELECT ST_NUMINTERIORRINGS(ST_POLYFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,5), POINT(5,5), POINT(0,0))))); ST_NUMINTERIORRINGS(ST_POLYFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,5), POINT(5,5), POINT(0,0))))) 0 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_NUMINTERIORRINGS(ST_POLYFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,15), POINT(15,15), POINT(15,0), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4))))); ST_NUMINTERIORRINGS(ST_POLYFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,15), POINT(15,15), POINT(15,0), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4))))) 1 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_NUMINTERIORRINGS(ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,15), POINT(15,15), POINT(15,0), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4)), LINESTRING(POINT(8,8), POINT(8,10), POINT(10,10), POINT(10,8), POINT(8,8))))); ST_NUMINTERIORRINGS(ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,15), POINT(15,15), POINT(15,0), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4)), LINESTRING(POINT(8,8), POINT(8,10), POINT(10,10), POINT(10,8) 2 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_NUMINTERIORRINGS(ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(110,110), POINT(110,5), POINT(5,5), POINT(110,110))))); ST_NUMINTERIORRINGS(ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(110,110), POINT(110,5), POINT(5,5), POINT(110,110))))) 0 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. #==================================================================================== # ST_EXTERIORRING(polygon) #==================================================================================== SELECT ST_ASTEXT(ST_EXTERIORRING(ST_POLYFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))'))); ST_ASTEXT(ST_EXTERIORRING(ST_POLYFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))'))) LINESTRING(0 0,0 5,5 5,5 0,0 0) SELECT ST_ASTEXT(ST_EXTERIORRING(ST_POLYFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))'))); ST_ASTEXT(ST_EXTERIORRING(ST_POLYFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))'))) LINESTRING(0 0,0 10,10 10,10 0,0 0) SELECT ST_ASTEXT(ST_EXTERIORRING(ST_POLYGONFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2),(6 6,6 8,8 8,8 6,6 6))'))); ST_ASTEXT(ST_EXTERIORRING(ST_POLYGONFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2),(6 6,6 8,8 8,8 6,6 6))'))) LINESTRING(0 0,0 10,10 10,10 0,0 0) SELECT ST_ASTEXT(ST_EXTERIORRING(ST_POLYGONFROMTEXT('POLYGON((0 0,0 -115,-115 -115,-115 0,0 0))'))); ST_ASTEXT(ST_EXTERIORRING(ST_POLYGONFROMTEXT('POLYGON((0 0,0 -115,-115 -115,-115 0,0 0))'))) LINESTRING(0 0,0 -115,-115 -115,-115 0,0 0) SELECT ST_ASTEXT(ST_EXTERIORRING(ST_POLYFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,5), POINT(5,5), POINT(0,0)))))); ST_ASTEXT(ST_EXTERIORRING(ST_POLYFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,5), POINT(5,5), POINT(0,0)))))) LINESTRING(0 0,0 5,5 5,0 0) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ASTEXT(ST_EXTERIORRING(ST_POLYFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,15), POINT(15,15), POINT(15,0), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4)))))); ST_ASTEXT(ST_EXTERIORRING(ST_POLYFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,15), POINT(15,15), POINT(15,0), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4)))))) LINESTRING(0 0,0 15,15 15,15 0,0 0) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ASTEXT(ST_EXTERIORRING(ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,15), POINT(15,15), POINT(15,0), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4)), LINESTRING(POINT(8,8), POINT(8,10), POINT(10,10), POINT(10,8), POINT(8,8)))))); ST_ASTEXT(ST_EXTERIORRING(ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,15), POINT(15,15), POINT(15,0), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4)), LINESTRING(POINT(8,8), POINT(8,10), POINT(10,10), POINT LINESTRING(0 0,0 15,15 15,15 0,0 0) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ASTEXT(ST_EXTERIORRING(ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(110,110), POINT(110,5), POINT(5,5), POINT(110,110)))))); ST_ASTEXT(ST_EXTERIORRING(ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(110,110), POINT(110,5), POINT(5,5), POINT(110,110)))))) LINESTRING(110 110,110 5,5 5,110 110) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. #==================================================================================== # ST_INTERIORRINGN(polygon, number) #==================================================================================== SELECT ST_ASTEXT(ST_INTERIORRINGN(ST_POLYFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))'), 1)); ST_ASTEXT(ST_INTERIORRINGN(ST_POLYFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))'), 1)) NULL SELECT ST_ASTEXT(ST_INTERIORRINGN(ST_POLYFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 1)); ST_ASTEXT(ST_INTERIORRINGN(ST_POLYFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 1)) LINESTRING(4 4,4 6,6 6,6 4,4 4) SELECT ST_ASTEXT(ST_INTERIORRINGN(ST_POLYGONFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2),(6 6,6 8,8 8,8 6,6 6))'), 2)); ST_ASTEXT(ST_INTERIORRINGN(ST_POLYGONFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2),(6 6,6 8,8 8,8 6,6 6))'), 2)) LINESTRING(6 6,6 8,8 8,8 6,6 6) SELECT ST_ASTEXT(ST_INTERIORRINGN(ST_POLYGONFROMTEXT('POLYGON((0 0,0 -115,-115 -115,-115 0,0 0))'), 1)); ST_ASTEXT(ST_INTERIORRINGN(ST_POLYGONFROMTEXT('POLYGON((0 0,0 -115,-115 -115,-115 0,0 0))'), 1)) NULL SELECT ST_ASTEXT(ST_INTERIORRINGN(ST_POLYFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,5), POINT(5,5), POINT(0,0)))), 1)); ST_ASTEXT(ST_INTERIORRINGN(ST_POLYFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,5), POINT(5,5), POINT(0,0)))), 1)) NULL Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ASTEXT(ST_INTERIORRINGN(ST_POLYFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,15), POINT(15,15), POINT(15,0), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4)))), 1)); ST_ASTEXT(ST_INTERIORRINGN(ST_POLYFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,15), POINT(15,15), POINT(15,0), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4)))), 1)) LINESTRING(4 4,4 6,6 6,6 4,4 4) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ASTEXT(ST_INTERIORRINGN(ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,15), POINT(15,15), POINT(15,0), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4)), LINESTRING(POINT(8,8), POINT(8,10), POINT(10,10), POINT(10,8), POINT(8,8)))), 2)); ST_ASTEXT(ST_INTERIORRINGN(ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,15), POINT(15,15), POINT(15,0), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4)), LINESTRING(POINT(8,8), POINT(8,10), POINT(10,10), POIN LINESTRING(8 8,8 10,10 10,10 8,8 8) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ASTEXT(ST_INTERIORRINGN(ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(110,110), POINT(110,5), POINT(5,5), POINT(110,110)))), 2)); ST_ASTEXT(ST_INTERIORRINGN(ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(110,110), POINT(110,5), POINT(5,5), POINT(110,110)))), 2)) NULL Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. #==================================================================================== # ST_ISCLOSED(multilinestring) #==================================================================================== SELECT ST_ISCLOSED(ST_MLINEFROMTEXT('MULTILINESTRING((0 0,10 0,0 0))')); ST_ISCLOSED(ST_MLINEFROMTEXT('MULTILINESTRING((0 0,10 0,0 0))')) 1 SELECT ST_ISCLOSED(ST_MLINEFROMTEXT('MULTILINESTRING((0 0,10 0),(0 0,-10 0,0 0))')); ST_ISCLOSED(ST_MLINEFROMTEXT('MULTILINESTRING((0 0,10 0),(0 0,-10 0,0 0))')) 0 SELECT ST_ISCLOSED(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((0 0,10 10,0 0),(0 0,-10 -10,0 0))')); ST_ISCLOSED(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((0 0,10 10,0 0),(0 0,-10 -10,0 0))')) 1 SELECT ST_ISCLOSED(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((0 0,5 0,0 0),(0 0,0 5),(0 0,-5 0),(0 0,0 -5))')); ST_ISCLOSED(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((0 0,5 0,0 0),(0 0,0 5),(0 0,-5 0),(0 0,0 -5))')) 0 SELECT ST_ISCLOSED(ST_MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(0,0))))); ST_ISCLOSED(ST_MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(0,0))))) 1 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ISCLOSED(ST_MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(1e308,1e308))))); ST_ISCLOSED(ST_MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(1e308,1e308))))) 0 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ISCLOSED(ST_MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(10,10), POINT(0,0)), LINESTRING(POINT(1e308,1e308), POINT(-1e308,-1e308), POINT(1e308,1e308))))); ST_ISCLOSED(ST_MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(10,10), POINT(0,0)), LINESTRING(POINT(1e308,1e308), POINT(-1e308,-1e308), POINT(1e308,1e308))))) 1 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ISCLOSED(ST_MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(1e10,1e10))))); ST_ISCLOSED(ST_MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(1e10,1e10))))) 0 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. #==================================================================================== # ST_LENGTH(multilinestring) #==================================================================================== SELECT ST_LENGTH(ST_MLINEFROMTEXT('MULTILINESTRING((0 0,10 0,0 0))')); ST_LENGTH(ST_MLINEFROMTEXT('MULTILINESTRING((0 0,10 0,0 0))')) 20 SELECT ST_LENGTH(ST_MLINEFROMTEXT('MULTILINESTRING((0 0,10 0,0 0),(0 0,-10 0,0 0))')); ST_LENGTH(ST_MLINEFROMTEXT('MULTILINESTRING((0 0,10 0,0 0),(0 0,-10 0,0 0))')) 40 SELECT ST_LENGTH(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((0 0,10 10,0 0),(0 0,-10 -10,0 0))')); ST_LENGTH(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((0 0,10 10,0 0),(0 0,-10 -10,0 0))')) 56.568542494923804 SELECT ST_LENGTH(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((0 0,5 0),(0 0,0 5),(0 0,-5 0),(0 0,0 -5))')); ST_LENGTH(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((0 0,5 0),(0 0,0 5),(0 0,-5 0),(0 0,0 -5))')) 20 SELECT ST_LENGTH(ST_MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(0,0))))); ST_LENGTH(ST_MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(0,0))))) 0 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_LENGTH(ST_MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(1e308,1e308))))); ST_LENGTH(ST_MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(1e308,1e308))))) NULL Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_LENGTH(ST_MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(10,10)), LINESTRING(POINT(1e308,1e308), POINT(-1e308,-1e308))))); ST_LENGTH(ST_MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(10,10)), LINESTRING(POINT(1e308,1e308), POINT(-1e308,-1e308))))) NULL Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_LENGTH(ST_MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(1e10,1e10))))); ST_LENGTH(ST_MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(0,0), POINT(1e10,1e10))))) 14142135623.730951 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. #==================================================================================== # ST_NUMGEOMETRIES(geometrycollection) #==================================================================================== SELECT ST_NUMGEOMETRIES(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0))')); ST_NUMGEOMETRIES(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0))')) 1 SELECT ST_NUMGEOMETRIES(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(' 'POINT(0 0),' 'LINESTRING(0 0,2 2,4 4,6 6,8 8,10 10),' 'POLYGON((0 0,0 5,5 5,5 0,0 0)))')); ST_NUMGEOMETRIES(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(' 'POINT(0 0),' 'LINESTRING(0 0,2 2,4 4,6 6,8 8,10 10),' 3 SELECT ST_NUMGEOMETRIES(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(' 'MULTIPOINT(0 0),' 'MULTILINESTRING((0 0,5 5,10 10),' '(0 0,-5 -5,-10 -10)),' 'MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),' '((5 5,5 10,10 10,10 5,5 5))))')); ST_NUMGEOMETRIES(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(' 'MULTIPOINT(0 0),' 'MULTILINESTRING((0 0,5 5,10 10),' 3 SELECT ST_NUMGEOMETRIES(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(' 'POINT(0 0),' 'GEOMETRYCOLLECTION(),' 'GEOMETRYCOLLECTION(' 'GEOMETRYCOLLECTION()),' 'LINESTRING(0 0,2 2,4 4,6 6,8 8,10 10))')); ST_NUMGEOMETRIES(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(' 'POINT(0 0),' 'GEOMETRYCOLLECTION(),' 4 SELECT ST_NUMGEOMETRIES(ST_GEOMCOLLFROMWKB(GEOMETRYCOLLECTION( POINT(10,10), LINESTRING(POINT(0,0), POINT(2,2), POINT(4,4), POINT(6,6), POINT(8,8)), POLYGON(LINESTRING(POINT(0,0), POINT(10,0), POINT(10,10), POINT(0,10), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4)))))); ST_NUMGEOMETRIES(ST_GEOMCOLLFROMWKB(GEOMETRYCOLLECTION( POINT(10,10), LINESTRING(POINT(0,0), POINT(2,2), POINT(4,4), POINT(6,6), POINT(8,8)), POLYGON(LINESTRING(POINT(0,0), POINT(10,0), POINT(10,10), POINT(0,10), POINT(0,0)), LINESTRING(POINT(4,4), POINT( 3 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_NUMGEOMETRIES(ST_GEOMCOLLFROMWKB(GEOMETRYCOLLECTION( MULTIPOINT(POINT(1e308,1e308), POINT(-1e308,1e308), POINT(1e308,-1e308)), MULTILINESTRING(LINESTRING(POINT(0,0), POINT(5,5), POINT(10,10)), LINESTRING(POINT(0,0), POINT(-5,-5), POINT(-10,-10))), MULTIPOLYGON(POLYGON(LINESTRING(POINT(0,0), POINT(0,1), POINT(1,1), POINT(1,0), POINT(0,0))), POLYGON(LINESTRING(POINT(2,2), POINT(2,13), POINT(13,13), POINT(13,2), POINT(2,2)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4))))))); ST_NUMGEOMETRIES(ST_GEOMCOLLFROMWKB(GEOMETRYCOLLECTION( MULTIPOINT(POINT(1e308,1e308), POINT(-1e308,1e308), POINT(1e308,-1e308)), MULTILINESTRING(LINESTRING(POINT(0,0), POINT(5,5), POINT(10,10)), LINESTRING(POINT(0,0), POINT(-5,-5), POINT(-10,-10))), MULT 3 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_NUMGEOMETRIES(ST_GEOMETRYCOLLECTIONFROMWKB(GEOMETRYCOLLECTION( POINT(0,0), LINESTRING(POINT(0,0), POINT(2,2), POINT(4,4), POINT(6,6)), POLYGON(LINESTRING(POINT(0,0), POINT(10,0), POINT(10,10), POINT(0,10), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4))), MULTIPOINT(POINT(1e308,1e308), POINT(-1e308,1e308), POINT(1e308,-1e308)), MULTILINESTRING(LINESTRING(POINT(0,0), POINT(5,5), POINT(10,10)), LINESTRING(POINT(0,0), POINT(-5,-5), POINT(-10,-10))), MULTIPOLYGON(POLYGON(LINESTRING(POINT(0,0), POINT(0,1), POINT(1,1), POINT(1,0), POINT(0,0))), POLYGON(LINESTRING(POINT(2,2), POINT(2,3), POINT(3,3), POINT(3,2), POINT(2,2))))))); ST_NUMGEOMETRIES(ST_GEOMETRYCOLLECTIONFROMWKB(GEOMETRYCOLLECTION( POINT(0,0), LINESTRING(POINT(0,0), POINT(2,2), POINT(4,4), POINT(6,6)), POLYGON(LINESTRING(POINT(0,0), POINT(10,0), POINT(10,10), POINT(0,10), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6) 6 Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. #==================================================================================== # ST_GEOMETRYN(geometrycollection, number) #==================================================================================== SELECT ST_ASTEXT(ST_GEOMETRYN(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0))'), 1)); ST_ASTEXT(ST_GEOMETRYN(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0))'), 1)) POINT(0 0) SELECT ST_ASTEXT(ST_GEOMETRYN(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(' 'POINT(0 0),' 'LINESTRING(0 0,2 2,4 4,6 6,8 8,10 10),' 'POLYGON((0 0,0 5,5 5,5 0,0 0)))'), 2)); ST_ASTEXT(ST_GEOMETRYN(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(' 'POINT(0 0),' 'LINESTRING(0 0,2 2,4 4,6 6,8 8,10 10),' LINESTRING(0 0,2 2,4 4,6 6,8 8,10 10) SELECT ST_ASTEXT(ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(' 'MULTIPOINT(0 0),' 'MULTILINESTRING((0 0,5 5,10 10),' '(0 0,-5 -5,-10 -10)),' 'MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),' '((5 5,5 10,10 10,10 5,5 5))))'), 3)); ST_ASTEXT(ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(' 'MULTIPOINT(0 0),' 'MULTILINESTRING((0 0,5 5,10 10),' MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5))) SELECT ST_ASTEXT(ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(' 'POINT(0 0),' 'GEOMETRYCOLLECTION(),' 'GEOMETRYCOLLECTION(' 'GEOMETRYCOLLECTION()),' 'LINESTRING(0 0,2 2,4 4,6 6,8 8,10 10))'), 2)); ST_ASTEXT(ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(' 'POINT(0 0),' 'GEOMETRYCOLLECTION(),' GEOMETRYCOLLECTION() SELECT ST_ASTEXT(ST_GEOMETRYN(ST_GEOMCOLLFROMWKB(GEOMETRYCOLLECTION( POINT(10,10), LINESTRING(POINT(0,0), POINT(2,2), POINT(4,4), POINT(6,6), POINT(8,8)), POLYGON(LINESTRING(POINT(0,0), POINT(10,0), POINT(10,10), POINT(0,10), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4))))), 2)); ST_ASTEXT(ST_GEOMETRYN(ST_GEOMCOLLFROMWKB(GEOMETRYCOLLECTION( POINT(10,10), LINESTRING(POINT(0,0), POINT(2,2), POINT(4,4), POINT(6,6), POINT(8,8)), POLYGON(LINESTRING(POINT(0,0), POINT(10,0), POINT(10,10), POINT(0,10), POINT(0,0)), LINESTRING(POINT(4,4), LINESTRING(0 0,2 2,4 4,6 6,8 8) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ASTEXT(ST_GEOMETRYN(ST_GEOMCOLLFROMWKB(GEOMETRYCOLLECTION( MULTIPOINT(POINT(1e308,1e308), POINT(-1e308,1e308), POINT(1e308,-1e308)), MULTILINESTRING(LINESTRING(POINT(0,0), POINT(5,5), POINT(10,10)), LINESTRING(POINT(0,0), POINT(-5,-5), POINT(-10,-10))), MULTIPOLYGON(POLYGON(LINESTRING(POINT(0,0), POINT(0,1), POINT(1,1), POINT(1,0), POINT(0,0))), POLYGON(LINESTRING(POINT(2,2), POINT(2,13), POINT(13,13), POINT(13,2), POINT(2,2)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4)))))), 3)); ST_ASTEXT(ST_GEOMETRYN(ST_GEOMCOLLFROMWKB(GEOMETRYCOLLECTION( MULTIPOINT(POINT(1e308,1e308), POINT(-1e308,1e308), POINT(1e308,-1e308)), MULTILINESTRING(LINESTRING(POINT(0,0), POINT(5,5), POINT(10,10)), LINESTRING(POINT(0,0), POINT(-5,-5), POINT(-10,-10))) MULTIPOLYGON(((0 0,0 1,1 1,1 0,0 0)),((2 2,2 13,13 13,13 2,2 2),(4 4,4 6,6 6,6 4,4 4))) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ASTEXT(ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMWKB(GEOMETRYCOLLECTION( POINT(0,0), LINESTRING(POINT(0,0), POINT(2,2), POINT(4,4), POINT(6,6)), POLYGON(LINESTRING(POINT(0,0), POINT(10,0), POINT(10,10), POINT(0,10), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4))), MULTIPOINT(POINT(1e308,1e308), POINT(-1e308,1e308), POINT(1e308,-1e308)), MULTILINESTRING(LINESTRING(POINT(0,0), POINT(5,5), POINT(10,10)), LINESTRING(POINT(0,0), POINT(-5,-5), POINT(-10,-10))), MULTIPOLYGON(POLYGON(LINESTRING(POINT(0,0), POINT(0,1), POINT(1,1), POINT(1,0), POINT(0,0))), POLYGON(LINESTRING(POINT(2,2), POINT(2,3), POINT(3,3), POINT(3,2), POINT(2,2)))))), 2)); ST_ASTEXT(ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMWKB(GEOMETRYCOLLECTION( POINT(0,0), LINESTRING(POINT(0,0), POINT(2,2), POINT(4,4), POINT(6,6)), POLYGON(LINESTRING(POINT(0,0), POINT(10,0), POINT(10,10), POINT(0,10), POINT(0,0)), LINESTRING(POINT(4,4), POIN LINESTRING(0 0,2 2,4 4,6 6) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ASTEXT(ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMWKB(GEOMETRYCOLLECTION( POINT(0,0), LINESTRING(POINT(0,0), POINT(2,2), POINT(4,4), POINT(6,6)), POLYGON(LINESTRING(POINT(0,0), POINT(10,0), POINT(10,10), POINT(0,10), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4))), MULTIPOINT(POINT(1e308,1e308), POINT(-1e308,1e308), POINT(1e308,-1e308)), MULTILINESTRING(LINESTRING(POINT(0,0), POINT(5,5), POINT(10,10)), LINESTRING(POINT(0,0), POINT(-5,-5), POINT(-10,-10))), MULTIPOLYGON(POLYGON(LINESTRING(POINT(0,0), POINT(0,1), POINT(1,1), POINT(1,0), POINT(0,0))), POLYGON(LINESTRING(POINT(2,2), POINT(2,3), POINT(3,3), POINT(3,2), POINT(2,2)))))), 5)); ST_ASTEXT(ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMWKB(GEOMETRYCOLLECTION( POINT(0,0), LINESTRING(POINT(0,0), POINT(2,2), POINT(4,4), POINT(6,6)), POLYGON(LINESTRING(POINT(0,0), POINT(10,0), POINT(10,10), POINT(0,10), POINT(0,0)), LINESTRING(POINT(4,4), POIN MULTILINESTRING((0 0,5 5,10 10),(0 0,-5 -5,-10 -10)) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. SELECT ST_ASTEXT(ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMWKB(GEOMETRYCOLLECTION( POINT(0,0), LINESTRING(POINT(0,0), POINT(2,2), POINT(4,4), POINT(6,6)), POLYGON(LINESTRING(POINT(0,0), POINT(10,0), POINT(10,10), POINT(0,10), POINT(0,0)), LINESTRING(POINT(4,4), POINT(4,6), POINT(6,6), POINT(6,4), POINT(4,4))), MULTIPOINT(POINT(1e308,1e308), POINT(-1e308,1e308), POINT(1e308,-1e308)), MULTILINESTRING(LINESTRING(POINT(0,0), POINT(5,5), POINT(10,10)), LINESTRING(POINT(0,0), POINT(-5,-5), POINT(-10,-10))), MULTIPOLYGON(POLYGON(LINESTRING(POINT(0,0), POINT(0,1), POINT(1,1), POINT(1,0), POINT(0,0))), POLYGON(LINESTRING(POINT(2,2), POINT(2,3), POINT(3,3), POINT(3,2), POINT(2,2)))))), 6)); ST_ASTEXT(ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMWKB(GEOMETRYCOLLECTION( POINT(0,0), LINESTRING(POINT(0,0), POINT(2,2), POINT(4,4), POINT(6,6)), POLYGON(LINESTRING(POINT(0,0), POINT(10,0), POINT(10,10), POINT(0,10), POINT(0,0)), LINESTRING(POINT(4,4), POIN MULTIPOLYGON(((0 0,0 1,1 1,1 0,0 0)),((2 2,2 3,3 3,3 2,2 2))) Warnings: Warning 3195 st_geometryfromwkb(geometry) is deprecated and will be replaced by st_srid(geometry, 0) in a future version. Use st_geometryfromwkb(st_aswkb(geometry), 0) instead. #==================================================================================== # ST_X(point) #==================================================================================== SELECT ST_X(); ERROR 42000: Incorrect parameter count in the call to native function 'ST_X' SELECT ST_X(NULL); ST_X(NULL) NULL SELECT ST_X(ST_POINTFROMWKB()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_POINTFROMWKB' SELECT ST_X(ST_POINTFROMWKB(POINT(0,0)), 2); ERROR 42000: Incorrect parameter count in the call to native function 'ST_X' SELECT ST_X(ST_POINTFROMWKB(NULL)); ST_X(ST_POINTFROMWKB(NULL)) NULL SELECT ST_X(ST_POINTFROMWKB(POINT(1))); 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 ')))' at line 1 SELECT ST_X(ST_POINTFROMWKB(POINT(1,a))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_X(ST_POINTFROMWKB(POINT(a,b))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_X(ST_POINTFROMTEXT()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_POINTFROMTEXT' SELECT ST_X(ST_POINTFROMTEXT('NULL')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_X(ST_POINTFROMTEXT('POINT()')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_X(ST_POINTFROMTEXT('POINT(1)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_X(ST_POINTFROMTEXT('POINT(a 1)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_X(ST_POINTFROMTEXT('POINT(1 1,2)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_X(ST_POINTFROMTEXT('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 #==================================================================================== # ST_Y(point) #==================================================================================== SELECT ST_Y(); ERROR 42000: Incorrect parameter count in the call to native function 'ST_Y' SELECT ST_Y(NULL); ST_Y(NULL) NULL SELECT ST_Y(ST_POINTFROMWKB()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_POINTFROMWKB' SELECT ST_Y(ST_POINTFROMWKB(POINT(0,0)), 2); ERROR 42000: Incorrect parameter count in the call to native function 'ST_Y' SELECT ST_Y(ST_POINTFROMWKB(NULL)); ST_Y(ST_POINTFROMWKB(NULL)) NULL SELECT ST_Y(ST_POINTFROMWKB(POINT(1))); 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 ')))' at line 1 SELECT ST_Y(ST_POINTFROMWKB(POINT(1,a))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_Y(ST_POINTFROMWKB(POINT(a,b))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_Y(ST_POINTFROMTEXT()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_POINTFROMTEXT' SELECT ST_Y(ST_POINTFROMTEXT('NULL')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_Y(ST_POINTFROMTEXT('POINT()')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_Y(ST_POINTFROMTEXT('POINT(1)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_Y(ST_POINTFROMTEXT('POINT(a 1)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_Y(ST_POINTFROMTEXT('POINT(1 1,2)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_Y(ST_POINTFROMTEXT('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 #==================================================================================== # ST_ISCLOSED(linestring) #==================================================================================== SELECT ST_ISCLOSED(); ERROR 42000: Incorrect parameter count in the call to native function 'ST_ISCLOSED' SELECT ST_ISCLOSED(NULL); ST_ISCLOSED(NULL) NULL SELECT ST_ISCLOSED(ST_LINEFROMWKB()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_LINEFROMWKB' SELECT ST_ISCLOSED(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(2,2))), 2); ERROR 42000: Incorrect parameter count in the call to native function 'ST_ISCLOSED' SELECT ST_ISCLOSED(ST_LINESTRINGFROMWKB(LINESTRING(POINT(a,1), POINT(2,2)))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_ISCLOSED(ST_LINESTRINGFROMWKB(LINESTRING(POINT(a,1), POINT(2,b)))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_ISCLOSED(ST_LINEFROMTEXT()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_LINEFROMTEXT' SELECT ST_ISCLOSED(ST_LINEFROMTEXT('NULL')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_ISCLOSED(ST_LINEFROMTEXT('LINESTRING()')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_ISCLOSED(ST_LINEFROMTEXT('LINESTRING(0)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_ISCLOSED(ST_LINESTRINGFROMTEXT('LINESTRING(1 2,1')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_ISCLOSED(ST_LINESTRINGFROMTEXT('LINESTRING(1 1,2 2,a 3)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_ISCLOSED(ST_LINESTRINGFROMTEXT('LINESTRING('!' 0,1 1,2 2)')); 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,1 1,2 2)'))' at line 1 #==================================================================================== # ST_LENGTH(linestring) #==================================================================================== SELECT ST_LENGTH(); ERROR 42000: Incorrect parameter count in the call to native function 'ST_LENGTH' SELECT ST_LENGTH(NULL); ST_LENGTH(NULL) NULL SELECT ST_LENGTH(ST_LINEFROMWKB()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_LINEFROMWKB' SELECT ST_LENGTH(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(2,2))), 2); ERROR 42000: Incorrect parameter count in the call to native function 'ST_LENGTH' SELECT ST_LENGTH(ST_LINESTRINGFROMWKB(LINESTRING(POINT(a,1), POINT(2,2)))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_LENGTH(ST_LINESTRINGFROMWKB(LINESTRING(POINT(a,1), POINT(2,b)))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_LENGTH(ST_LINEFROMTEXT()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_LINEFROMTEXT' SELECT ST_LENGTH(ST_LINEFROMTEXT('NULL')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_LENGTH(ST_LINEFROMTEXT('LINESTRING()')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_LENGTH(ST_LINEFROMTEXT('LINESTRING(0)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_LENGTH(ST_LINESTRINGFROMTEXT('LINESTRING(1 2,1')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_LENGTH(ST_LINESTRINGFROMTEXT('LINESTRING(1 1,2 2,a 3)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_LENGTH(ST_LINESTRINGFROMTEXT('LINESTRING('!' 0,1 1,2 2)')); 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,1 1,2 2)'))' at line 1 #==================================================================================== # ST_NUMPOINTS(linestring) #==================================================================================== SELECT ST_NUMPOINTS(); ERROR 42000: Incorrect parameter count in the call to native function 'ST_NUMPOINTS' SELECT ST_NUMPOINTS(NULL); ST_NUMPOINTS(NULL) NULL SELECT ST_NUMPOINTS(ST_LINEFROMWKB()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_LINEFROMWKB' SELECT ST_NUMPOINTS(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(2,2))), 2); ERROR 42000: Incorrect parameter count in the call to native function 'ST_NUMPOINTS' SELECT ST_NUMPOINTS(ST_LINESTRINGFROMWKB(LINESTRING(POINT(a,1), POINT(2,2)))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_NUMPOINTS(ST_LINESTRINGFROMWKB(LINESTRING(POINT(a,1), POINT(2,b)))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_NUMPOINTS(ST_LINEFROMTEXT()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_LINEFROMTEXT' SELECT ST_NUMPOINTS(ST_LINEFROMTEXT('NULL')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_NUMPOINTS(ST_LINEFROMTEXT('LINESTRING()')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_NUMPOINTS(ST_LINEFROMTEXT('LINESTRING(0)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_NUMPOINTS(ST_LINESTRINGFROMTEXT('LINESTRING(1 2,1')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_NUMPOINTS(ST_LINESTRINGFROMTEXT('LINESTRING(1 1,2 2,a 3)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_NUMPOINTS(ST_LINESTRINGFROMTEXT('LINESTRING('!' 0,1 1,2 2)')); 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,1 1,2 2)'))' at line 1 #==================================================================================== # ST_STARTPOINT(linestring) #==================================================================================== SELECT ST_STARTPOINT(); ERROR 42000: Incorrect parameter count in the call to native function 'ST_STARTPOINT' SELECT ST_STARTPOINT(NULL); ST_STARTPOINT(NULL) NULL SELECT ST_STARTPOINT(ST_LINEFROMWKB()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_LINEFROMWKB' SELECT ST_STARTPOINT(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(2,2))), 2); ERROR 42000: Incorrect parameter count in the call to native function 'ST_STARTPOINT' SELECT ST_STARTPOINT(ST_LINESTRINGFROMWKB(LINESTRING(POINT(a,1), POINT(2,2)))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_STARTPOINT(ST_LINESTRINGFROMWKB(LINESTRING(POINT(a,1), POINT(2,b)))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_STARTPOINT(ST_LINEFROMTEXT()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_LINEFROMTEXT' SELECT ST_STARTPOINT(ST_LINEFROMTEXT('NULL')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_STARTPOINT(ST_LINEFROMTEXT('LINESTRING()')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_STARTPOINT(ST_LINEFROMTEXT('LINESTRING(0)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_STARTPOINT(ST_LINESTRINGFROMTEXT('LINESTRING(1 2,1')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_STARTPOINT(ST_LINESTRINGFROMTEXT('LINESTRING(1 1,2 2,a 3)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_STARTPOINT(ST_LINESTRINGFROMTEXT('LINESTRING('!' 0,1 1,2 2)')); 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,1 1,2 2)'))' at line 1 #==================================================================================== # ST_ENDPOINT(linestring) #==================================================================================== SELECT ST_ENDPOINT(); ERROR 42000: Incorrect parameter count in the call to native function 'ST_ENDPOINT' SELECT ST_ENDPOINT(NULL); ST_ENDPOINT(NULL) NULL SELECT ST_ENDPOINT(ST_LINEFROMWKB()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_LINEFROMWKB' SELECT ST_ENDPOINT(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(2,2))), 2); ERROR 42000: Incorrect parameter count in the call to native function 'ST_ENDPOINT' SELECT ST_ENDPOINT(ST_LINESTRINGFROMWKB(LINESTRING(POINT(a,1), POINT(2,2)))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_ENDPOINT(ST_LINESTRINGFROMWKB(LINESTRING(POINT(a,1), POINT(2,b)))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_ENDPOINT(ST_LINEFROMTEXT()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_LINEFROMTEXT' SELECT ST_ENDPOINT(ST_LINEFROMTEXT('NULL')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_ENDPOINT(ST_LINEFROMTEXT('LINESTRING()')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_ENDPOINT(ST_LINEFROMTEXT('LINESTRING(0)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_ENDPOINT(ST_LINESTRINGFROMTEXT('LINESTRING(1 2,1')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_ENDPOINT(ST_LINESTRINGFROMTEXT('LINESTRING(1 1,2 2,a 3)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_ENDPOINT(ST_LINESTRINGFROMTEXT('LINESTRING('!' 0,1 1,2 2)')); 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,1 1,2 2)'))' at line 1 #==================================================================================== # ST_POINTN(linestring, number) #==================================================================================== SELECT ST_POINTN(); ERROR 42000: Incorrect parameter count in the call to native function 'ST_POINTN' SELECT ST_POINTN(NULL); ERROR 42000: Incorrect parameter count in the call to native function 'ST_POINTN' SELECT ST_POINTN(NULL, 1); ST_POINTN(NULL, 1) NULL SELECT ST_POINTN(ST_LINEFROMWKB()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_POINTN' SELECT ST_POINTN(ST_LINEFROMWKB(LINESTRING(POINT(0,0), POINT(2,2)))); ERROR 42000: Incorrect parameter count in the call to native function 'ST_POINTN' SELECT ST_POINTN(ST_LINESTRINGFROMWKB(LINESTRING(POINT(a,1), POINT(2,2))), 1); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_POINTN(ST_LINESTRINGFROMWKB(LINESTRING(POINT(a,1), POINT(2,b))), 1); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_POINTN(ST_LINESTRINGFROMWKB(LINESTRING(POINT(1,1), POINT(2,2))), a); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_POINTN(ST_LINEFROMTEXT()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_POINTN' SELECT ST_POINTN(ST_LINEFROMTEXT('NULL')); ERROR 42000: Incorrect parameter count in the call to native function 'ST_POINTN' SELECT ST_POINTN(ST_LINEFROMTEXT('NULL'), 1); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_POINTN(ST_LINEFROMTEXT('LINESTRING()'), 2); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_POINTN(ST_LINEFROMTEXT('LINESTRING(0)'), 3); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_POINTN(ST_LINESTRINGFROMTEXT('LINESTRING(1 2,1'), 4); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_POINTN(ST_LINESTRINGFROMTEXT('LINESTRING(1 1,2 2,a 3)'), 5); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_POINTN(ST_LINESTRINGFROMTEXT('LINESTRING('!' 0,1 1,2 2)'), 6); 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,1 1,2 2)'), 6)' at line 1 SELECT ST_POINTN(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,1 1,2 2)'), 0); ST_POINTN(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,1 1,2 2)'), 0) NULL SELECT ST_POINTN(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,1 1,2 2)'), -1); ST_POINTN(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,1 1,2 2)'), -1) NULL SELECT ST_POINTN(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,1 1,2 2)'), -1024); ST_POINTN(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,1 1,2 2)'), -1024) NULL SELECT ST_POINTN(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,1 1,2 2)'), 10000); ST_POINTN(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,1 1,2 2)'), 10000) NULL SELECT ST_POINTN(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,1 1,2 2)'), 1234567890); ST_POINTN(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,1 1,2 2)'), 1234567890) NULL SELECT ST_POINTN(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,1 1,2 2)'), 'a'); ST_POINTN(ST_LINESTRINGFROMTEXT('LINESTRING(0 0,1 1,2 2)'), 'a') NULL Warnings: Warning 1292 Truncated incorrect INTEGER value: 'a' #==================================================================================== # ST_NUMINTERIORRINGS(polygon) #==================================================================================== SELECT ST_NUMINTERIORRINGS(); ERROR 42000: Incorrect parameter count in the call to native function 'ST_NUMINTERIORRINGS' SELECT ST_NUMINTERIORRINGS(NULL); ST_NUMINTERIORRINGS(NULL) NULL SELECT ST_NUMINTERIORRINGS(ST_POLYFROMWKB()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_POLYFROMWKB' SELECT ST_NUMINTERIORRINGS(ST_POLYFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,1), POINT(1,1), POINT(0,0)))), 1); ERROR 42000: Incorrect parameter count in the call to native function 'ST_NUMINTERIORRINGS' SELECT ST_NUMINTERIORRINGS(ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(a,0), POINT(0,1), POINT(1,1), POINT(0,0))))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_NUMINTERIORRINGS(ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(a,0), POINT(b,1), POINT(1,1), POINT(0,0))))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_NUMINTERIORRINGS(ST_POLYFROMTEXT()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_POLYFROMTEXT' SELECT ST_NUMINTERIORRINGS(ST_POLYFROMTEXT('NULL')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_NUMINTERIORRINGS(ST_POLYFROMTEXT('POLYGON(())')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_NUMINTERIORRINGS(ST_POLYFROMTEXT('POLYGON((0))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_NUMINTERIORRINGS(ST_POLYGONFROMTEXT('POLYGON((0 0,0 4,4 4,0 0)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_NUMINTERIORRINGS(ST_POLYGONFROMTEXT('POLYGON((0 0,2 0,2))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_NUMINTERIORRINGS(ST_POLYGONFROMTEXT('POLYGON((0 0,0 5,5 a,0 0))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_NUMINTERIORRINGS(ST_POLYGONFROMTEXT('POLYGON(('!' 0,2 0,2 4,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,2 0,2 4,0 0))'))' at line 1 #==================================================================================== # ST_EXTERIORRING(polygon) #==================================================================================== SELECT ST_EXTERIORRING(); ERROR 42000: Incorrect parameter count in the call to native function 'ST_EXTERIORRING' SELECT ST_EXTERIORRING(NULL); ST_EXTERIORRING(NULL) NULL SELECT ST_EXTERIORRING(ST_POLYFROMWKB()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_POLYFROMWKB' SELECT ST_EXTERIORRING(ST_POLYFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,1), POINT(1,1), POINT(0,0)))), 1); ERROR 42000: Incorrect parameter count in the call to native function 'ST_EXTERIORRING' SELECT ST_EXTERIORRING(ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(a,0), POINT(0,1), POINT(1,1), POINT(0,0))))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_EXTERIORRING(ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(a,0), POINT(b,1), POINT(1,1), POINT(0,0))))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_EXTERIORRING(ST_POLYFROMTEXT()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_POLYFROMTEXT' SELECT ST_EXTERIORRING(ST_POLYFROMTEXT('NULL')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_EXTERIORRING(ST_POLYFROMTEXT('POLYGON(())')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_EXTERIORRING(ST_POLYFROMTEXT('POLYGON((0))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_EXTERIORRING(ST_POLYGONFROMTEXT('POLYGON((0 0,0 4,4 4,0 0)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_EXTERIORRING(ST_POLYGONFROMTEXT('POLYGON((0 0,2 0,2))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_EXTERIORRING(ST_POLYGONFROMTEXT('POLYGON((0 0,0 5,5 a,0 0))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_EXTERIORRING(ST_POLYGONFROMTEXT('POLYGON(('!' 0,2 0,2 4,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,2 0,2 4,0 0))'))' at line 1 #==================================================================================== # ST_INTERIORRINGN(polygon, number) #==================================================================================== SELECT ST_INTERIORRINGN(); ERROR 42000: Incorrect parameter count in the call to native function 'ST_INTERIORRINGN' SELECT ST_INTERIORRINGN(NULL); ERROR 42000: Incorrect parameter count in the call to native function 'ST_INTERIORRINGN' SELECT ST_INTERIORRINGN(NULL, 1); ST_INTERIORRINGN(NULL, 1) NULL SELECT ST_INTERIORRINGN(ST_POLYFROMWKB()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_INTERIORRINGN' SELECT ST_INTERIORRINGN(ST_POLYFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,1), POINT(1,1), POINT(0,0))))); ERROR 42000: Incorrect parameter count in the call to native function 'ST_INTERIORRINGN' SELECT ST_INTERIORRINGN(ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(a,0), POINT(0,1), POINT(1,1), POINT(0,0)))), 1); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_INTERIORRINGN(ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(a,0), POINT(b,1), POINT(1,1), POINT(0,0)))), 1); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_INTERIORRINGN(ST_POLYGONFROMWKB(POLYGON(LINESTRING(POINT(0,0), POINT(0,1), POINT(1,1), POINT(0,0)))), a); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_INTERIORRINGN(ST_POLYFROMTEXT()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_INTERIORRINGN' SELECT ST_INTERIORRINGN(ST_POLYFROMTEXT('NULL'), 1); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_INTERIORRINGN(ST_POLYFROMTEXT('POLYGON(())'), 2); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_INTERIORRINGN(ST_POLYFROMTEXT('POLYGON((0))'), 3); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_INTERIORRINGN(ST_POLYGONFROMTEXT('POLYGON((0 0,0 4,4 4,0 0)'), 4); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_INTERIORRINGN(ST_POLYGONFROMTEXT('POLYGON((0 0,2 0,2))'), 5); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_INTERIORRINGN(ST_POLYGONFROMTEXT('POLYGON((0 0,0 5,5 a,0 0))'), 6); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_INTERIORRINGN(ST_POLYGONFROMTEXT('POLYGON(('!' 0,2 0,2 4,0 0))'), 7); 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,2 0,2 4,0 0))'), 7)' at line 1 SELECT ST_INTERIORRINGN(ST_POLYGONFROMTEXT('POLYGON((0 0,0 2,2 2,0 0))'), 0); ST_INTERIORRINGN(ST_POLYGONFROMTEXT('POLYGON((0 0,0 2,2 2,0 0))'), 0) NULL SELECT ST_INTERIORRINGN(ST_POLYGONFROMTEXT('POLYGON((0 0,0 2,2 2,0 0))'), -1); ST_INTERIORRINGN(ST_POLYGONFROMTEXT('POLYGON((0 0,0 2,2 2,0 0))'), -1) NULL SELECT ST_INTERIORRINGN(ST_POLYGONFROMTEXT('POLYGON((0 0,0 2,2 2,0 0))'), -1024); ST_INTERIORRINGN(ST_POLYGONFROMTEXT('POLYGON((0 0,0 2,2 2,0 0))'), -1024) NULL SELECT ST_INTERIORRINGN(ST_POLYGONFROMTEXT('POLYGON((0 0,0 2,2 2,0 0))'), 10000); ST_INTERIORRINGN(ST_POLYGONFROMTEXT('POLYGON((0 0,0 2,2 2,0 0))'), 10000) NULL SELECT ST_INTERIORRINGN(ST_POLYGONFROMTEXT('POLYGON((0 0,0 2,2 2,0 0))'), 123456789); ST_INTERIORRINGN(ST_POLYGONFROMTEXT('POLYGON((0 0,0 2,2 2,0 0))'), 123456789) NULL #==================================================================================== # ST_ISCLOSED(multilinestring) #==================================================================================== SELECT ST_ISCLOSED(); ERROR 42000: Incorrect parameter count in the call to native function 'ST_ISCLOSED' SELECT ST_ISCLOSED(NULL); ST_ISCLOSED(NULL) NULL SELECT ST_ISCLOSED(MLINEFROMWKB()); ERROR 42000: Incorrect parameter count in the call to native function 'MLINEFROMWKB' SELECT ST_ISCLOSED(MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(1,1), POINT(2,2)))), 1); ERROR 42000: Incorrect parameter count in the call to native function 'ST_ISCLOSED' SELECT ST_ISCLOSED(MULTILINESTRINGFROMWKB(MULTILINESTRING(LINESTRING(POINT(1,1), POINT(2,2), POINT(3,3), POINT(a,4))))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_ISCLOSED(MULTILINESTRINGFROMWKB(MULTILINESTRING(LINESTRING(POINT(1,1), POINT(2,2)), LINESTRING(POINT(3,3), POINT(a,4))))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_ISCLOSED(ST_POLYFROMTEXT()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_POLYFROMTEXT' SELECT ST_ISCLOSED(ST_MLINEFROMTEXT('NULL')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_ISCLOSED(ST_MLINEFROMTEXT('MULTILINESTRING(())')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_ISCLOSED(ST_MLINEFROMTEXT('MULTILINESTRING((1 1,2 2),()')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_ISCLOSED(ST_MLINEFROMTEXT('MULTILINESTRING((1 1,2 2,3 3)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_ISCLOSED(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((1 1,2 3,3 3,4))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_ISCLOSED(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((1 1,2 2,3 3,4 a))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_ISCLOSED(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING(('!' 1,2 2,3 3,4 4')); 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 '!' 1,2 2,3 3,4 4'))' at line 1 #==================================================================================== # ST_LENGTH(multilinestring) #==================================================================================== SELECT ST_LENGTH(); ERROR 42000: Incorrect parameter count in the call to native function 'ST_LENGTH' SELECT ST_LENGTH(NULL); ST_LENGTH(NULL) NULL SELECT ST_LENGTH(MLINEFROMWKB()); ERROR 42000: Incorrect parameter count in the call to native function 'MLINEFROMWKB' SELECT ST_LENGTH(MLINEFROMWKB(MULTILINESTRING(LINESTRING(POINT(1,1), POINT(2,2)))), 1); ERROR 42000: Incorrect parameter count in the call to native function 'ST_LENGTH' SELECT ST_LENGTH(MULTILINESTRINGFROMWKB(MULTILINESTRING(LINESTRING(POINT(1,1), POINT(2,2), POINT(3,3), POINT(a,4))))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_LENGTH(MULTILINESTRINGFROMWKB(MULTILINESTRING(LINESTRING(POINT(1,1), POINT(2,2)), LINESTRING(POINT(3,3), POINT(a,4))))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_LENGTH(ST_POLYFROMTEXT()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_POLYFROMTEXT' SELECT ST_LENGTH(ST_MLINEFROMTEXT('NULL')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_LENGTH(ST_MLINEFROMTEXT('MULTILINESTRING(())')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_LENGTH(ST_MLINEFROMTEXT('MULTILINESTRING((1 1,2 2),()')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_LENGTH(ST_MLINEFROMTEXT('MULTILINESTRING((1 1,2 2,3 3)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_LENGTH(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((1 1,2 3,3 3,4))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_LENGTH(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((1 1,2 2,3 3,4 a))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_LENGTH(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING(('!' 1,2 2,3 3,4 4')); 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 '!' 1,2 2,3 3,4 4'))' at line 1 #==================================================================================== # ST_NUMGEOMETRIES(geometrycollection) #==================================================================================== SELECT ST_NUMGEOMETRIES(); ERROR 42000: Incorrect parameter count in the call to native function 'ST_NUMGEOMETRIES' SELECT ST_NUMGEOMETRIES(NULL); ST_NUMGEOMETRIES(NULL) NULL SELECT ST_NUMGEOMETRIES(ST_GEOMCOLLFROMWKB()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_GEOMCOLLFROMWKB' SELECT ST_NUMGEOMETRIES(ST_GEOMCOLLFROMWKB(GEOMETRYCOLLECTION(POINT(0,0), LINESTRING(POINT(1,1), POINT(2,2)))), 1); ERROR 42000: Incorrect parameter count in the call to native function 'ST_NUMGEOMETRIES' SELECT ST_NUMGEOMETRIES(ST_GEOMETRYCOLLECTIONFROMWKB(GEOMETRYCOLLECTION(POINT(0,0), LINESTRING(POINT(a,1), POINT(2,2))))); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_NUMGEOMETRIES(ST_GEOMETRYCOLLECTIONFROMWKB(GEOMETRYCOLLECTION(POINT(0,b), LINESTRING(POINT(a,1), POINT(2,2))))); ERROR 42S22: Unknown column 'b' in 'field list' SELECT ST_NUMGEOMETRIES(ST_GEOMCOLLFROMTEXT()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_GEOMCOLLFROMTEXT' SELECT ST_NUMGEOMETRIES(ST_GEOMCOLLFROMTEXT('NULL')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_NUMGEOMETRIES(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(1)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_NUMGEOMETRIES(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(0))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_NUMGEOMETRIES(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(1 1,2 2)')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_NUMGEOMETRIES(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(1 1,2))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_NUMGEOMETRIES(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(1 1,2 a))')); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_NUMGEOMETRIES(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(1 1,2 '!'))')); 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 '!'))'))' at line 1 #==================================================================================== # ST_GEOMETRYN(geometrycollection, number) #==================================================================================== SELECT ST_GEOMETRYN(); ERROR 42000: Incorrect parameter count in the call to native function 'ST_GEOMETRYN' SELECT ST_GEOMETRYN(NULL); ERROR 42000: Incorrect parameter count in the call to native function 'ST_GEOMETRYN' SELECT ST_GEOMETRYN(NULL, 1); ST_GEOMETRYN(NULL, 1) NULL SELECT ST_GEOMETRYN(ST_GEOMCOLLFROMWKB()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_GEOMETRYN' SELECT ST_GEOMETRYN(ST_GEOMCOLLFROMWKB(GEOMETRYCOLLECTION(POINT(0,0), LINESTRING(POINT(1,1), POINT(2,2))))); ERROR 42000: Incorrect parameter count in the call to native function 'ST_GEOMETRYN' SELECT ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMWKB(GEOMETRYCOLLECTION(POINT(0,0), LINESTRING(POINT(a,1), POINT(2,2)))), 1); ERROR 42S22: Unknown column 'a' in 'field list' SELECT ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMWKB(GEOMETRYCOLLECTION(POINT(0,b), LINESTRING(POINT(a,1), POINT(2,2)))), 1); ERROR 42S22: Unknown column 'b' in 'field list' SELECT ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMWKB(GEOMETRYCOLLECTION(POINT(0,0), LINESTRING(POINT(1,1), POINT(2,2)))), A); ERROR 42S22: Unknown column 'A' in 'field list' SELECT ST_GEOMETRYN(ST_GEOMCOLLFROMTEXT()); ERROR 42000: Incorrect parameter count in the call to native function 'ST_GEOMETRYN' SELECT ST_GEOMETRYN(ST_GEOMCOLLFROMTEXT('NULL'), 1); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_GEOMETRYN(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(1)'), 2); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_GEOMETRYN(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(0))'), 3); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_GEOMETRYN(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(1 1,2 2)'), 4); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_GEOMETRYN(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(1 1,2))'), 5); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_GEOMETRYN(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(1 1,2 a))'), 6); ERROR 22023: Invalid GIS data provided to function st_geometryfromtext. SELECT ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(1 1,2 '!'))'), 7); 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 '!'))'), 7)' at line 1 SELECT ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(1 1,2 2))'), 0); ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(1 1,2 2))'), 0) NULL SELECT ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(1 1,2 2))'), -1); ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(1 1,2 2))'), -1) NULL SELECT ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(1 1,2 2))'), -1024); ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(1 1,2 2))'), -1024) NULL SELECT ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(1 1,2 2))'), 10000); ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(1 1,2 2))'), 10000) NULL SELECT ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(1 1,2 2))'), 123456789); ST_GEOMETRYN(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(1 1,2 2))'), 123456789) NULL # Check procedure to work with Point and MultiPoint properties CREATE PROCEDURE point_attri() BEGIN SELECT ST_X(ST_POINTFROMTEXT('POINT(0 0)')); SELECT ST_X(ST_POINTFROMTEXT('POINT(1.1111 -1.1111)')); SELECT ST_X(ST_POINTFROMTEXT('POINT(1e308 1e308)')); SELECT ST_Y(ST_POINTFROMTEXT('POINT(0 0)')); SELECT ST_Y(ST_POINTFROMTEXT('POINT(1.1111 -1.1111)')); SELECT ST_Y(ST_POINTFROMTEXT('POINT(1e308 1e308)')); END | # Call the proc CALL point_attri; ST_X(ST_POINTFROMTEXT('POINT(0 0)')) 0 ST_X(ST_POINTFROMTEXT('POINT(1.1111 -1.1111)')) 1.1111 ST_X(ST_POINTFROMTEXT('POINT(1e308 1e308)')) 1e308 ST_Y(ST_POINTFROMTEXT('POINT(0 0)')) 0 ST_Y(ST_POINTFROMTEXT('POINT(1.1111 -1.1111)')) -1.1111 ST_Y(ST_POINTFROMTEXT('POINT(1e308 1e308)')) 1e308 # Dropping the created procedure DROP PROCEDURE point_attri; # Check procedure to work with Linestring and MultiLineString properties CREATE PROCEDURE line_attri() BEGIN SELECT ST_ISCLOSED(ST_LINEFROMTEXT('LINESTRING(0 0,1 1,2 2,0 0)')); SELECT ST_NUMPOINTS(ST_LINEFROMTEXT('LINESTRING(0 0,1 1,2 2,0 0)')); SELECT ST_LENGTH(ST_LINEFROMTEXT('LINESTRING(0 0,10 0,0 0,-10 0,0 0,0 10,0 0,0 -10,0 0)')); SELECT ST_ASTEXT(ST_STARTPOINT(ST_LINEFROMTEXT('LINESTRING(0 0,1 1,2 2,0 0)'))); SELECT ST_ASTEXT(ST_ENDPOINT(ST_LINEFROMTEXT('LINESTRING(0 0,1 1,2 2,3 3,0 0)'))); SELECT ST_ASTEXT(ST_POINTN(ST_LINEFROMTEXT('LINESTRING(0 0,1 1,2 2,3 3,4 4,5 5,6 6,7 7,8 8,9 9)'), 8)); SELECT ST_ISCLOSED(ST_MLINEFROMTEXT('MULTILINESTRING((0 0,1 1,2 2,0 0),(0 0,-1 -1,-2 -2,0 0))')); SELECT ST_LENGTH(ST_MLINEFROMTEXT('MULTILINESTRING((0 0,10 0),(0 0,0 10),(0 0,-10 0),(0 0,0 -10))')); END | # Call the proc CALL line_attri; ST_ISCLOSED(ST_LINEFROMTEXT('LINESTRING(0 0,1 1,2 2,0 0)')) 1 ST_NUMPOINTS(ST_LINEFROMTEXT('LINESTRING(0 0,1 1,2 2,0 0)')) 4 ST_LENGTH(ST_LINEFROMTEXT('LINESTRING(0 0,10 0,0 0,-10 0,0 0,0 10,0 0,0 -10,0 0)')) 80 ST_ASTEXT(ST_STARTPOINT(ST_LINEFROMTEXT('LINESTRING(0 0,1 1,2 2,0 0)'))) POINT(0 0) ST_ASTEXT(ST_ENDPOINT(ST_LINEFROMTEXT('LINESTRING(0 0,1 1,2 2,3 3,0 0)'))) POINT(0 0) ST_ASTEXT(ST_POINTN(ST_LINEFROMTEXT('LINESTRING(0 0,1 1,2 2,3 3,4 4,5 5,6 6,7 7,8 8,9 9)'), 8)) POINT(7 7) ST_ISCLOSED(ST_MLINEFROMTEXT('MULTILINESTRING((0 0,1 1,2 2,0 0),(0 0,-1 -1,-2 -2,0 0))')) 1 ST_LENGTH(ST_MLINEFROMTEXT('MULTILINESTRING((0 0,10 0),(0 0,0 10),(0 0,-10 0),(0 0,0 -10))')) 40 # Dropping the created procedure DROP PROCEDURE line_attri; CREATE PROCEDURE poly_attri() BEGIN SELECT ST_NUMINTERIORRINGS(ST_POLYFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0))')); SELECT ST_NUMINTERIORRINGS(ST_POLYFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2),(6 6,6 8,8 8,8 6,6 6))')); SELECT ST_ASTEXT(ST_EXTERIORRING(ST_POLYFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0))'))); SELECT ST_ASTEXT(ST_EXTERIORRING(ST_POLYFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2),(6 6,6 8,8 8,8 6,6 6))'))); SELECT ST_ASTEXT(ST_INTERIORRINGN(ST_POLYFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0))'), 1)); SELECT ST_ASTEXT(ST_INTERIORRINGN(ST_POLYFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2),(6 6,6 8,8 8,8 6,6 6))'), 2)); END | # Call the proc CALL poly_attri; ST_NUMINTERIORRINGS(ST_POLYFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0))')) 0 ST_NUMINTERIORRINGS(ST_POLYFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2),(6 6,6 8,8 8,8 6,6 6))')) 2 ST_ASTEXT(ST_EXTERIORRING(ST_POLYFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0))'))) LINESTRING(0 0,0 10,10 10,10 0,0 0) ST_ASTEXT(ST_EXTERIORRING(ST_POLYFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2),(6 6,6 8,8 8,8 6,6 6))'))) LINESTRING(0 0,0 10,10 10,10 0,0 0) ST_ASTEXT(ST_INTERIORRINGN(ST_POLYFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0))'), 1)) NULL ST_ASTEXT(ST_INTERIORRINGN(ST_POLYFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2),(6 6,6 8,8 8,8 6,6 6))'), 2)) LINESTRING(6 6,6 8,8 8,8 6,6 6) # Dropping the created procedure DROP PROCEDURE poly_attri; CREATE PROCEDURE geom_coll_attri() BEGIN SELECT ST_NUMGEOMETRIES(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(' 'POINT(0 0),' 'LINESTRING(0 0,2 2,4 4,6 6,8 8,10 10),' 'POLYGON((0 0,0 5,5 5,5 0,0 0)))')); SELECT ST_NUMGEOMETRIES(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(' 'POINT(0 0),' 'LINESTRING(0 0,2 2,4 4,6 6,8 8,10 10),' 'GEOMETRYCOLLECTION(' 'GEOMETRYCOLLECTION()),' 'POLYGON((0 0,0 5,5 5,5 0,0 0)))')); SELECT ST_ASTEXT(ST_GEOMETRYN(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(' 'POINT(0 0),' 'LINESTRING(0 0,2 2,4 4,6 6,8 8,10 10),' 'POLYGON((0 0,0 5,5 5,5 0,0 0)))'), 3)); SELECT ST_ASTEXT(ST_GEOMETRYN(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(' 'POINT(0 0),' 'LINESTRING(0 0,2 2,4 4,6 6,8 8,10 10),' 'GEOMETRYCOLLECTION(' 'GEOMETRYCOLLECTION()),' 'POLYGON((0 0,0 5,5 5,5 0,0 0)))'), 3)); END | # Call the proc CALL geom_coll_attri; ST_NUMGEOMETRIES(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(' 'POINT(0 0),' 'LINESTRING(0 0,2 2,4 4,6 6,8 8,10 10),' 3 ST_NUMGEOMETRIES(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(' 'POINT(0 0),' 'LINESTRING(0 0,2 2,4 4,6 6,8 8,10 10),' 4 ST_ASTEXT(ST_GEOMETRYN(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(' 'POINT(0 0),' 'LINESTRING(0 0,2 2,4 4,6 6,8 8,10 10),' POLYGON((0 0,0 5,5 5,5 0,0 0)) ST_ASTEXT(ST_GEOMETRYN(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(' 'POINT(0 0),' 'LINESTRING(0 0,2 2,4 4,6 6,8 8,10 10),' GEOMETRYCOLLECTION(GEOMETRYCOLLECTION()) # Dropping the created procedure DROP PROCEDURE geom_coll_attri; # Checking Point and MultiPoint attributes within a trigger # Create a tigger to insert into gis_multi_point and update gis_point CREATE TRIGGER geom_trigger BEFORE UPDATE ON gis_point FOR EACH ROW BEGIN INSERT INTO gis_multi_point SELECT * FROM gis_point; SET New.g = ST_POINTFROMTEXT('POINT(-1e308 1e308)'); END| # Calling the trigger UPDATE gis_point SET fid = 999 WHERE fid = 111; # Checking the table entries SELECT fid, ST_ASTEXT(g) FROM gis_point; fid ST_ASTEXT(g) 101 POINT(0 0) 102 POINT(1 0) 103 POINT(0 1) 104 POINT(1 1) 105 POINT(-1 1) 106 POINT(0 0) 107 POINT(10 0) 108 POINT(0 10) 109 POINT(-10 0) 110 POINT(0 -10) 112 POINT(1e308 1e308) 113 POINT(1e308 -1e308) 114 POINT(-1e308 1e308) 115 POINT(-1e308 -1e308) 999 POINT(-1e308 1e308) SELECT fid, ST_ASTEXT(g) FROM gis_multi_point; fid ST_ASTEXT(g) 101 POINT(0 0) 102 POINT(1 0) 103 POINT(0 1) 104 POINT(1 1) 105 POINT(-1 1) 106 POINT(0 0) 107 POINT(10 0) 108 POINT(0 10) 109 POINT(-10 0) 110 POINT(0 -10) 111 POINT(1 1) 112 POINT(1e308 1e308) 113 POINT(1e308 -1e308) 114 POINT(-1e308 1e308) 115 POINT(-1e308 -1e308) 401 MULTIPOINT((0 0)) 402 MULTIPOINT((0 0),(2 2),(4 4)) 403 MULTIPOINT((0 0),(5 5),(10 10)) 404 MULTIPOINT((0 0),(100 100)) 405 MULTIPOINT((0 0),(1e308 1e308)) 406 MULTIPOINT((1e308 1e308),(1e308 -1e308),(-1e308 1e308),(-1e308 -1e308)) 407 MULTIPOINT((0 0)) 408 MULTIPOINT((0 0),(10 10)) 409 MULTIPOINT((0 0),(2 2),(4 4),(6 6)) 410 MULTIPOINT((0 0)) 411 MULTIPOINT((0 0),(1e308 1e308)) 412 MULTIPOINT((1e308 1e308),(-1e308 1e308),(1e308 -1e308),(-1e308 -1e308)) 413 MULTIPOINT((0 0)) 414 MULTIPOINT((0 0),(1e308 1e308),(-1e308 -1e308)) 415 MULTIPOINT((1e308 1e308),(1e308 -1e308),(-1e308 1e308),(-1e308 -1e308),(1e308 1e308)) # Cleaning up the trigger DROP TRIGGER geom_trigger; # Checking Linestring and MultiLinestring attributes within a trigger # Create a tigger to insert into gis_multi_linestring and update gis_linestring CREATE TRIGGER geom_trigger BEFORE UPDATE ON gis_linestring FOR EACH ROW BEGIN INSERT INTO gis_multi_linestring SELECT * FROM gis_linestring; SET New.g = ST_LINEFROMTEXT('LINESTRING(0 0,10 0,0 0,0 10,0 0,-10 0,0 0,0 10,0 0)'); END| # Calling the trigger UPDATE gis_linestring SET fid = 999 WHERE fid = 211; # Checking the table entries SELECT fid, ST_ASTEXT(g) FROM gis_linestring; fid ST_ASTEXT(g) 201 LINESTRING(0 0,5 5) 202 LINESTRING(0 0,2 2,4 4) 203 LINESTRING(0 0,5 5,10 10) 204 LINESTRING(10 10,5 5) 205 LINESTRING(0 0,12 12,24 24) 206 LINESTRING(0 0,50 50,100 100) 207 LINESTRING(0 0,5 5) 208 LINESTRING(0 0,-5 -5,-10 10) 209 LINESTRING(0 0,2 2,4 4,6 6,8 8) 210 LINESTRING(0 0,5 5) 212 LINESTRING(0 0,1e308 1e308,1e308 -1e308) 213 LINESTRING(1e308 1e308,1e308 -1e308) 214 LINESTRING(1 1,2 2,3 3,4 4,5 5,6 6,7 7,8 8,9 9) 215 LINESTRING(10 10,10 -10,-10 -10,-10 10,10 10) 999 LINESTRING(0 0,10 0,0 0,0 10,0 0,-10 0,0 0,0 10,0 0) SELECT fid, ST_ASTEXT(g) FROM gis_multi_linestring; fid ST_ASTEXT(g) 201 LINESTRING(0 0,5 5) 202 LINESTRING(0 0,2 2,4 4) 203 LINESTRING(0 0,5 5,10 10) 204 LINESTRING(10 10,5 5) 205 LINESTRING(0 0,12 12,24 24) 206 LINESTRING(0 0,50 50,100 100) 207 LINESTRING(0 0,5 5) 208 LINESTRING(0 0,-5 -5,-10 10) 209 LINESTRING(0 0,2 2,4 4,6 6,8 8) 210 LINESTRING(0 0,5 5) 211 LINESTRING(0 0,-50 -50,10 -10) 212 LINESTRING(0 0,1e308 1e308,1e308 -1e308) 213 LINESTRING(1e308 1e308,1e308 -1e308) 214 LINESTRING(1 1,2 2,3 3,4 4,5 5,6 6,7 7,8 8,9 9) 215 LINESTRING(10 10,10 -10,-10 -10,-10 10,10 10) 501 MULTILINESTRING((0 0,2 2)) 502 MULTILINESTRING((0 0,2 2,4 4)) 503 MULTILINESTRING((0 0,2 2,4 4),(6 6,8 8,10 10)) 504 MULTILINESTRING((0 0,100 100,-100 -100)) 505 MULTILINESTRING((1e308 1e308,-1e308 -1e308)) 506 MULTILINESTRING((1e308 1e308,-1e308 -1e308),(1e308 -1e308,-1e308 1e308)) 507 MULTILINESTRING((0 0,2 2)) 508 MULTILINESTRING((0 0,12 12,24 24)) 509 MULTILINESTRING((0 0,2 2,4 4),(6 6,8 8,10 10)) 510 MULTILINESTRING((0 0,2 2,4 4)) 511 MULTILINESTRING((0 0,1 1,2 2)) 512 MULTILINESTRING((0 0,12 12,24 24),(36 36,48 48,50 50)) 513 MULTILINESTRING((0 0,10 10),(0 10,10 0)) 514 MULTILINESTRING((0 0,10 10,-10 10,0 0),(0 0,-10 -10,10 -10,0 0)) 515 MULTILINESTRING((0 0,0 100),(0 0,100 0),(0 0,0 -100),(0 0,-100 0)) # Cleaning up the trigger DROP TRIGGER geom_trigger; # Checking Polygon and MultiPolygon attributes within a trigger # Create a tigger to insert into gis_multi_polygon and update gis_polygon CREATE TRIGGER geom_trigger BEFORE UPDATE ON gis_polygon FOR EACH ROW BEGIN INSERT INTO gis_multi_polygon SELECT * FROM gis_polygon; SET New.g = ST_POLYFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0),(3 3,3 7,7 7,7 3,3 3))'); END| # Calling the trigger UPDATE gis_polygon SET fid = 999 WHERE fid = 311; # Checking the table entries SELECT fid, ST_ASTEXT(g) FROM gis_polygon; fid ST_ASTEXT(g) 301 POLYGON((0 0,0 5,5 5,0 0)) 302 POLYGON((0 0,0 5,5 5,5 0,0 0)) 303 POLYGON((0 0,0 10,10 10,10 0,0 0)) 304 POLYGON((0 0,0 50,50 50,50 0,0 0)) 305 POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)) 306 POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2),(6 6,6 8,8 8,8 6,6 6)) 307 POLYGON((0 0,0 5,5 5,0 0)) 308 POLYGON((0 0,0 15,15 15,15 0,0 0)) 309 POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)) 310 POLYGON((0 0,0 5,5 5,0 0)) 312 POLYGON((10 10,10 20,20 20,20 10,10 10),(14 14,14 16,16 16,16 14,14 14)) 313 POLYGON((0 0,0 10,10 10,10 0,5 5,0 0)) 314 POLYGON((10 0,10 10,0 10,-10 10,-10 0,-10 -10,0 10,10 -10,10 0)) 315 POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2),(6 6,6 8,8 8,8 6,6 6)) 999 POLYGON((0 0,10 0,10 10,0 10,0 0),(3 3,3 7,7 7,7 3,3 3)) SELECT fid, ST_ASTEXT(g) FROM gis_multi_polygon; fid ST_ASTEXT(g) 301 POLYGON((0 0,0 5,5 5,0 0)) 302 POLYGON((0 0,0 5,5 5,5 0,0 0)) 303 POLYGON((0 0,0 10,10 10,10 0,0 0)) 304 POLYGON((0 0,0 50,50 50,50 0,0 0)) 305 POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)) 306 POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2),(6 6,6 8,8 8,8 6,6 6)) 307 POLYGON((0 0,0 5,5 5,0 0)) 308 POLYGON((0 0,0 15,15 15,15 0,0 0)) 309 POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)) 310 POLYGON((0 0,0 5,5 5,0 0)) 311 POLYGON((10 10,10 15,15 15,15 10,10 10)) 312 POLYGON((10 10,10 20,20 20,20 10,10 10),(14 14,14 16,16 16,16 14,14 14)) 313 POLYGON((0 0,0 10,10 10,10 0,5 5,0 0)) 314 POLYGON((10 0,10 10,0 10,-10 10,-10 0,-10 -10,0 10,10 -10,10 0)) 315 POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2),(6 6,6 8,8 8,8 6,6 6)) 601 MULTIPOLYGON(((0 0,0 5,5 5,0 0))) 602 MULTIPOLYGON(((0 0,0 5,5 5,0 0)),((5 5,5 10,10 10,5 5))) 603 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))) 604 MULTIPOLYGON(((0 0,0 5,5 5,0 0))) 605 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,0 -2,-2 -2,0 0))) 606 MULTIPOLYGON(((0 0,5 5,-5 5,0 0)),((0 0,-5 -5,5 -5,0 0))) 607 MULTIPOLYGON(((0 0,5 0,5 5,0 5,0 0))) 608 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4))) 609 MULTIPOLYGON(((0 0,5 0,5 5,0 5,0 0)),((0 0,-5 0,-5 -5,0 -5,0 0))) 610 MULTIPOLYGON(((0 0,-5 0,-5 -5,0 -5,0 0))) 611 MULTIPOLYGON(((10 10,20 10,20 20,10 20,10 10),(14 14,14 16,16 16,16 14,14 14))) 612 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-5 0,-5 -5,0 -5,0 0))) 613 MULTIPOLYGON(((0 0,5 5,5 -5,0 0)),((0 0,-5 5,-5 -5,0 0))) 614 MULTIPOLYGON(((0 0,10 10,-10 10,0 0)),((0 0,-10 -10,10 -10,0 0))) 615 MULTIPOLYGON(((0 0,5 5,10 0,5 -5,0 0))) # Cleaning up the trigger DROP TRIGGER geom_trigger; # Final cleanup DROP TABLE gis_point; DROP TABLE gis_linestring; DROP TABLE gis_polygon; DROP TABLE gis_multi_point; DROP TABLE gis_multi_linestring; DROP TABLE gis_multi_polygon; DROP TABLE gis_geometrycollection;