Creating an EOPatch from a tif file


I’m not fairly new with GIS, and was following along with the LULC tutorial. I was wondering if there is a simple way to create an EOPatch using an existing tif file with specific bands. All I could see is filling EOPatches with data from Sentinelhub or Geopedia, but not from existing files. If any of you could point me towards the right direction on this, I would be really grateful.

1 Like


at the moment there’s no EOTask that would create an EOPatch from an existing geo-referenced tiff file (or part of it). If you’re a little bit fluent in Python than it actually wouldn’t be that difficult for youth implement one. You can start with the EOTask template code (taken from the docs):

from eolearn.core import EOTask

class FooTask(EOTask):
    def __init__(self, foo_param):
        self.foo_param = foo_param

    def execute(self, eopatch, *, patch_specific_param=None):
        # do what foo does on input eopatch and return it
        return eopatch

All you need to do for example is to specify with patch_specific_param the tiff file name (and optionally what part of tiff file to put in the eopatch) and in the execute method open geotiff with rasterio and add its content as a feature to eopatch. That’s it!

Best regards,

PS: Pull requests are welcome :smiley:

Could you let me know whether we can create eopatch files from existing .jp2 files of different bands?If we can,could you please let me know the process?

See this thread:

We have an error creating eopatch files