jgrss / geowombat

GeoWombat: Utilities for geospatial data
https://geowombat.readthedocs.io
MIT License
182 stars 10 forks source link

Series.apply bigtif #291

Closed mmann1123 closed 8 months ago

mmann1123 commented 8 months ago

What is this PR changing?

Addressing need to write large tifs using series.apply. #290

Checklist

Tag options:

Example:

fix: <branch name> PR number
mmann1123 commented 8 months ago

Looks good to me. It doesn't have to be in this PR, but we might want to support these new additions via the config manager and available options.

with gw.config.update(BIGTIFF='YES'):
    ...

Hmm good point. I don't really understand how to call the config properties in a class. Is there an example you can point me towards?

jgrss commented 8 months ago

Looks good to me. It doesn't have to be in this PR, but we might want to support these new additions via the config manager and available options.

with gw.config.update(BIGTIFF='YES'):
    ...

Hmm good point. I don't really understand how to call the config properties in a class. Is there an example you can point me towards?

You can import the global config object, which gets set and unset within the context manager. See here for an example. E.g., in the code that you want to check for a config setting...

from geowombat.config import config

def some_func(bigtiff: str):
    # override the local arg with the config option, but only if we are in a context manager
    if config['with_config']:
        bigtiff = config['bigtiff'].upper()
        assert bigtiff in ('YES', 'NO',)
mmann1123 commented 8 months ago

Ok I think I got that in right. Thanks nice to learn new tricks.

mmann1123 commented 8 months ago

I am nervous about merging this and messing something up. I am going to bring my edits to a new branch and create a new pull request.