-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
layout: example.html | ||
title: COG with ModelTransformation | ||
shortdesc: COG with ModelTransformation. | ||
docs: > | ||
Example of using a COG with ModelTransformation. | ||
A ModelTransformation may rotate or skew the tile grid relative to the reported projection. | ||
This can be reprojected to that or any other supported projection. | ||
tags: "cog, projection, ModelTransformation" | ||
--- | ||
<div id="map" class="map"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import GeoTIFF from '../src/ol/source/GeoTIFF.js'; | ||
import Map from '../src/ol/Map.js'; | ||
import OSM from '../src/ol/source/OSM.js'; | ||
import TileLayer from '../src/ol/layer/WebGLTile.js'; | ||
import proj4 from 'proj4'; | ||
import {fromEPSGCode, register} from '../src/ol/proj/proj4.js'; | ||
|
||
register(proj4); | ||
|
||
const cogSource = new GeoTIFF({ | ||
sources: [ | ||
{ | ||
url: 'https://umbra-open-data-catalog.s3.amazonaws.com/sar-data/tasks/Tanna%20Island,%20Vanuatu/9c76a918-9247-42bf-b9f6-3b4f672bc148/2023-02-12-21-33-56_UMBRA-04/2023-02-12-21-33-56_UMBRA-04_GEC.tif', | ||
nodata: 0, | ||
}, | ||
], | ||
}); | ||
|
||
const map = new Map({ | ||
target: 'map', | ||
layers: [ | ||
new TileLayer({ | ||
source: new OSM(), | ||
}), | ||
new TileLayer({ | ||
source: cogSource, | ||
opacity: 0.8, | ||
}), | ||
], | ||
view: cogSource | ||
.getView() | ||
.then((viewConfig) => | ||
fromEPSGCode(viewConfig.projection.getCode()).then(() => viewConfig) | ||
), | ||
}); |