Skip to main content
added 26 characters in body
Source Link
Alexandre Neto
  • 14.4k
  • 2
  • 59
  • 85

ST_Value is strict about wanting a Point rather than a MultiPoint; one way to bypass this is to use ST_Dump. Taking your first query and converting the Point to a MultiPoint:

select 
    rid,
    ST_Value(rast, 1, 
        (ST_Dump(
            ST_Multi(
                ST_SetSRID(ST_Point(484375.820, 4742079.979), 32617)
            )
        )).geom
    ) as b1 
from imagery.l8_2015_09_12 
where ST_Intersects(rast, ST_SetSRID(ST_Point(484375.820, 4742079.979), 32617)::geometry, 1);
SELECT 
    rid,
    ST_Value(rast, 1, 
        (ST_Dump(
            ST_Multi(
                ST_SetSRID(ST_Point(484375.820, 4742079.979), 32617)
            )
        )).geom
    ) AS b1 
FROM imagery.l8_2015_09_12 
WHERE ST_Intersects(rast, ST_SetSRID(ST_Point(484375.820, 4742079.979), 32617)::geometry, 1);

ST_Value is strict about wanting a Point rather than a MultiPoint; one way to bypass this is to use ST_Dump. Taking your first query and converting the Point to a MultiPoint:

select 
    rid,
    ST_Value(rast, 1, 
        (ST_Dump(
            ST_Multi(
                ST_SetSRID(ST_Point(484375.820, 4742079.979), 32617)
            )
        )).geom
    ) as b1 
from imagery.l8_2015_09_12 
where ST_Intersects(rast, ST_SetSRID(ST_Point(484375.820, 4742079.979), 32617)::geometry, 1);

ST_Value is strict about wanting a Point rather than a MultiPoint; one way to bypass this is to use ST_Dump. Taking your first query and converting the Point to a MultiPoint:

SELECT 
    rid,
    ST_Value(rast, 1, 
        (ST_Dump(
            ST_Multi(
                ST_SetSRID(ST_Point(484375.820, 4742079.979), 32617)
            )
        )).geom
    ) AS b1 
FROM imagery.l8_2015_09_12 
WHERE ST_Intersects(rast, ST_SetSRID(ST_Point(484375.820, 4742079.979), 32617)::geometry, 1);
Source Link

ST_Value is strict about wanting a Point rather than a MultiPoint; one way to bypass this is to use ST_Dump. Taking your first query and converting the Point to a MultiPoint:

select 
    rid,
    ST_Value(rast, 1, 
        (ST_Dump(
            ST_Multi(
                ST_SetSRID(ST_Point(484375.820, 4742079.979), 32617)
            )
        )).geom
    ) as b1 
from imagery.l8_2015_09_12 
where ST_Intersects(rast, ST_SetSRID(ST_Point(484375.820, 4742079.979), 32617)::geometry, 1);