Skip to content

Adding geometry to dataset baseclass #179

@Peter9192

Description

@Peter9192

We could add geometry to the baseclass as a union of the three main geometries that we use now:

class Dataset(BaseModel, ABC):
    dataset: str
    years: Timerange. 
    geometry: Point | Area | PointList 
    resample: ResampleConfig

Then, for each data source, we could suffice with a single class with multiple loaders, e.g.

class EOBS(Dataset):
    def download():
        if isinstance(self.geometry, Area):
            self._download_area()

That would lead to a cleaner interface for the user. With a bit of work, we could try to make the geometry adhere (almost) to geojson.

Challenge: options for area or multipoint might need different other fields on the class.
Opportunity: perhaps we could use multimethod to overload the load function for different geometries?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions