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

projection_source srs overwritten by dataset srs in reproject_raster_dataset #551

Closed
kmuehlbauer opened this issue Feb 16, 2022 · 0 comments · Fixed by #553
Closed

projection_source srs overwritten by dataset srs in reproject_raster_dataset #551

kmuehlbauer opened this issue Feb 16, 2022 · 0 comments · Fixed by #553
Labels

Comments

@kmuehlbauer
Copy link
Member

reproject_raster_dataset is a nice function to reproject a GDAL raster dataset. Sometimes the projection information misses from the dataset, but can be supplied via projection_source kwarg.

Unfortunately it is overwritten unconditionally with the dataset projection, see

if dst_srs:
src_srs = osr.SpatialReference()
src_srs.ImportFromWkt(src_ds.GetProjection())

This should only be done if projection_source=None. If projection_source is given it should not be overwritten.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant