georasters icon indicating copy to clipboard operation
georasters copied to clipboard

Saving GeoTiff, compression and unclear code

Open culebron opened this issue 7 years ago • 6 comments

I wanted to add compression to GeoTiff, and turns out that there's no such option, and the functions code is quite coupled.

create_geotiff function receives gdal driver as a parameter, and it's not reused anywhere. Does it really need the driver parameter?

https://github.com/ozak/georasters/blob/master/georasters/georasters.py#L478

culebron avatar Mar 20 '18 07:03 culebron

the function which is defined here needs the driver input. I agree this is not optimal, and it would be better to have either a more general function where users can pass whatever they need and various predefined types. In this case this is predefined and nothing else can be passed to the gdal driver. I have been considering moving to rasterio #3, which perhaps may be more flexible and allow to do other operations, but have not had time. It would be great if someone can help tackle this.

ozak avatar Mar 20 '18 13:03 ozak

I've started switching read and write operations to rasterio, hoping to finish this week. But some operations are still heavily using GDAL, so I need some assistance.

One thing that I noticed is that in this code, only one band is read and written, while rasterio always works with mutliple.

culebron avatar Mar 21 '18 08:03 culebron

Reading more carefully, I see there are few of them.

culebron avatar Mar 21 '18 09:03 culebron

I have to look more carefully but I think the only other function that uses gdal is the get_geo_info function. But I imagine rasterio has similar utilities as the ones used there(?).

ozak avatar Mar 21 '18 13:03 ozak

Yes, it does. I found all the attributes that you use to instantiate GeoRaster. The only my concern is that types are capitalized in one library, and not in the other ('int32' vs 'Int32')

culebron avatar Mar 21 '18 16:03 culebron

I never heard back from you and now I am not sure if you were expecting an answer to your last comment.

ozak avatar Oct 09 '19 20:10 ozak