ozak / georasters

GeoRasters is a Python module that provides a fast and flexible tool to work with GIS raster files.
GNU General Public License v3.0
198 stars 36 forks source link

Saving GeoTiff, compression and unclear code #32

Open culebron opened 6 years ago

culebron commented 6 years ago

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

ozak commented 6 years ago

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.

culebron commented 6 years ago

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 commented 6 years ago

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

ozak commented 6 years ago

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(?).

culebron commented 6 years ago

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')

ozak commented 5 years ago

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