mapbox/tilebelt

Wrong tile for crazy 0,0-spanning bbox

Closed this issue · 2 comments

We've got the bbox [-0.000001,-1.000001,1000000,999999] in cardboard's tests. I expect that since it spans both the equator and the prime meridian its tile would be [0,0,0] despite being way off the globe at the upper right, yes? I'm finding this.

> require('tilebelt').bboxToTile([-0.000001,-1.000001,1000000,999999])
[ 0, 1, 1 ]

hm, in my opinion [-0.000001,-1.000001,1000000,999999] is an invalid bbox, since north and east are out of coordinate range. Do you have any new thoughts on this @sgillies?

I think it's the north that's more problematic than the east, right? I'd be okay with an error being raised if the input latitudes were +/- 90.