Skip to content

Commit

Permalink
Merge pull request #5 from IgnacioHeredia/bugfix
Browse files Browse the repository at this point in the history
fix upperleft coordinates in output
  • Loading branch information
lanha authored Feb 12, 2019
2 parents 5a91e04 + 659fe20 commit 3f07741
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion testing/s2_tiles_supres.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,14 @@ def write_band_data(data, description, shortname=None):

sys.stdout.write("Writing")
result_dataset = driver.Create(output_file, data10.shape[1], data10.shape[0], out_dims, gdal.GDT_Float64)
result_dataset.SetGeoTransform(ds10.GetGeoTransform())

# Translate the image upper left corner. We multiply x10 to transform from pixel position in the 10m_band to meters.
geot = list(ds10.GetGeoTransform())
geot[0] += xmin * 10
geot[3] -= ymin * 10
result_dataset.SetGeoTransform(tuple(geot))
result_dataset.SetProjection(ds10.GetProjection())

if copy_original_bands:
sys.stdout.write(" the original 10m bands and")
# Write the original 10m bands
Expand Down

0 comments on commit 3f07741

Please sign in to comment.