-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
gdal raster pixel-info: add --coordinate-dataset and --output arguments #13814
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
base: master
Are you sure you want to change the base?
gdal raster pixel-info: add --coordinate-dataset and --output arguments #13814
Conversation
4dce49c to
529e04b
Compare
529e04b to
28c9ab3
Compare
| Otherwise, coordinates are assumed to be in the CRS raster dataset if it has | ||
| a CRS. | ||
|
|
||
| Otherwise, coordinates are assumed to be expressed in the column,line raster space. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the raster has a CRS but user wants to get pixel values from a bunch of pixels as column,line pairs? I think that option like --position-crs=none would work for that use case, but is it supported? Or does the existing --position-crs pixel https://gdal.org/en/stable/programs/gdal_raster_pixel_info.html#cmdoption-position-crs work also with a dataset input?
I see that CRS values "null" or "none" are supported in https://gdal.org/en/stable/programs/gdal_raster_edit.html#cmdoption-crs, but can they be used in other utilities?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the raster has a CRS but user wants to get pixel values from a bunch of pixels as column,line pairs?
specify --position-crs=pixel. I've added a unit test for that scenario
|
@rouault - great work! One question, in the example: Does output.gpkg contain all the fields of features in input.gpkg? Being able to link raster values (e.g. DEM values to point locations) is an important use case (apologies I've not had a chance to build / test this PR). For future reference, this new feature replaces a more convulted way of applying values from a raster to vector features: export OGR_SQLITE_ALLOW_EXTERNAL_ACCESS="YES"
gdal vector sql points.gpkg \
points-dem.gpkg \
--sql "SELECT *, gdal_get_pixel_value('./dem.tif', 1, 'georef', ST_X(geometry), ST_Y(geometry)) as pixel FROM points" \
--dialect SQLITE \
--overwrite |
28c9ab3 to
159997c
Compare
yes it does. Documentation updated to mention that |
eec7949 to
8ce4dd8
Compare
8ce4dd8 to
f6ad97d
Compare
CC @dbaston @geographika