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

gdal2xyz: Change -srcwin parameter type to integer. #9637

Merged
merged 1 commit into from
Apr 5, 2024
Merged

gdal2xyz: Change -srcwin parameter type to integer. #9637

merged 1 commit into from
Apr 5, 2024

Conversation

eliepa
Copy link
Contributor

@eliepa eliepa commented Apr 5, 2024

PR fixes -srcwin parameter type

Window rectangle corners shall be specified as integers.

@jratike80
Copy link
Collaborator

Is it a problem if it is float? If I read right https://github.com/OSGeo/gdal/blob/master/apps/gdal_translate_lib.cpp#L291 gdal_translate is using doubles. What if the windows is computed by code that can return something else than integers due to re-projection or something?

@eliepa
Copy link
Contributor Author

eliepa commented Apr 5, 2024

Yes, there is a problem with float:
x_off, y_off, x_size, y_size = srcwin
and later:
for x_i in range(0, x_size, x_skip):
which causes an error.

@rouault rouault added this to the 3.9.0 milestone Apr 5, 2024
@rouault rouault merged commit 801b1c8 into OSGeo:master Apr 5, 2024
29 of 30 checks passed
@coveralls
Copy link
Collaborator

Coverage Status

coverage: 68.946% (-0.003%) from 68.949%
when pulling ac3724f on eliepa:fix_srcwin
into cf119e5 on OSGeo:master.

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

Successfully merging this pull request may close these issues.

4 participants