colonel-mercator
Advanced tools
Comparing version 0.0.1 to 0.1.0
var r_utils = require('mapnik-omnivore/lib/utils'); | ||
module.exports.get_resolution = function(metadata, maxRes, snapping, callback) { | ||
var EPSLN = 1.0e-10; | ||
@@ -11,20 +10,9 @@ var cellSize = metadata.raster.pixelSize.map(function(r) { | ||
var validSpatRef = r_utils.getSpatialResolutions(); | ||
var spatialRes; | ||
var spatialRes = r_utils.getValidSpatialResolutions(validSpatRef, cellSize[0]); | ||
var snapRes, snapSpatialRes; | ||
if (snapping) { | ||
snapRes = spatialRes[spatialRes.length - 1] - EPSLN; | ||
snapSpatialRes = r_utils.getValidSpatialResolutions(validSpatRef, snapRes); | ||
// Insurance agains recursive resampling | ||
if (spatialRes[spatialRes.length - 1] !== snapSpatialRes[snapSpatialRes.length - 1]) { | ||
throw new Error('Cellsize is over threshold'); | ||
} | ||
// Set cellsize to resolution @ mapnik-omnivore threshold - EPSLN | ||
if (snapping !== false) { | ||
spatialRes = r_utils.getValidSpatialResolutions(validSpatRef, cellSize[0], snapping); | ||
cellSize = [ | ||
snapSpatialRes[snapSpatialRes.length - 1], | ||
snapSpatialRes[snapSpatialRes.length - 1] | ||
validSpatRef[spatialRes.length], | ||
validSpatRef[spatialRes.length] | ||
]; | ||
@@ -48,3 +36,3 @@ } | ||
z: z, | ||
thresh: validSpatRef[Math.min(z + upzoom, validSpatRef.length -1)] | ||
thresh: validSpatRef[Math.min(z + upzoom, validSpatRef.length - 1)] | ||
} | ||
@@ -51,0 +39,0 @@ }); |
{ | ||
"name": "colonel-mercator", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"main": "./index", | ||
@@ -16,3 +16,3 @@ "engines": { | ||
"dependencies": { | ||
"mapnik-omnivore": "^6.4.0", | ||
"mapnik-omnivore": "^7.0.0", | ||
"minimist": "^1.1.0", | ||
@@ -19,0 +19,0 @@ "split": "^0.3.3" |
# colonel-mercator | ||
[![Build Status](https://travis-ci.org/mapbox/colonel-mercator.svg)](https://travis-ci.org/mapbox/colonel-mercator)[![Coverage Status](https://coveralls.io/repos/mapbox/colonel-mercator/badge.svg?branch=master&service=github)](https://coveralls.io/github/mapbox/colonel-mercator?branch=master) | ||
Gets raster pixel resolutions, and optionally snaps them to `mapnik-omnivore` tiling thresholds. | ||
@@ -3,0 +6,0 @@ Also, generates "metatile" zooms - the tile sizes at which a given input resolution would be over a size threshold based on an "upzoom" (the resolution of zoom levels "up") |
Sorry, the diff of this file is not supported yet
40
6966
7
62
+ Addedabbrev@1.1.1(transitive)
+ Addedajv@4.11.8(transitive)
+ Addedansi-regex@2.1.1(transitive)
+ Addedaproba@1.2.0(transitive)
+ Addedare-we-there-yet@1.1.7(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@0.2.01.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.6.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedblock-stream@0.0.9(transitive)
+ Addedboom@2.10.1(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedcall-bind@1.0.8(transitive)
+ Addedcall-bind-apply-helpers@1.0.1(transitive)
+ Addedcall-bound@1.0.3(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedco@4.6.0(transitive)
+ Addedcode-point-at@1.1.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedconsole-control-strings@1.1.0(transitive)
+ Addedcore-util-is@1.0.21.0.3(transitive)
+ Addedcryptiles@2.0.5(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddeep-extend@0.6.0(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddelegates@1.0.0(transitive)
+ Addeddetect-libc@1.0.3(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.0.0(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.1.4(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedfstream@1.0.12(transitive)
+ Addedfstream-ignore@1.0.5(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedgauge@2.7.4(transitive)
+ Addedgdal@0.8.0(transitive)
+ Addedget-intrinsic@1.2.7(transitive)
+ Addedget-proto@1.0.1(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhar-schema@1.0.5(transitive)
+ Addedhar-validator@4.2.1(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhas-unicode@2.0.1(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhawk@3.1.3(transitive)
+ Addedhoek@2.16.3(transitive)
+ Addedhttp-signature@1.1.1(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedini@1.3.8(transitive)
+ Addedis-fullwidth-code-point@1.0.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisarray@2.0.5(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-stable-stringify@1.2.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsonify@0.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedmapnik@3.5.14(transitive)
+ Addedmapnik-omnivore@7.4.0(transitive)
+ Addedmapnik-vector-tile@1.2.2(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedms@2.0.0(transitive)
+ Addednan@2.4.0(transitive)
+ Addednode-pre-gyp@0.6.39(transitive)
+ Addednopt@4.0.3(transitive)
+ Addednpmlog@4.1.2(transitive)
+ Addednumber-is-nan@1.0.1(transitive)
+ Addedoauth-sign@0.8.2(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedos-homedir@1.0.2(transitive)
+ Addedos-tmpdir@1.0.2(transitive)
+ Addedosenv@0.1.5(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedperformance-now@0.2.0(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedprotozero@1.4.5(transitive)
+ Addedpunycode@1.4.1(transitive)
+ Addedqs@6.4.1(transitive)
+ Addedqueue-async@1.2.1(transitive)
+ Addedrc@1.2.8(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedrequest@2.81.0(transitive)
+ Addedrimraf@2.7.1(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedset-blocking@2.0.0(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedsntp@1.0.9(transitive)
+ Addedsrs@1.1.0(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedstring-width@1.0.2(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedstringstream@0.0.6(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedstrip-json-comments@2.0.1(transitive)
+ Addedtar@2.2.2(transitive)
+ Addedtar-pack@3.4.1(transitive)
+ Addedtough-cookie@2.3.4(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addeduid-number@0.0.6(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)
+ Addedwide-align@1.1.5(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removedgdal@0.7.2(transitive)
- Removedmapnik@3.4.19(transitive)
- Removedmapnik-omnivore@6.4.0(transitive)
- Removednan@2.2.1(transitive)
- Removedprotozero@1.3.0(transitive)
- Removedqueue-async@1.0.7(transitive)
- Removedsrs@1.0.1(transitive)
Updatedmapnik-omnivore@^7.0.0