Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save knutole/6114943f8e6e04cb66479ca1f1327b95 to your computer and use it in GitHub Desktop.
Save knutole/6114943f8e6e04cb66479ca1f1327b95 to your computer and use it in GitHub Desktop.
# second problem
select row_to_json(t) from (SELECT rid, pvc FROM file_pszjkuicfjvxvizbygbq, ST_ValueCount(rast,1) AS pvc WHERE st_intersects(st_transform(st_setsrid(ST_geomfromgeojson('{"geometry":{"type":"Polygon","coordinates":[[[9.31640625,60.88770004207789],[9.31640625,61.48075950007598],[10.8984375,61.48075950007598],[10.8984375,60.88770004207789],[9.31640625,60.88770004207789]]]}}'), 4326), 3857), rast) as t;
error running query { [Error: ERROR: unknown GeoJSON type
# first problem, solved!
select row_to_json(t) from (
SELECT rid, pvc FROM file_pszjkuicfjvxvizbygbq, ST_ValueCount(rast,1)
WHERE st_intersects(
st_transform(
st_setsrid(
ST_geomfromgeojson(
'{"geometry":{"type":"Polygon","coordinates":[[[9.31640625,60.88770004207789],[9.31640625,61.48075950007598],[10.8984375,61.48075950007598],[10.8984375,60.88770004207789],[9.31640625,60.88770004207789]]]}}'
), 4326
), 3857
), rast
) AS pvc
) as t;
error running query { [Error: ERROR: syntax error at or near "AS"
LINE 1: ...625,60.88770004207789]]]}}'), 4326), 3857), rast) AS pvc) as...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment