CREATE GLOBAL TEMPORARY TABLE DEM_RESULT
( X NUMBER,
Y NUMBER,
Z NUMBER
) ON COMMIT DELETE ROWS ;
create or replace
PROCEDURE GET_LINE_EVERY_HIGH_POINTS
(
first_x NUMBER
, first_y NUMBER
, next_x NUMBER
, next_y NUMBER
, SRID IN NUMBER DEFAULT 4326
) AS
BUFFER_GEOM SDO_GEOMETRY;
n_High NUMBER;
BEGIN
BUFFER_GEOM := sdo_geom.sdo_buffer(line(first_x, first_y, next_x, next_y), 10, 1 );
INSERT INTO dem_result(X, Y, Z) SELECT T.X, T.Y, T.Z
FROM (
SELECT X, Y, Z, Z - LAG(Z) over (order by Y) AS P, LAG(Z) over (order by Y)- Z AS F FROM dem_part WHERE SDO_INSIDE(location, BUFFER_GEOM) = 'TRUE') T
WHERE T.P > 0 AND T.F < 0;
END GET_LINE_EVERY_HIGH_POINTS;
No comments:
Post a Comment