Hi,

I’m wanting to execute a SQL query on a vector database like:
vector_mem_ds.ExecuteSQL(f"select ST_Centroid(GEOMETRY) as cnt, 
gdal_get_pixel_value('{raster_fp}', {ndvi_band_num}, 'georef', cnt.STX, 
cnt.STY) from ds", dialect="SQLITE")

In particular, I want to use the geometry’s centroid for gdal_get_pixel_value, 
but the latter function takes two parameters, and ST_Centroid provides 1 return 
value (a compound type Point), so I am hoping for some way to unpack this into 
the form necessary expected from get_pixel_value.  Apparently some GIS query 
engines do expose a STX and STY field but that’s if you trust random google 
results.  But as is this fails.

Is this possible largely as-is?

Thanks,
Jesse
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev
  • ... Meyer, Jesse R. (GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC] via gdal-dev
    • ... Even Rouault via gdal-dev
      • ... Meyer, Jesse R. (GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC] via gdal-dev

Reply via email to