Skip to content

Commit

Permalink
Merge pull request #520 from EOxServer/fix-contour-geotransform
Browse files Browse the repository at this point in the history
fix geotransform of contour rendering
  • Loading branch information
Lubomír Doležal committed Apr 27, 2022
2 parents fbbb522 + 1820ede commit cf9ea1d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions eoxserver/render/browse/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ def contours(data, offset=0, interval=100, fill_value=-9999, format='raster'):
if format == 'raster':
vector_layer = vector_ds.GetLayer(0)

gt = data.GetGeoTransform()
xmin, xres, _, ymax, _, yres = data.GetGeoTransform()
xmax = xmin + (data.RasterXSize * xres)
ymin = ymax + (data.RasterYSize * yres)
gdal.Rasterize(
out_filename,
vector_ds,
Expand All @@ -163,8 +165,9 @@ def contours(data, offset=0, interval=100, fill_value=-9999, format='raster'):
layers=[vector_layer.GetName()],
outputType=gdal.GDT_Float32,
initValues=fill_value,
xRes=gt[1],
yRes=gt[5],
xRes=xres,
yRes=yres,
outputBounds=[xmin, ymin, xmax, ymax],
)

out_ds = gdal.Open(out_filename)
Expand Down

0 comments on commit cf9ea1d

Please sign in to comment.