@@ -46,17 +46,15 @@ class EPSG(Enum):
4646
4747
4848class 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.
5050
51- Bounds should be Point objects. Currently, we support bounds in EPSG 4326.
51+ Bounds should be Point objects.
5252
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+ ])
6058 """
6159 epsg : EPSG
6260 bounds : List [Point ]
@@ -72,13 +70,13 @@ def validate_bounds_not_equal(cls, bounds):
7270 f"Bounds on either axes cannot be equal, currently { bounds } " )
7371 return bounds
7472
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
7674 @root_validator
7775 def validate_bounds_lat_lng (cls , values ):
7876 epsg = values .get ('epsg' )
7977 bounds = values .get ('bounds' )
8078
81- if epsg != EPSG .SIMPLEPIXEL :
79+ if epsg == EPSG .EPSG4326 :
8280 for bound in bounds :
8381 lat , lng = bound .y , bound .x
8482 if int (lng ) not in VALID_LNG_RANGE or int (
0 commit comments