test for @DVassilev on #8 and minor updates

This commit is contained in:
AJ ONeal 2016-08-03 09:05:23 -06:00
parent afe681240b
commit d5524f7b74
2 changed files with 18 additions and 9 deletions

View File

@ -17,13 +17,22 @@ var tests = [
, [ -124.61538461538463, -69.23076923076924 ] // face 5
];
tests.forEach(function (pair, i) {
var bugReports = [
// https://github.com/jonatkins/s2-geometry-javascript/issues/12
[ -6.120097, 106.846511 ]
// https://github.com/coolaj86/s2-geometry-javascript/issues/8#issuecomment-237204759
, [ -33.87347601637759, 151.1954084522501 ]
];
tests.concat(bugReports).forEach(function (pair, i) {
var lat = pair[0];
var lng = pair[1];
if (i < 6) {
console.log('');
console.log('');
console.log('FACE', i);
}
console.log('');
console.log('Lat/Lng');
@ -57,5 +66,5 @@ tests.forEach(function (pair, i) {
console.log('');
console.log('Quadkey');
console.log('=', nKey);
console.log('j', jKey);
console.log('j', jKey, "(" + jS2.toId(jKey) + ")");
});

View File

@ -1,4 +1,4 @@
var S2 = require('s2geometry-node');
var s2n = require('s2geometry-node');
// Provo, UT (Center St)
//var lat = 40.2574448;
@ -16,8 +16,8 @@ var S2 = require('s2geometry-node');
var lat = -43.5261282;
var lng = 172.6561085;
var s2latlng = new S2.S2LatLng(lat, lng);
var cellId = new S2.S2CellId(s2latlng).parent(15);
var s2nlatlng = new s2n.S2LatLng(lat, lng);
var cellId = new s2n.S2CellId(s2nlatlng).parent(15);
var cell;
var walk = [];
@ -47,6 +47,6 @@ walk.forEach(function (parts) {
var i = parts[0];
var cellId = parts[1];
cell = new S2.S2Cell(cellId);
cell = new s2n.S2Cell(cellId);
console.log(i, cell.face(), cellId.id(), cellId.toString(), cellId.toLatLng().toString(), cellId.level());
});