@dataforsyningen/saul 3.1.2 → 3.1.3

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.
@@ -118,7 +118,7 @@ function radians(degrees) {
118
118
  }
119
119
 
120
120
  /**
121
- * (DEPRECATED - Use getElevation) Fetches elevation based on X,Y coordinates using DHM/Koter endpoint
121
+ * Fetches a single elevation value based on X,Y coordinates using DHM/Koter endpoint
122
122
  * @param {number} xcoor - EPSG:25832 X coordinate
123
123
  * @param {number} ycoor - EPSG:25832 Y coordinate
124
124
  * @param {{API_DHM_BASEURL: string, API_DHM_USERNAME: string, API_DHM_PASSWORD: string}} auth - API autentication data. See ../config.js.example for reference.
@@ -3,7 +3,7 @@ import { get } from './api.js'
3
3
 
4
4
  /** Fetches a GeoTIFF with elevation data matching the bounding box of a STAC API item (image)
5
5
  * @param {object} stac_item - STAC API item from a featureCollection request
6
- * @param {{API_DHM_BASEURL: string, API_DHM_USERNAME: string, API_DHM_PASSWORD: string}} auth - API autentication data. See ../config.js.example for reference.
6
+ * @param {{API_DHM_WCS_BASEURL: string, API_DHM_USERNAME: string, API_DHM_PASSWORD: string}} auth - API autentication data. See ../config.js.example for reference.
7
7
  * @param {number} [fidelity] - Resolution fidelity. Higher number means more pixels and better precision. Between 1 and 0.01.
8
8
  * @returns {object} GeoTiff data
9
9
  */
@@ -13,8 +13,8 @@ function getTerrainGeoTIFF(stac_item, auth, fidelity = 0.05) {
13
13
  const width = Math.round( stac_item.properties['proj:shape'][0] * fidelity )
14
14
  const height = Math.round( stac_item.properties['proj:shape'][1] * fidelity )
15
15
 
16
- // DHM data endpoint
17
- let url = 'https://services.datafordeler.dk/DHMNedboer/dhm_wcs/1.0.0/WCS'
16
+ // GET request for DHM WCS data
17
+ let url = auth.API_DHM_WCS_BASEURL
18
18
  url += '?SERVICE=WCS&COVERAGE=dhm_terraen&RESPONSE_CRS=epsg:25832&CRS=epsg:25832&FORMAT=GTiff&REQUEST=GetCoverage&VERSION=1.0.0'
19
19
  url += `&username=${ auth.API_DHM_USERNAME }&password=${ auth.API_DHM_PASSWORD }` // TODO: Should be auth stuff
20
20
  url += `&height=${ height }`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataforsyningen/saul",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "description": "This is a collection of stand-alone methods for photogrammetry calculations and API interactions for 'Danske Skråfotos'.",
5
5
  "main": "index.js",
6
6
  "type": "module",