1

I am using this query to get elevation data from PostgreSQL:

WITH points(geom) AS (
    values (ST_SetSRID(ST_Point(980279.44, 6431129.89), 2154)),
           (ST_SetSRID(ST_Point(982573.24, 6429308.57), 2154)),
           (ST_SetSRID(ST_Point(926078.71, 6371869.75), 2154))
)
SELECT rid, geom as select_point, st_value(rast, geom) as height, st_envelope(rast) as raster_bbox
FROM rgealti_fxx_0892_6372_mnt_lamb93_ign69
JOIN points
ON  ST_Intersects(rast, geom);

With small query (10 points) I get 10 results. But with 500, I only get 329??? I checked and all points queried are within the DEM data. Any idea why some data is missing?

1
  • I tested the query at home with 500 random points, I don't have this problem. There must be a problem in the intersection clause. Are the 500 lines expected with a RIGHT JOIN ?
    – Atm
    Sep 16 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.