I have two tables: one with geom points of species and an other one with height contour lines geoms. My Idea was to find per specie geom the closest point to a contour 'geom' line and then select its elevation. So I can find out between which elevations I can find a specific species
My though was the following:
SELECT od.elevation
FROM shp_opendem od
JOIN species sp ON ST_ClosestPoint(sp.geom, od.geom)
WHERE sp.name = 'somename'
This isn't running as ST_ClosestPoint is not a boolean which is required in a join. The exact error message:
ERROR: argument of JOIN/ON must be type boolean, not type geometry
Any tips how to solve this?