Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update mosaicJSON.bounds type to tuple(float, float, float, float) #158

Closed
vincentsarago opened this issue Jan 27, 2021 · 1 comment · Fixed by #159
Closed

update mosaicJSON.bounds type to tuple(float, float, float, float) #158

vincentsarago opened this issue Jan 27, 2021 · 1 comment · Fixed by #159

Comments

@vincentsarago
Copy link
Member

The only way to enforce a list to be a 4 element object is by using Tuple and that's why we define bounds in rio-tiler as
tuple(float, float, float, float) (e.g. https://github.com/cogeotiff/rio-tiler/blob/a10a8c5be8b067dd3ecc72e76bfd740a2b3213c9/rio_tiler/io/base.py#L37)

In the mosaic model we are a bit too permissive with List[float]

bounds: List[float] = Field([-180, -90, 180, 90])

Changing to Tuple[Float, Float, Float, Float] won't change how the object is stored on the json document

json.dumps((1,1,1,1))
'[1, 1, 1, 1]'
@kylebarron
Copy link
Member

Unless you want three-dimensional bounds with a 6-element iterable 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants