tile-cover
Advanced tools
Comparing version 0.1.1 to 0.1.2
32
index.js
var isInside = require('turf-inside'), | ||
bboxPolygon = require('turf-bbox-polygon'), | ||
intersect = require('turf-intersect') | ||
bboxPolygon = require('turf-bbox-polygon'), | ||
intersect = require('turf-intersect'); | ||
@@ -12,4 +12,4 @@ module.exports.geojson = function(geom, limits) { | ||
var tileFeatures = locked.map(function(t){ | ||
return tileToGeojson(t) | ||
var tileFeatures = locked.map(function(t) { | ||
return tileToGeojson(t); | ||
}); | ||
@@ -19,3 +19,3 @@ return { | ||
features: tileFeatures | ||
} | ||
}; | ||
} | ||
@@ -84,3 +84,3 @@ | ||
splitSeek(t, geom, locked, limits); | ||
}) | ||
}); | ||
} else if(tileCovers){ | ||
@@ -112,3 +112,3 @@ locked.push(tile); | ||
properties: {} | ||
} | ||
}; | ||
} | ||
@@ -120,3 +120,3 @@ | ||
features: [feat] | ||
} | ||
}; | ||
} | ||
@@ -130,3 +130,3 @@ | ||
[tile[0]*2, tile[1]*2+1, tile[2]+1], | ||
] | ||
]; | ||
} | ||
@@ -137,15 +137,15 @@ | ||
if(tile[0]%2===0 && tile[1]%2===0){ | ||
return [tile[0]/2, tile[1]/2, tile[2]-1] | ||
return [tile[0]/2, tile[1]/2, tile[2]-1]; | ||
} | ||
// bottom left | ||
else if((tile[0]%2===0) && (!tile[1]%2===0)){ | ||
return [tile[0]/2, (tile[1]-1)/2, tile[2]-1] | ||
return [tile[0]/2, (tile[1]-1)/2, tile[2]-1]; | ||
} | ||
// top right | ||
else if((!tile[0]%2===0) && (tile[1]%2===0)){ | ||
return [(tile[0]-1)/2, (tile[1])/2, tile[2]-1] | ||
return [(tile[0]-1)/2, (tile[1])/2, tile[2]-1]; | ||
} | ||
// bottom right | ||
else { | ||
return [(tile[0]-1)/2, (tile[1]-1)/2, tile[2]-1] | ||
return [(tile[0]-1)/2, (tile[1]-1)/2, tile[2]-1]; | ||
} | ||
@@ -155,3 +155,3 @@ } | ||
function getSiblings(tile){ | ||
return getChildren(getParent(tile)) | ||
return getChildren(getParent(tile)); | ||
} | ||
@@ -166,3 +166,3 @@ | ||
} | ||
}) | ||
}); | ||
return hasAll; | ||
@@ -177,3 +177,3 @@ } | ||
} | ||
}) | ||
}); | ||
return tileFound; | ||
@@ -180,0 +180,0 @@ } |
{ | ||
"name": "tile-cover", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "generate the minimum number of tiles to cover a geojson geometry", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
751434