I want to create a service calculating height profiles using our CoGeoTiff LaserScan data from Austria. It has a 1m resolution at its deepest level and is about 400GB big. Generating height profiles in a small area works really great and the computation is done within 1-2 seconds using rasterio rasterio.sample.sample_gen(src, [coordinateList]). But when we calculate a profile longer than 50km the calculation takes up to 50 seconds.

But for the longer profiles we do not need the 1m resolution, maybe 20m resolution would be enough or in other words -> I will calculate the profile at a specific overview level. Something like: rasterio.sample.sample_gen(src, [coordinateList], overview=20). Unfortunately this is not possible or I still can't find it.

1 Answer 1


I would try to create a virtual VRT dataset with a reduced resolution and use that as a src. Here is an example with gdal_translate but you can certainly create VRT also with rasterio.

gdal_translate -of VRT -tr 20 20 input.cog temp_20m.vrt

Rasterio is internally using the same approach in some places and it lets GDAL to pick the most suitable overview level:



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.