systemapic / systemapic.js

Systemapic Javascript API
https://systemapic.com
0 stars 3 forks source link

calculate outside of bounds extent #212

Closed knutole closed 8 years ago

knutole commented 8 years ago

for future reference...

4 / 8 / 4

tile @ zoom 4, hele sør-norge

https://tiles-txb.systemapic.com/v2/cubes/cube-3dba28e3-b374-4b4d-8efe-04a87ccce93b/file_hqyhzypjvxierhzzygfk/4/8/4.png?access_token=pk.8FhhB90ax6KkQmoK0AMePd0R6IlkxM4VAGewsXw8&cache=fduulw

raster_bounds --> west: -77138.35184241229, south: 7825050.684847997, east: 3662682.360995631, north: 11663633.31837636 tile_bounds --> west: 0, south: 7514065.628545966, east: 2504688.5428486555, north: 10018754.171394618

4 / 8 / 5

tile @ zoom 4, midt-europa

https://tiles-txb.systemapic.com/v2/cubes/cube-3dba28e3-b374-4b4d-8efe-04a87ccce93b/file_hqyhzypjvxierhzzygfk/4/8/5.png?access_token=pk.8FhhB90ax6KkQmoK0AMePd0R6IlkxM4VAGewsXw8&cache=fduulw

raster_bounds --> west: -77138.35184241229, south: 7825050.684847997, east: 3662682.360995631, north: 11663633.31837636 tile_bounds --> west: 0, south: 5009377.085697309, east: 2504688.5428486555, north: 7514065.628545966

4 / 8 / 9

tile @ zoom 4, cape town

https://tiles-txb.systemapic.com/v2/cubes/cube-3dba28e3-b374-4b4d-8efe-04a87ccce93b/file_hqyhzypjvxierhzzygfk/4/8/9.png?access_token=pk.8FhhB90ax6KkQmoK0AMePd0R6IlkxM4VAGewsXw8&cache=fduulw

raster_bounds --> west: -77138.35184241229, south: 7825050.684847997, east: 3662682.360995631, north: 11663633.31837636 tile_bounds --> west: 0, south: -5009377.085697311, east: 2504688.5428486555, north: -2504688.542848655


south is calculated in meters from equator north same

east is calcualted in meters from greenwich west same


tile is outside raster bounds if:


tile-north is south of raster-south, ie. tile_north < raster_south

OR

tile-east is west of raster-west, ie. tile-east < raster-west

OR

tile-south is north of raster-north, ie. tile-south > raster-north

OR

tile-west is east of raster-east, ie. tile-west > raster-east