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

gdalwarp with -tap and -te does not generate file with provided extent #9059

Closed
jdries opened this issue Jan 11, 2024 · 3 comments · Fixed by #9062
Closed

gdalwarp with -tap and -te does not generate file with provided extent #9059

jdries opened this issue Jan 11, 2024 · 3 comments · Fixed by #9062
Assignees

Comments

@jdries
Copy link

jdries commented Jan 11, 2024

Expected behavior and actual behavior.

gdalwarp should respect -te (target extent) also if it introduces blank lines

Seems to be related to:
#7905

Steps to reproduce the problem.

I'm doing a gdalwarp on a file in EPSG:32631, that simply changes the bounding box, the original extent is:
600000.0 5590200.0 709800.0 5700000.0

gdalwarp -tap -tr 10.0 10.0 -te_srs EPSG:32631 -te 599800.0 5590200.0 709800.0 5700000.0 -t_srs EPSG:32631 T31UFS_20230405T105031_B04_10m.jp2 /tmp/out.tif

gdalinfo /tmp/out.tif shows:
Corner Coordinates:
Upper Left ( 600000.000, 5700000.000) ( 4d26'19.96"E, 51d26'32.47"N)
Lower Left ( 600000.000, 5590200.000) ( 4d24'31.37"E, 50d27'18.98"N)
Upper Right ( 709800.000, 5700000.000) ( 6d 1' 1.29"E, 51d24'44.43"N)
Lower Right ( 709800.000, 5590200.000) ( 5d57'13.93"E, 50d25'34.66"N)
Center ( 654900.000, 5645100.000) ( 5d12'16.64"E, 50d56'12.12"N)

Operating system

Arch Linux

GDAL version and provenance

3.8.1

@rouault
Copy link
Member

rouault commented Jan 11, 2024

if iterating several times, did you include "-overwrite" to make sure the past result is overwriten ?
Otherwise please attach the output file (blanded_input.tif) geneted by "gdal_create -if T31UFS_20230405T105031_B04_10m.jp2 blanked_input.tif -co sparse_ok=yes"

@jdries
Copy link
Author

jdries commented Jan 11, 2024

Attached files to test:
test_files.zip

I tried quite a few things, actually first noticed the issue in a library, not even using gdalwarp, behaviour seems to be consistent.

@jratike80
Copy link
Collaborator

jratike80 commented Jan 11, 2024

Confirmed with GDAL 3.9.0dev on Windows with some image in EPSG:3067.
But maybe the title of the issue should be something like "...does not widen file into provided extent".
Clipping to smaller extent seems to work OK.

@rouault rouault self-assigned this Jan 11, 2024
rouault added a commit to rouault/gdal that referenced this issue Jan 11, 2024
rouault added a commit to rouault/gdal that referenced this issue Jan 15, 2024
rouault added a commit that referenced this issue Jan 15, 2024
gdalwarp: do not enable blank line detection when -tap and -te are specified (fixes #9059)
rouault added a commit that referenced this issue Jan 16, 2024
[Backport release/3.8] gdalwarp: do not enable blank line detection when -tap and -te are specified (fixes #9059)
ralphraul pushed a commit to 1SpatialGroupLtd/gdal that referenced this issue Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants