snowex_db.upload.cog_handler module#

class snowex_db.upload.cog_handler.COGHandler(tif_file, s3_bucket='m3w-snowex', s3_prefix='cogs', cog_dir='./snowex_cog_storage', use_s3=True)[source]#

Bases: object

Class to convert TIFs to COGs, persist them, and generate the command to insert them into the db

AWS_REGION = 'us-west-2'#
create_cog(nodata=None)[source]#

Create a cloud optimized geotif from tif Args:

nodata: no data value

Returns:

path to COG

persist_cog()[source]#

persist COG either locally or in S3 Returns:

S3 or local path

to_sql_command(epsg, no_data=None)[source]#

Generate command to insert into database Args:

epsg: string EPSG no_data: optional nodata value

Returns:

list of raster2pgsql command