Skip to content

Commit

Permalink
round maxzoom up instead of down
Browse files Browse the repository at this point in the history
  • Loading branch information
gretacb committed Jan 14, 2015
1 parent b50212a commit 7f4964c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/datasource-processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ function getMinMaxZoomGDAL(pixelSize, center, proj, callback) {
return res > pixelSize[0]
});

var maxzoom = validSpatialResolutions.length - 1;
var maxzoom = validSpatialResolutions.length;
var minzoom = Math.max(0, maxzoom - 6);

return callback(null, minzoom, maxzoom);
Expand Down
8 changes: 4 additions & 4 deletions test/datasource-processor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,8 @@ var UPDATE = process.env.UPDATE;
});
});
tape('Setting min/max zoom for GDAL sources: should return expected values for min/maxzoom', function(assert) {
var expectedMin = 8;
var expectedMax = 14;
var expectedMin = 9;
var expectedMax = 15;
var proj = "+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs";
var center = [-110.32476292309875,44.56502238336985];
var pixelSize = [ 7.502071930146189, 7.502071930145942 ];
Expand All @@ -502,8 +502,8 @@ var UPDATE = process.env.UPDATE;

tape('Setting min/max zoom for Landsat 8 source: should not exceed z12', function(assert) {

var expectedMin = 6;
var expectedMax = 12;
var expectedMin = 7;
var expectedMax = 13;

var proj = "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs";

Expand Down
8 changes: 4 additions & 4 deletions test/fixtures/metadata_sample_tif.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"stats": {
"min": 0,
"max": 100,
"mean": 29.725628716175,
"std_dev": 36.988859543635
"mean": 29.725628716175223,
"std_dev": 36.98885954363488
},
"scale": 1,
"unitType": "",
Expand Down Expand Up @@ -59,8 +59,8 @@
-110.28443250326441,
44.596766518228264
],
"minzoom": 8,
"maxzoom": 14,
"minzoom": 9,
"maxzoom": 15,
"dstype": "gdal",
"filetype": ".tif",
"layers": [
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/metadata_sample_vrt.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
-110.28443250326441,
44.596766518228264
],
"minzoom": 8,
"maxzoom": 14,
"minzoom": 9,
"maxzoom": 15,
"dstype": "gdal",
"filetype": ".vrt",
"layers": [
Expand Down

0 comments on commit 7f4964c

Please sign in to comment.