Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/rok4/Layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
from typing import Dict, List, Tuple, Union

from rok4.Exceptions import *
from rok4.Pyramid import Pyramid, PyramidType
from rok4.Storage import *
from rok4.Pyramid import Pyramid
from rok4.TileMatrixSet import TileMatrixSet
from rok4.Storage import *
from rok4.Utils import *
from rok4.enums import PyramidType


class Layer:
Expand Down
15 changes: 1 addition & 14 deletions src/rok4/Pyramid.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,7 @@
from rok4.Storage import *
from rok4.TileMatrixSet import TileMatrix, TileMatrixSet
from rok4.Utils import *


class PyramidType(Enum):
"""Pyramid's data type"""

RASTER = "RASTER"
VECTOR = "VECTOR"


class SlabType(Enum):
"""Slab's type"""

DATA = "DATA" # Slab of data, raster or vector
MASK = "MASK" # Slab of mask, only for raster pyramid, image with one band : 0 is nodata, other values are data
from rok4.enums import PyramidType, SlabType, StorageType


ROK4_IMAGE_HEADER_SIZE = 2048
Expand Down
9 changes: 1 addition & 8 deletions src/rok4/Storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,10 @@

gdal.UseExceptions()

from rok4.enums import StorageType
from rok4.Exceptions import *


class StorageType(Enum):
FILE = "file://"
S3 = "s3://"
CEPH = "ceph://"
HTTP = "http://"
HTTPS = "https://"


__S3_CLIENTS = {}
__S3_DEFAULT_CLIENT = None

Expand Down
13 changes: 1 addition & 12 deletions src/rok4/Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import os
import re

from enum import Enum
from typing import Dict, List, Tuple, Union

Expand All @@ -13,18 +14,6 @@
gdal.UseExceptions()


class ColorFormat(Enum):
"""A color format enumeration.
Except from "BIT", the member's name matches
a common variable format name. The member's value is
the allocated bit size associated to this format.
"""

BIT = 1
UINT8 = 8
FLOAT32 = 32


__SR_BOOK = {}


Expand Down
28 changes: 28 additions & 0 deletions src/rok4/enums.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#! python3 # noqa: E265

# standard lib
from enum import Enum


class PyramidType(Enum):
"""Pyramid's data type"""

RASTER = "RASTER"
VECTOR = "VECTOR"


class SlabType(Enum):
"""Slab's type"""

DATA = "DATA" # Slab of data, raster or vector
MASK = "MASK" # Slab of mask, only for raster pyramid, image with one band : 0 is nodata, other values are data


class StorageType(Enum):
"""Matrice de correspondance entre type de stockage et protocole."""

CEPH = "ceph://"
FILE = "file://"
HTTP = "http://"
HTTPS = "https://"
S3 = "s3://"
2 changes: 1 addition & 1 deletion tests/test_Layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from rok4.Exceptions import *
from rok4.Layer import Layer
from rok4.Pyramid import PyramidType
from rok4.enums import PyramidType


@mock.patch.dict(os.environ, {}, clear=True)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_Pyramid.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

from rok4.Exceptions import *
from rok4.Pyramid import *
from rok4.Storage import StorageType
from rok4.TileMatrixSet import TileMatrixSet
from rok4.enums import SlabType, StorageType

from rok4.Utils import *


Expand Down
1 change: 1 addition & 0 deletions tests/test_Storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from rok4.Exceptions import *
from rok4.Storage import *
from rok4.enums import StorageType


@mock.patch.dict(os.environ, {}, clear=True)
Expand Down