forked from hanaboy/SQL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathST_IsMeasured
30 lines (25 loc) · 1.42 KB
/
ST_IsMeasured
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
-- this syntax is used for testing the ST_IsMeasured method for spatial type data in HANA
SELECT ST_GeomFromText( 'LineString ZM(-120.523902 51.883289 201506241538 37.5,-120.533902 51.893289 201506241538 37.5)' ).ST_IsMeasured() FROM DUMMY;
CREATE SCHEMA DEVTEST;
SET SCHEMA DEVTEST;
CREATE COLUMN TABLE GEOTEST (
ID INTEGER,
GEO ST_GEOMETRY (1000004326)
);
INSERT INTO GEOTEST VALUES(1, NEW ST_POINT('POINT (-120.523902 51.883289)'));
INSERT INTO GEOTEST VALUES(2, NEW ST_POINT('POINT Z(-120.523902 51.883289 20150624)'));
INSERT INTO GEOTEST VALUES(3, NEW ST_POINT('POINT ZM(-120.523902 51.883289 201506241538 37.5)'));
INSERT INTO GEOTEST VALUES(4, NEW ST_POINT('POINT ZM(-120.523902 51.883289 201506241638 36.5)'));
INSERT INTO GEOTEST VALUES(5, NEW ST_POINT('POINT (-120.533902 51.893289)'));
INSERT INTO GEOTEST VALUES(6, NEW ST_POINT('POINT Z(-120.533902 51.893289 20150624)'));
INSERT INTO GEOTEST VALUES(7, NEW ST_POINT('POINT ZM(-120.533902 51.893289 201506241538 37.5)'));
INSERT INTO GEOTEST VALUES(8, NEW ST_POINT('POINT ZM(-120.533902 51.893289 201506241638 36.5)'));
INSERT INTO GEOTEST VALUES(9, NEW ST_LINESTRING('LINESTRING ZM(-120.523902 51.883289 201506241538 37.5,-120.533902 51.893289 201506241538 37.0)'));
SELECT
ID,
GEO.ST_AsWKT(),
GEO.ST_IsMeasured(),
--GEO.ST_M(), --errors will be returned by this method when type is not point or geometry does not have a measure
GEO.ST_MMAX(),
GEO.ST_MMIN()
FROM GEOTEST;