mapbox / tilejson-spec

JSON format for describing map tilesets.
255 stars 52 forks source link

Bounds where left > right #25

Open alpha-beta-soup opened 7 years ago

alpha-beta-soup commented 7 years ago

If I have a tile source that goes from west of Australia to ~east~ right of New Zealand, I would expect to be able to write the bounds as:

[90, -70, -170, 70] // left, bottom, right, top

Unfortunately this doesn't seem to produce a valid tilejson (in Mapbox GL JS no tiles are requested for this source).

It's not possible to workaround this by just switching the left/right longitudes, because that represents all the negative space where there is no data. Leaving the only possible workaround to specify the entire -180°/180° range:

[-180, -70, 180, 70],

This results in a lot of unnecessary requests to the server that just result in 404 responses, and also prevents the ability to draw a border around the bounds. However it works from a user perspective because all data is shown.

Extending the bounds beyond 180° to 190° (below) results in appropriate requests, but nothing between 180° and 190°(with Mapbox GL JS as the implementation).

[90, -70, 190, 70]

Should the spec be able to support bounds where the left longitude is greater than the right longitude?

nigels-com commented 6 years ago

Agreed, this is a bug. longitude should not be limited to [-180,180].

mapsam commented 6 years ago

Thanks for the ticket @alpha-beta-soup ! Agree that enforcing bounds to 180/90 has its limitations. We’ll work on clarifying the current limitations in v3 and consider expanding beyond 180/90 for v4.