Esempio n. 1
0
class Writer(IoHandler):
    data = attr.ib()
    io_options = attr.ib(type=Options())

    def save(self, path: str):
        raise NotImplemented()

    def options(self, **kwargs):
        current_options = super().options(**kwargs)
        return self.__class__(data=self.data, io_options=current_options)

    def format(self, format: str):
        try:
            default_options = getattr(DefaultOptionWrite, format)()
        except AttributeError:
            raise FormatNotAvailable("Can not found requested format")

        return self.__class__(data=self.data, io_options=default_options)

    @property
    def format_name(self):
        raise NotImplementedError()

    @format_name.setter
    def format_name(self, value: str):
        raise NotImplementedError
Esempio n. 2
0
 def geotiff(cls):
     return Options(
         {
             "format": "geotiff",
             "dtype": gdal.GDT_Byte,
             "crs": None
         }
     )
Esempio n. 3
0
 def wkt(cls):
     return Options({
         "format": "wkt",
         "crs": None,
         "pixel": None,
         "value": 1,
         "extent": None
     })
Esempio n. 4
0
 def csv(cls):
     return Options(
         {
             "format": "csv",
             "delimiter": ",",
             "header": ","
         }
     )
Esempio n. 5
0
 def sentinel(cls):
     return Options({
         "format": "sentinel",
         "extent": None,
         "user": None,
         "password": None,
         "pixel": None
     })
Esempio n. 6
0
 def geojson(cls):
     return Options({
         "format": "shp",
         "driver": "GeoJSON",
         "type": None,
         "crs": None,
         "extent": None,
         "pixel": None,
         "value": 1,
         "all_unique": "False",
         "color_column": None
     })
Esempio n. 7
0
 def shp(cls):
     return Options({
         "format": "shp",
         "type": None,
         "driver": "ESRI Shapefile",
         "crs": None,
         "extent": None,
         "pixel": None,
         "value": 1,
         "all_unique": "False",
         "color_column": None
     })
Esempio n. 8
0
 def postgis_geom(cls):
     return Options({
         "format": "postgis_geom",
         "type": None,
         "crs": None,
         "extent": None,
         "pixel": None,
         "value": 1,
         "all_unique": "False",
         "color_column": None,
         "schema": "public",
         "host": "localhost",
         "user": "******",
         "password": "******"
     })
Esempio n. 9
0
'''
MODEL    :: Pytorch Computer Vision Platform
DATE    :: 2021-01-26
FILE     :: main.py 
'''

from __future__ import absolute_import, division, print_function

from config.options import Options
from engine.train import Train

opt = Options().parse()

if __name__ == "__main__":
    if opt.isTrain:
        trainer = Train(opt).train()
    else:
        print("--- Wrong Mode ---")
Esempio n. 10
0
 def png(cls):
     return Options(
         {
             "format": "png"
         }
     )
Esempio n. 11
0
 def geotiff(cls):
     return Options({"format": "geotiff", "crs": None})