@@ -46,17 +46,15 @@ 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.
51
+ Bounds should be Point objects.
52
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]]
55
-
56
- >>> bounds = TiledBounds(
57
- epsg=EPSG.4326,
58
- bounds=[Point(x=0, y=0),Point(x=100, y=100)]
59
- )
53
+ >>> bounds = TiledBounds(epsg=EPSG.EPSG4326,
54
+ bounds=[
55
+ Point(x=-99.21052827588443, y=19.405662413477728),
56
+ Point(x=-99.20534818927473, y=19.400498983095076)
57
+ ])
60
58
"""
61
59
epsg : EPSG
62
60
bounds : List [Point ]
@@ -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