@dataforsyningen/saul 4.1.0 → 4.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/assets/dk-terrain.tiff +0 -0
- package/config.js.example +1 -1
- package/package.json +1 -1
- package/test/geotiff-experiments.js +6 -12
package/README.md
CHANGED
|
@@ -39,12 +39,14 @@ From within `node_modules/@dataforsyningen/saul` you can run the `test` command
|
|
|
39
39
|
npm run test
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
##
|
|
42
|
+
## Updating local terrain model
|
|
43
|
+
|
|
44
|
+
The Saul package includes a terrain elevation model hosted as a single GeoTiff file for events where terrain data from Datafordeler service is unavailable. To update the terrain model, simply download a new GeoTiff from Datafordeler with the following URL (supply your own username/password) and save it to `/assets/dk-terrain.tiff` in the package directory.
|
|
45
|
+
|
|
46
|
+
https://services.datafordeler.dk/DHMNedboer/dhm_wcs/1.0.0/WCS?SERVICE=WCS&COVERAGE=dhm_terraen&RESPONSE_CRS=epsg:25832&CRS=epsg:25832&FORMAT=GTiff&REQUEST=GetCoverage&VERSION=1.0.0&username=xxx&password=xxx&height=1000&width=1260&bbox=430000,6040000,900000,6413000
|
|
43
47
|
|
|
44
|
-
Create a new release in Github to publish an updated NPM package.
|
|
45
|
-
Details are available in the "Npm" section of SDFI ITU's wiki.
|
|
46
48
|
|
|
47
49
|
## Acknowledgements
|
|
48
50
|
|
|
49
51
|
SAUL is made available under the MIT license by
|
|
50
|
-
The Skråfoto Team @ [
|
|
52
|
+
The Skråfoto Team @ [KDS](https://kds.dk/)
|
package/assets/dk-terrain.tiff
CHANGED
|
Binary file
|
package/config.js.example
CHANGED
|
@@ -2,7 +2,7 @@ export default {
|
|
|
2
2
|
|
|
3
3
|
// STAC TOKEN can be aquired from https://dataforsyningen.dk/
|
|
4
4
|
API_STAC_TOKEN: "", // Dataforsyningen token
|
|
5
|
-
API_STAC_BASEURL: "https://api.dataforsyningen.dk/rest/skraafoto_api/
|
|
5
|
+
API_STAC_BASEURL: "https://api.dataforsyningen.dk/rest/skraafoto_api/v2",
|
|
6
6
|
|
|
7
7
|
// DHM URL and auth can be aquired from https://datafordeler.dk/dataoversigt/danmarks-hoejdemodel-dhm/koter/
|
|
8
8
|
API_DHM_WCS_BASEURL: "https://services.datafordeler.dk/DHMNedboer/dhm_wcs/1.0.0/WCS",
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import auth from '../config.js'
|
|
2
|
-
import { getElevation, visualizeGeotiff } from '../modules/
|
|
3
|
-
import { getImageXY, getWorldXYZ } from '../modules/
|
|
4
|
-
import { getDenmarkGeoTiff, consumeGeoTIFF } from '../modules/api.js'
|
|
2
|
+
import { getElevation, getDenmarkGeoTiff, visualizeGeotiff } from '../modules/elevation.js'
|
|
3
|
+
import { getImageXY, getWorldXYZ } from '../modules/image.js'
|
|
5
4
|
|
|
6
|
-
const geoTiffResolution =
|
|
5
|
+
const geoTiffResolution = 60
|
|
7
6
|
|
|
8
7
|
const worldxy = [533344, 6172951] // World XY Point in all images near Vejle
|
|
9
8
|
const image1xy = [8566,4105] // Point/Image XY in `image1`
|
|
@@ -44,11 +43,6 @@ function fetchImageData(imageId) {
|
|
|
44
43
|
})
|
|
45
44
|
}
|
|
46
45
|
|
|
47
|
-
/*
|
|
48
|
-
* Example request to get terrain data for all of DK
|
|
49
|
-
* https://services.datafordeler.dk/DHMNedboer/dhm_wcs/1.0.0/WCS?SERVICE=WCS&COVERAGE=dhm_terraen&RESPONSE_CRS=epsg:25832&CRS=epsg:25832&FORMAT=GTiff&REQUEST=GetCoverage&VERSION=1.0.0&username=QKJBQATHVS&password=ytxCA8UGM5n0Z*zi&height=1000&width=1000&bbox=430000,6040000,900000,6413000
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
46
|
console.log('-------------------------------------------------------')
|
|
53
47
|
console.log('-- Experiments with pan-Danish GeoTiff terrain model --')
|
|
54
48
|
console.log('-------------------------------------------------------')
|
|
@@ -66,10 +60,10 @@ It should
|
|
|
66
60
|
*/
|
|
67
61
|
|
|
68
62
|
// Get GTiff from API
|
|
69
|
-
|
|
63
|
+
const DKGeoTiff = await getDenmarkGeoTiff({auth: auth, size: geoTiffResolution})
|
|
70
64
|
|
|
71
65
|
// Get big GTiff
|
|
72
|
-
const DKGeoTiff = await getDenmarkGeoTiff({src: 'http://localhost:7701/dk-terrain.tiff'})
|
|
66
|
+
//const DKGeoTiff = await getDenmarkGeoTiff({src: 'http://localhost:7701/dk-terrain.tiff'})
|
|
73
67
|
|
|
74
68
|
// Get tiny GTiff
|
|
75
69
|
//const DKGeoTiff = await getDenmarkGeoTiff({src: 'http://localhost:7701/tiny-dk-terrain.tiff'})
|
|
@@ -247,4 +241,4 @@ console.table({
|
|
|
247
241
|
|
|
248
242
|
console.log('got DKGeotiff', (DKGeoTiff.source.arrayBuffer.byteLength / 1024), 'Kb', pointø)
|
|
249
243
|
|
|
250
|
-
|
|
244
|
+
visualizeGeotiff(DKGeoTiff)
|