Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLITE/GPKG: add a gdal_get_pixel_value() SQL function. #6877

Merged
merged 2 commits into from Dec 10, 2022

Commits on Dec 8, 2022

  1. SQLITE/GPKG: add a gdal_get_pixel_value() SQL function.

    Applies to both SQL SQLite dialect and GPKG
    
    The ``gdal_get_pixel_value()`` function (added in GDAL 3.7) can be used to extract the value
    of a pixel in a GDAL dataset. It requires the configuration option OGR_SQLITE_ALLOW_EXTERNAL_ACCESS
    to be set to YES (for security reasons).
    
    It takes 5 arguments:
    
    * a string with the dataset name
    * a band number (numbering starting at 1)
    * a string being "georef" to indicate that subsequent values will be georeferenced
      coordinates, or "pixel" to indicate that subsequent values will be in column, line
      pixel space
    * georeferenced X value or column number
    * georeferenced Y value or line number
    
    .. code-block::
    
        SELECT gdal_get_pixel_value('../gcore/data/byte.tif', 1, 'georef', 440720, 3751320)
        SELECT gdal_get_pixel_value('../gcore/data/byte.tif', 1, 'pixel', 0, 0)
    rouault committed Dec 8, 2022
    Configuration menu
    Copy the full SHA
    918815d View commit details
    Browse the repository at this point in the history

Commits on Dec 9, 2022

  1. Configuration menu
    Copy the full SHA
    837bb28 View commit details
    Browse the repository at this point in the history