Como se mencionó anteriormente, estos valores de coordenadas Z y M adicionales se utilizan para almacenar y recuperar información adicional, pero no se tienen en cuenta durante los cálculos espaciales u operaciones fijas.
Por ejemplo, el resultado del cálculo del cable de línea de uno de los tutoriales anteriores permanecerá 5
, y no 13
si el valor de Z es el punto final del cable 12
. Como dato divertido: (5, 12, 13)
es otro ejemplo de la Triple pitagórico, lo mismo que (3, 4, 5)
.
SELECT NEW ST_LineString('LineString Z(0 0 0, 4 3 12)').ST_Length() AS "StringLength"
FROM "DUMMY";
-- Result is still 5, same as in the following
-- SELECT NEW ST_LineString('LineString (0 0, 4 3)').ST_Length() AS "StringLength"
-- FROM "DUMMY";
Otro ejemplo modificado del tutorial anterior.
SELECT NEW ST_Point ('POINT Z(1 1 100)').ST_Within(NEW ST_Point('POINT Z(0 0 0.5)').ST_Buffer(2)) AS "WITHIN"
FROM "DUMMY";
-- Result is True as the point (1,1) is still within a buffer around the point (0,0) even though they have different "height" location defined by Z
El método ST_Buffer()
aplicado a un punto con 3 dimensiones, equilibra la geometría calculada, convirtiéndola en 2 dimensiones: X e Y únicamente. Y el metodo ST_Within
la característica Z no se tiene en cuenta.
SELECT NEW ST_Point('POINT Z(0 0 0.5)').ST_Buffer(2).ST_CoordDim() FROM DUMMY;
-- Result is 2 (coordinates dimensions of an output polygon)