File: st_longitude.result

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (102 lines) | stat: -rw-r--r-- 6,491 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# NULL as one of the parameters must result in NULL return value.
SELECT ST_LONGITUDE(NULL);
ST_LONGITUDE(NULL)
NULL
SELECT ST_LONGITUDE(NULL, NULL);
ST_LONGITUDE(NULL, NULL)
NULL
SELECT ST_LONGITUDE(NULL, 1);
ST_LONGITUDE(NULL, 1)
NULL
SELECT ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(0 0)', 4326), NULL);
ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(0 0)', 4326), NULL)
NULL
# Invalid data is not allowed.
DO ST_LONGITUDE(x'000000000123456789abcdef');
ERROR 22023: Invalid GIS data provided to function st_longitude.
DO ST_LONGITUDE(x'000000000123456789abcdef', 1);
ERROR 22023: Invalid GIS data provided to function st_longitude.
# New value must be within the allowed range.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(0 0)', 4326), -180.000000001);
ERROR 22S02: Longitude -180.000000 is out of range in function st_longitude. It must be within (-180.000000, 180.000000].
DO ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(0 0)', 4326), 180.000000001);
ERROR 22S02: Longitude 180.000000 is out of range in function st_longitude. It must be within (-180.000000, 180.000000].
# First parameter must be a point.
# Cartesian SRID 0
DO ST_LONGITUDE(ST_GEOMFROMTEXT('LINESTRING(0 0, 1 1)', 0));
ERROR 22S01: POINT value is a geometry of unexpected type LINESTRING in st_longitude.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('POLYGON((0 0, 0 1, 1 1, 0 0))', 0));
ERROR 22S01: POINT value is a geometry of unexpected type POLYGON in st_longitude.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('MULTIPOINT((0 0))', 0));
ERROR 22S01: POINT value is a geometry of unexpected type MULTIPOINT in st_longitude.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('MULTIPOINT((0 0), (1 1))', 0));
ERROR 22S01: POINT value is a geometry of unexpected type MULTIPOINT in st_longitude.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('MULTILINESTRING((0 0, 1 1))', 0));
ERROR 22S01: POINT value is a geometry of unexpected type MULTILINESTRING in st_longitude.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0, 0 1, 1 1, 0 0)))', 0));
ERROR 22S01: POINT value is a geometry of unexpected type MULTIPOLYGON in st_longitude.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0))', 0));
ERROR 22S01: POINT value is a geometry of unexpected type GEOMCOLLECTION in st_longitude.
# Projected
DO ST_LONGITUDE(ST_GEOMFROMTEXT('LINESTRING(0 0, 1 1)', 3857));
ERROR 22S01: POINT value is a geometry of unexpected type LINESTRING in st_longitude.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('POLYGON((0 0, 0 1, 1 1, 0 0))', 3857));
ERROR 22S01: POINT value is a geometry of unexpected type POLYGON in st_longitude.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('MULTIPOINT((0 0))', 3857));
ERROR 22S01: POINT value is a geometry of unexpected type MULTIPOINT in st_longitude.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('MULTIPOINT((0 0), (1 1))', 3857));
ERROR 22S01: POINT value is a geometry of unexpected type MULTIPOINT in st_longitude.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('MULTILINESTRING((0 0, 1 1))', 3857));
ERROR 22S01: POINT value is a geometry of unexpected type MULTILINESTRING in st_longitude.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0, 0 1, 1 1, 0 0)))', 3857));
ERROR 22S01: POINT value is a geometry of unexpected type MULTIPOLYGON in st_longitude.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0))', 3857));
ERROR 22S01: POINT value is a geometry of unexpected type GEOMCOLLECTION in st_longitude.
# Geographic
DO ST_LONGITUDE(ST_GEOMFROMTEXT('LINESTRING(0 0, 1 1)', 4326));
ERROR 22S01: POINT value is a geometry of unexpected type LINESTRING in st_longitude.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('POLYGON((0 0, 0 1, 1 1, 0 0))', 4326));
ERROR 22S01: POINT value is a geometry of unexpected type POLYGON in st_longitude.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('MULTIPOINT((0 0))', 4326));
ERROR 22S01: POINT value is a geometry of unexpected type MULTIPOINT in st_longitude.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('MULTIPOINT((0 0), (1 1))', 4326));
ERROR 22S01: POINT value is a geometry of unexpected type MULTIPOINT in st_longitude.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('MULTILINESTRING((0 0, 1 1))', 4326));
ERROR 22S01: POINT value is a geometry of unexpected type MULTILINESTRING in st_longitude.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0, 0 1, 1 1, 0 0)))', 4326));
ERROR 22S01: POINT value is a geometry of unexpected type MULTIPOLYGON in st_longitude.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0))', 4326));
ERROR 22S01: POINT value is a geometry of unexpected type GEOMCOLLECTION in st_longitude.
# Point must be geographic.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(0 0)', 0));
ERROR 22S00: Function st_longitude is only defined for geographic spatial reference systems, but one of its arguments is in SRID 0, which is not geographic.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(0 0)', 3857));
ERROR 22S00: Function st_longitude is only defined for geographic spatial reference systems, but one of its arguments is in SRID 3857, which is not geographic.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(0 0)', 4326));
DO ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(0 0)', 0), 1);
ERROR 22S00: Function st_longitude is only defined for geographic spatial reference systems, but one of its arguments is in SRID 0, which is not geographic.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(0 0)', 3857), 1);
ERROR 22S00: Function st_longitude is only defined for geographic spatial reference systems, but one of its arguments is in SRID 3857, which is not geographic.
DO ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(0 0)', 4326), 1);
# Get or set the longitude of a point in a lat-long SRS.
SELECT ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(0 1)', 4326));
ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(0 1)', 4326))
1
SELECT HEX(ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(0 1)', 4326), 1));
HEX(ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(0 1)', 4326), 1))
E61000000101000000000000000000F03F0000000000000000
# Get or set the longitude of a point in a long-lat SRS.
SELECT ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(1 0)', 7035));
ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(1 0)', 7035))
1
SELECT HEX(ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(0 0)', 7035), 1));
HEX(ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(0 0)', 7035), 1))
7B1B00000101000000000000000000F03F0000000000000000
# Get or set the longitude of a point in a lat-long SRS with a meridian
# that doesn't go through Greenwich.
SELECT ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(0 1)', 4801));
ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(0 1)', 4801))
1.0000000000000009
SELECT HEX(ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(0 1)', 4801), 1));
HEX(ST_LONGITUDE(ST_GEOMFROMTEXT('POINT(0 1)', 4801), 1))
C11200000101000000040000000000F03F0000000000000000