mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
update arcgis elevation
This commit is contained in:
parent
24616231a9
commit
cf767b4ea4
@ -33,13 +33,14 @@ import ArcgisElevationWorker from 'worker!./ArcgisElevationWorker.js';
|
||||
* @classdesc Provides elevations for Earth. Elevations are drawn from the NASA WorldWind elevation service.
|
||||
*/
|
||||
function ArcgisElevationCoverage() {
|
||||
// see: http://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer
|
||||
TiledElevationCoverage.call(this, {
|
||||
coverageSector: new Sector(-WWMath.MAX_LAT, WWMath.MAX_LAT, -180, 180),
|
||||
resolution: 360 / 256,
|
||||
resolution: 360 / 2 ** 16 / 256,
|
||||
retrievalImageFormat: "application/bil16",
|
||||
minElevation: -11000,
|
||||
maxElevation: 8850,
|
||||
urlBuilder: new WmsUrlBuilder("https://worldwind26.arc.nasa.gov/elev", "aster_v2", "", "1.3.0")
|
||||
minElevation: -450,
|
||||
maxElevation: 8700,
|
||||
urlBuilder: new WmsUrlBuilder("http://localhost:2020/api/Map/Elev", "WorldElevation3D", "", "1.3.0")
|
||||
});
|
||||
|
||||
this.displayName = "Arcgis Elevation Coverage";
|
||||
@ -59,7 +60,7 @@ ArcgisElevationCoverage.prototype.retrieveTileImage = function (tile) {
|
||||
let z = 360 / (tile.sector.maxLongitude - tile.sector.minLongitude);
|
||||
let x = (180 + tile.sector.minLongitude) / 360 * Math.pow(2, z);
|
||||
|
||||
if(Math.abs(tile.sector.minLatitude) > 85.01) {
|
||||
if (Math.abs(tile.sector.minLatitude) > 85.01) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -69,7 +69,7 @@ function TiledElevationCoverage(config) {
|
||||
|
||||
ElevationCoverage.call(this, config.resolution);
|
||||
|
||||
var firstLevelDelta = 45,
|
||||
var firstLevelDelta = 360,
|
||||
tileWidth = 256,
|
||||
lastLevel = LevelSet.numLevelsForResolution(firstLevelDelta / tileWidth, config.resolution),
|
||||
numLevels = Math.ceil(lastLevel); // match or exceed the specified resolution
|
||||
@ -182,7 +182,6 @@ function TiledElevationCoverage(config) {
|
||||
*/
|
||||
// this.urlBuilder = new UrlBuilder() || null;
|
||||
this.urlBuilder = config.urlBuilder || null;
|
||||
this.urlBuilder.serviceAddress = 'http://localhost:2020/api/Map/Elev';
|
||||
}
|
||||
|
||||
TiledElevationCoverage.prototype = Object.create(ElevationCoverage.prototype);
|
||||
@ -333,7 +332,7 @@ TiledElevationCoverage.prototype.areaElevationsForGrid = function (sector, numLa
|
||||
if (isNaN(result[resultIndex])) {
|
||||
if (this.coverageSector.containsLocation(lat, lon)) { // ignore locations outside of the model
|
||||
s = (lon + 180) / 360;
|
||||
t = (lat + 90) / 180;
|
||||
t = (lat + 180) / 360;
|
||||
this.areaElevationForCoord(s, t, level.levelNumber, result, resultIndex);
|
||||
}
|
||||
}
|
||||
@ -359,7 +358,7 @@ TiledElevationCoverage.prototype.areaElevationForCoord = function (s, t, levelNu
|
||||
for (var i = levelNumber; i >= 0; i--) {
|
||||
level = this.levels.level(i);
|
||||
levelWidth = Math.round(level.tileWidth * 360 / level.tileDelta.longitude);
|
||||
levelHeight = Math.round(level.tileHeight * 180 / level.tileDelta.latitude);
|
||||
levelHeight = Math.round(level.tileHeight * 360 / level.tileDelta.latitude);
|
||||
tMin = 1 / (2 * levelHeight);
|
||||
tMax = 1 - tMin;
|
||||
vMin = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user