24 lines
1.0 KiB
TypeScript
24 lines
1.0 KiB
TypeScript
import { DemTileService } from '../src/tactical/dem-tile.service';
|
|
|
|
async function main() {
|
|
const pointA = { lat: 32.1088, lng: 36.0674 }; // Peak
|
|
const pointB = { lat: 32.1141, lng: 36.0667 }; // Valley
|
|
|
|
console.log('Testing DEM elevation at Point A (Peak) and Point B (Valley)...');
|
|
|
|
// Let's test at zoom 12, 13, 14
|
|
for (const z of [12, 13, 14]) {
|
|
const tA = DemTileService.coordToTile(pointA.lat, pointA.lng, z);
|
|
const tB = DemTileService.coordToTile(pointB.lat, pointB.lng, z);
|
|
console.log(`Zoom ${z}:`);
|
|
console.log(` Point A: Tile [${z}/${tA.tileX}/${tA.tileY}], subX=${tA.subX.toFixed(2)}, subY=${tA.subY.toFixed(2)}`);
|
|
console.log(` Point B: Tile [${z}/${tB.tileX}/${tB.tileY}], subX=${tB.subX.toFixed(2)}, subY=${tB.subY.toFixed(2)}`);
|
|
|
|
const elevA = await DemTileService.getElevation(pointA.lat, pointA.lng, z);
|
|
const elevB = await DemTileService.getElevation(pointB.lat, pointB.lng, z);
|
|
console.log(` Elev A: ${elevA}m, Elev B: ${elevB}m`);
|
|
}
|
|
}
|
|
|
|
main().catch(console.error);
|