@@ -46,16 +46,14 @@ class EPSG(Enum):
46
46
47
47
48
48
class TiledBounds (BaseModel ):
49
- """ Bounds for a tiled image asset related to the relevant epsg.
49
+ """ Bounds for a tiled image asset related to the relevant epsg.
50
50
51
- Bounds should be Point objects. Currently, we support bounds in EPSG 4326.
52
-
53
- If version of asset is 2, these should be [[lat,lng],[lat,lng]]
54
- If version of asset is 1, these should be [[lng,lat]],[lng,lat]]
51
+ Bounds should be Point objects.
52
+ Currently, we support bounds in EPSG 4326. These should be [[lat,lng],[lat,lng]]
55
53
56
54
>>> bounds = TiledBounds(
57
55
epsg=EPSG.4326,
58
- bounds=[Point(x=0, y=0),Point(x=100 , y=100 )]
56
+ bounds=[Point(x=0, y=0),Point(x=30 , y=30 )]
59
57
)
60
58
"""
61
59
epsg : EPSG
@@ -72,13 +70,13 @@ def validate_bounds_not_equal(cls, bounds):
72
70
f"Bounds on either axes cannot be equal, currently { bounds } " )
73
71
return bounds
74
72
75
- #bounds are assumed to be in EPSG 4326 as that is what leaflet assumes
73
+ #validate bounds are within lat,lng range if they are EPSG4326
76
74
@root_validator
77
75
def validate_bounds_lat_lng (cls , values ):
78
76
epsg = values .get ('epsg' )
79
77
bounds = values .get ('bounds' )
80
78
81
- if epsg != EPSG .SIMPLEPIXEL :
79
+ if epsg == EPSG .EPSG4326 :
82
80
for bound in bounds :
83
81
lat , lng = bound .y , bound .x
84
82
if int (lng ) not in VALID_LNG_RANGE or int (
0 commit comments