diff --git a/CHANGELOG.md b/CHANGELOG.md index f6703575af..4023a18a47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,49 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.0.0](https://github.com/linz/basemaps/compare/v3.6.0...v4.0.0) (2020-07-09) + + +### Bug Fixes + +* **cli:** improve image quality when fully zoomed in ([#884](https://github.com/linz/basemaps/issues/884)) ([7880d92](https://github.com/linz/basemaps/commit/7880d92b3eb8897f592dd87609e0f557b94ef6bb)) +* **landing:** Fix typos in side menu ([#883](https://github.com/linz/basemaps/issues/883)) ([b380757](https://github.com/linz/basemaps/commit/b380757fb306d9cfd987a7f3255ebd37fbe23d39)) + + +### Features + +* improve access to the GDAL cli ([#882](https://github.com/linz/basemaps/issues/882)) ([5eaef38](https://github.com/linz/basemaps/commit/5eaef38ae19ca2b80843112502bdf15df57acab6)) + + +### BREAKING CHANGES + +* this changes how to get access to a new gdal instance to Gdal.create() + +Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> + + + + + +# [3.6.0](https://github.com/linz/basemaps/compare/v3.5.0...v3.6.0) (2020-07-08) + + +### Bug Fixes + +* **cli:** make clipMultipolygon always remove degenerate edges ([#863](https://github.com/linz/basemaps/issues/863)) ([c3c4cdf](https://github.com/linz/basemaps/commit/c3c4cdf8a8bb87e79569b08272ddb0fb2bfe8f01)) +* **lambda:** Set Cors header on GET requests ([#865](https://github.com/linz/basemaps/issues/865)) ([c3e3c4c](https://github.com/linz/basemaps/commit/c3e3c4c331458a2d3ea5570a84e2ae961c19fd7f)) +* **wmts:** add identifier ([#877](https://github.com/linz/basemaps/issues/877)) ([d2d9f56](https://github.com/linz/basemaps/commit/d2d9f56eb348e1131fa951a59e799cc333fb8a31)) + + +### Features + +* **landing:** Add content to contact us mailto: link ([#879](https://github.com/linz/basemaps/issues/879)) ([579ac92](https://github.com/linz/basemaps/commit/579ac92e2f39c70a8d67c2d01613f91e7b194774)) +* **landing:** limit nztm to its extent ([#878](https://github.com/linz/basemaps/issues/878)) ([7470679](https://github.com/linz/basemaps/commit/747067955b0d52343498c81c2c20b29516046a75)) + + + + + # [3.5.0](https://github.com/linz/basemaps/compare/v3.4.2...v3.5.0) (2020-07-05) diff --git a/audit-resolve.json b/audit-resolve.json index 28875a2868..d91a87a87d 100644 --- a/audit-resolve.json +++ b/audit-resolve.json @@ -2,113 +2,91 @@ "decisions": { "1523|@typescript-eslint/eslint-plugin>@typescript-eslint/experimental-utils>@typescript-eslint/typescript-estree>lodash": { "decision": "ignore", - "madeAt": 1593732230431, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|@typescript-eslint/parser>@typescript-eslint/experimental-utils>@typescript-eslint/typescript-estree>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|@typescript-eslint/parser>@typescript-eslint/typescript-estree>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|eslint>inquirer>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|eslint>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|eslint>table>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|lerna>@lerna/clean>@lerna/prompt>inquirer>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|lerna>@lerna/import>@lerna/prompt>inquirer>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|lerna>@lerna/publish>@lerna/npm-dist-tag>@lerna/otplease>@lerna/prompt>inquirer>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|lerna>@lerna/publish>@lerna/npm-publish>@lerna/otplease>@lerna/prompt>inquirer>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|lerna>@lerna/publish>@lerna/otplease>@lerna/prompt>inquirer>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|lerna>@lerna/publish>@lerna/prompt>inquirer>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|lerna>@lerna/publish>@lerna/version>@lerna/prompt>inquirer>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|lerna>@lerna/version>@lerna/prompt>inquirer>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|lerna>@lerna/publish>@lerna/version>@lerna/conventional-commits>conventional-changelog-core>conventional-changelog-writer>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|lerna>@lerna/version>@lerna/conventional-commits>conventional-changelog-core>conventional-changelog-writer>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|lerna>@lerna/publish>@lerna/version>@lerna/conventional-commits>conventional-changelog-core>conventional-commits-parser>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|lerna>@lerna/version>@lerna/conventional-commits>conventional-changelog-core>conventional-commits-parser>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|lerna>@lerna/publish>@lerna/version>@lerna/conventional-commits>conventional-recommended-bump>conventional-commits-parser>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|lerna>@lerna/version>@lerna/conventional-commits>conventional-recommended-bump>conventional-commits-parser>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|lerna>@lerna/publish>@lerna/version>@lerna/conventional-commits>conventional-changelog-core>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 }, "1523|lerna>@lerna/version>@lerna/conventional-commits>conventional-changelog-core>lodash": { "decision": "ignore", - "madeAt": 1593732230432, - "expiresAt": 1594337019864 + "madeAt": 1594337410231 } }, "rules": {}, diff --git a/lerna.json b/lerna.json index 4f82da4343..b49311a2e4 100644 --- a/lerna.json +++ b/lerna.json @@ -3,5 +3,5 @@ "packages": [ "packages/*" ], - "version": "3.5.0" + "version": "4.0.0" } diff --git a/packages/__tests__/CHANGELOG.md b/packages/__tests__/CHANGELOG.md index 44eff0eaa3..4f99177572 100644 --- a/packages/__tests__/CHANGELOG.md +++ b/packages/__tests__/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.0.0](https://github.com/linz/basemaps/compare/v3.6.0...v4.0.0) (2020-07-09) + +**Note:** Version bump only for package @basemaps/test + + + + + # [3.1.0](https://github.com/linz/basemaps/compare/v3.0.0...v3.1.0) (2020-06-25) **Note:** Version bump only for package @basemaps/test diff --git a/packages/__tests__/package.json b/packages/__tests__/package.json index 0b8471ab14..021cb4c279 100644 --- a/packages/__tests__/package.json +++ b/packages/__tests__/package.json @@ -1,6 +1,6 @@ { "name": "@basemaps/test", - "version": "3.1.0", + "version": "4.0.0", "private": true, "main": "./build/index.js", "types": "./build/index.d.ts", diff --git a/packages/_infra/CHANGELOG.md b/packages/_infra/CHANGELOG.md index 1f08324a20..d3a0b5e474 100644 --- a/packages/_infra/CHANGELOG.md +++ b/packages/_infra/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.0.0](https://github.com/linz/basemaps/compare/v3.6.0...v4.0.0) (2020-07-09) + +**Note:** Version bump only for package @basemaps/infra + + + + + +# [3.6.0](https://github.com/linz/basemaps/compare/v3.5.0...v3.6.0) (2020-07-08) + +**Note:** Version bump only for package @basemaps/infra + + + + + # [3.5.0](https://github.com/linz/basemaps/compare/v3.4.2...v3.5.0) (2020-07-05) **Note:** Version bump only for package @basemaps/infra diff --git a/packages/_infra/package.json b/packages/_infra/package.json index 07cbbe1d70..086cd49d86 100644 --- a/packages/_infra/package.json +++ b/packages/_infra/package.json @@ -1,6 +1,6 @@ { "name": "@basemaps/infra", - "version": "3.5.0", + "version": "4.0.0", "private": true, "repository": "git@github.com:linz/basemaps.git", "author": "", @@ -21,9 +21,9 @@ "@aws-cdk/aws-elasticloadbalancingv2-targets": "1.46.0", "@aws-cdk/aws-s3": "1.46.0", "@aws-cdk/core": "1.46.0", - "@basemaps/lambda-api-tracker": "^3.5.0", - "@basemaps/lambda-xyz": "^3.5.0", - "@basemaps/shared": "^3.5.0", + "@basemaps/lambda-api-tracker": "^4.0.0", + "@basemaps/lambda-xyz": "^4.0.0", + "@basemaps/shared": "^4.0.0", "aws-cdk": "^1.46.0" } } diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 357873aacb..c5e031a077 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -3,6 +3,40 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.0.0](https://github.com/linz/basemaps/compare/v3.6.0...v4.0.0) (2020-07-09) + + +### Bug Fixes + +* **cli:** improve image quality when fully zoomed in ([#884](https://github.com/linz/basemaps/issues/884)) ([7880d92](https://github.com/linz/basemaps/commit/7880d92b3eb8897f592dd87609e0f557b94ef6bb)) + + +### Features + +* improve access to the GDAL cli ([#882](https://github.com/linz/basemaps/issues/882)) ([5eaef38](https://github.com/linz/basemaps/commit/5eaef38ae19ca2b80843112502bdf15df57acab6)) + + +### BREAKING CHANGES + +* this changes how to get access to a new gdal instance to Gdal.create() + +Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> + + + + + +# [3.6.0](https://github.com/linz/basemaps/compare/v3.5.0...v3.6.0) (2020-07-08) + + +### Bug Fixes + +* **cli:** make clipMultipolygon always remove degenerate edges ([#863](https://github.com/linz/basemaps/issues/863)) ([c3c4cdf](https://github.com/linz/basemaps/commit/c3c4cdf8a8bb87e79569b08272ddb0fb2bfe8f01)) + + + + + # [3.5.0](https://github.com/linz/basemaps/compare/v3.4.2...v3.5.0) (2020-07-05) diff --git a/packages/cli/package.json b/packages/cli/package.json index fc7797185f..8e121724eb 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@basemaps/cli", - "version": "3.5.0", + "version": "4.0.0", "private": false, "repository": "git@github.com:linz/basemaps.git", "author": "", @@ -17,8 +17,8 @@ "test": "ospec --globs 'build/**/*.test.js' --preload ../../scripts/test.before.js" }, "dependencies": { - "@basemaps/geo": "^3.5.0", - "@basemaps/shared": "^3.5.0", + "@basemaps/geo": "^4.0.0", + "@basemaps/shared": "^4.0.0", "@cogeotiff/core": "^2.1.1", "@cogeotiff/source-aws": "^2.1.1", "@cogeotiff/source-file": "^2.1.1", diff --git a/packages/cli/src/cli/cogify/action.cog.ts b/packages/cli/src/cli/cogify/action.cog.ts index 0a0b1ad10f..1b1e84c50f 100644 --- a/packages/cli/src/cli/cogify/action.cog.ts +++ b/packages/cli/src/cli/cogify/action.cog.ts @@ -11,7 +11,7 @@ import { buildCogForName } from '../../cog/cog'; import { CogVrt } from '../../cog/cog.vrt'; import { Cutline } from '../../cog/cutline'; import { CogJob } from '../../cog/types'; -import { GdalCogBuilder } from '../../gdal/gdal'; +import { Gdal } from '../../gdal/gdal'; import { CliId, CliInfo } from '../base.cli'; import { getJobPath, makeTempFolder } from '../folder'; import { SemVer } from './semver.util'; @@ -80,7 +80,7 @@ export class ActionCogCreate extends CommandLineAction { const logger = LogConfig.get().child({ correlationId: job.id, imageryName: job.name }); LogConfig.set(logger); - const gdalVersion = await GdalCogBuilder.getVersion(logger); + const gdalVersion = await Gdal.version(logger); logger.info({ version: gdalVersion }, 'GdalVersion'); const name = this.getName(job); diff --git a/packages/cli/src/cog/__test__/cog.test.ts b/packages/cli/src/cog/__test__/cog.test.ts index 5f33ae20b5..454f0d2527 100644 --- a/packages/cli/src/cog/__test__/cog.test.ts +++ b/packages/cli/src/cog/__test__/cog.test.ts @@ -1,7 +1,7 @@ import { Epsg } from '@basemaps/geo'; import { LogConfig } from '@basemaps/shared'; import o from 'ospec'; -import { GdalCogBuilder } from '../../gdal/gdal'; +import { GdalCogBuilder } from '../../gdal/gdal.cog'; import { buildCogForName } from '../cog'; import { SourceTiffTestHelper } from './source.tiff.testhelper'; import { TilingScheme } from '../../gdal/gdal.config'; diff --git a/packages/cli/src/cog/__test__/cog.vrt.test.ts b/packages/cli/src/cog/__test__/cog.vrt.test.ts index 1defbd3cdd..1de566b6e4 100644 --- a/packages/cli/src/cog/__test__/cog.vrt.test.ts +++ b/packages/cli/src/cog/__test__/cog.vrt.test.ts @@ -3,7 +3,7 @@ import { FileOperatorSimple, LogConfig, ProjectionTileMatrixSet } from '@basemap import { qkToName } from '@basemaps/shared/build/proj/__test__/test.util'; import { round } from '@basemaps/test/build/rounding'; import o from 'ospec'; -import { GdalCogBuilder } from '../../gdal/gdal'; +import { Gdal } from '../../gdal/gdal'; import { CogVrt } from '../cog.vrt'; import { Cutline } from '../cutline'; import { SourceTiffTestHelper } from './source.tiff.testhelper'; @@ -29,13 +29,13 @@ o.spec('cog.vrt', () => { let runSpy = o.spy(); const origFileOperatorWriteJson = FileOperatorSimple.writeJson; - const { getGdal } = GdalCogBuilder; + const { create } = Gdal; let gdal: any; o.after(() => { FileOperatorSimple.writeJson = origFileOperatorWriteJson; - GdalCogBuilder.getGdal = getGdal; + Gdal.create = create; }); o.beforeEach(() => { @@ -44,7 +44,7 @@ o.spec('cog.vrt', () => { job.source.projection = EpsgCode.Nztm2000; job.source.resZoom = 13; gdal = { run: runSpy }; - (GdalCogBuilder as any).getGdal = (): any => gdal; + (Gdal as any).create = (): any => gdal; job.source.files = [tif1, tif2]; cutTiffArgs = []; @@ -237,18 +237,7 @@ o.spec('cog.vrt', () => { o(round((runSpy.calls[0] as any).args)).deepEquals([ 'gdalbuildvrt', - [ - '-hidenodata', - '-allow_projection_difference', - '-tr', - '19.10925707', - '19.10925707', - '-tap', - '-addalpha', - '/tmp/my-tmp-folder/source.vrt', - vtif1, - vtif2, - ], + ['-hidenodata', '-allow_projection_difference', '-addalpha', '/tmp/my-tmp-folder/source.vrt', vtif1, vtif2], logger, ]); diff --git a/packages/cli/src/cog/builder.ts b/packages/cli/src/cog/builder.ts index fbccf0e1a9..512172f02a 100644 --- a/packages/cli/src/cog/builder.ts +++ b/packages/cli/src/cog/builder.ts @@ -120,7 +120,7 @@ export class CogBuilder { return output; }).catch((e) => { - throw new CompositeError('Failed to read image:' + source, e); + throw new CompositeError('Failed to process image: ' + source.name, e); }); }); diff --git a/packages/cli/src/cog/cog.ts b/packages/cli/src/cog/cog.ts index fc2a336ddf..5593e3d64e 100644 --- a/packages/cli/src/cog/cog.ts +++ b/packages/cli/src/cog/cog.ts @@ -1,6 +1,6 @@ import { EpsgCode, TileMatrixSet } from '@basemaps/geo'; import { Aws, isConfigS3Role, LogType, ProjectionTileMatrixSet } from '@basemaps/shared'; -import { GdalCogBuilder } from '../gdal/gdal'; +import { GdalCogBuilder } from '../gdal/gdal.cog'; import { GdalCommand } from '../gdal/gdal.command'; import { TilingScheme } from '../gdal/gdal.config'; import { GdalProgressParser } from '../gdal/gdal.progress'; diff --git a/packages/cli/src/cog/cog.vrt.ts b/packages/cli/src/cog/cog.vrt.ts index 2a35c19ea0..859141ca3e 100644 --- a/packages/cli/src/cog/cog.vrt.ts +++ b/packages/cli/src/cog/cog.vrt.ts @@ -1,6 +1,6 @@ import { Epsg } from '@basemaps/geo'; import { Aws, FileOperator, isConfigS3Role, LogType } from '@basemaps/shared'; -import { GdalCogBuilder } from '../gdal/gdal'; +import { Gdal } from '../gdal/gdal'; import { GdalCommand } from '../gdal/gdal.command'; import { onProgress } from './cog'; import { Cutline } from './cutline'; @@ -14,10 +14,9 @@ async function buildPlainVrt( sourceFiles: string[], vrtPath: string, gdalCommand: GdalCommand, - defaultOps: string[], logger: LogType, ): Promise { - const buildOpts = ['-hidenodata', '-allow_projection_difference'].concat(defaultOps); + const buildOpts = ['-hidenodata', '-allow_projection_difference']; if (job.output.vrt.addAlpha) { buildOpts.push('-addalpha'); } @@ -46,7 +45,7 @@ async function buildWarpVrt( sourceVrtPath: string, gdalCommand: GdalCommand, cogVrtPath: string, - defaultOps: string[], + tr: string, logger: LogType, cutlineTarget: string, ): Promise { @@ -60,7 +59,11 @@ async function buildWarpVrt( Epsg.get(job.source.projection).toEpsgString(), '-t_srs', Epsg.get(job.projection).toEpsgString(), - ].concat(defaultOps); + '-tr', + tr, + tr, + '-tap', + ]; if (job.output.cutline != null) { warpOpts.push('-cutline', cutlineTarget); if (job.output.cutline.blend != 0) warpOpts.push('-cblend', String(job.output.cutline.blend)); @@ -124,18 +127,16 @@ export const CogVrt = { 'Tiff count', ); - const gdalCommand = GdalCogBuilder.getGdal(); + const gdalCommand = Gdal.create(); if (gdalCommand.mount) { gdalCommand.mount(tmpFolder); } const tr = cutline.tms.pixelScale(job.source.resZoom).toString(); - const defaultOps = ['-tr', tr, tr, '-tap']; - onProgress(gdalCommand, { target: `vrt.${job.projection}` }, logger); - await buildPlainVrt(job, sourceFiles, sourceVrtPath, gdalCommand, defaultOps, logger); - await buildWarpVrt(job, cogVrtPath, gdalCommand, sourceVrtPath, defaultOps, logger, cutlineTarget); + await buildPlainVrt(job, sourceFiles, sourceVrtPath, gdalCommand, logger); + await buildWarpVrt(job, cogVrtPath, gdalCommand, sourceVrtPath, tr, logger, cutlineTarget); return cogVrtPath; }, }; diff --git a/packages/cli/src/cog/job.ts b/packages/cli/src/cog/job.ts index 7d450ca4c8..286132fa18 100644 --- a/packages/cli/src/cog/job.ts +++ b/packages/cli/src/cog/job.ts @@ -7,20 +7,21 @@ import { LogConfig, ProjectionTileMatrixSet, } from '@basemaps/shared'; +import { Projection } from '@basemaps/shared/build/proj/projection'; import { CogSource } from '@cogeotiff/core'; import { CogSourceAwsS3 } from '@cogeotiff/source-aws'; import { CogSourceFile } from '@cogeotiff/source-file'; import { promises as fs } from 'fs'; import { basename } from 'path'; import * as ulid from 'ulid'; -import { CogBuilder, GdalCogBuilder } from '..'; +import { CogBuilder } from '..'; import { CliInfo } from '../cli/base.cli'; import { ActionBatchJob } from '../cli/cogify/action.batch'; import { getJobPath, makeTempFolder } from '../cli/folder'; +import { Gdal } from '../gdal/gdal'; import { GdalCogBuilderDefaults, GdalCogBuilderOptionsResampling } from '../gdal/gdal.config'; import { Cutline } from './cutline'; import { CogJob } from './types'; -import { Projection } from '@basemaps/shared/build/proj/projection'; export const MaxConcurrencyDefault = 50; @@ -91,7 +92,7 @@ export const CogJobFactory = { const imageryName = basename(ctx.source.path).replace(/\./g, '-'); // batch does not allow '.' in names const logger = LogConfig.get().child({ id, imageryName }); - const gdalVersion = await GdalCogBuilder.getVersion(logger); + const gdalVersion = await Gdal.version(logger); logger.info({ version: gdalVersion }, 'GdalVersion'); const { source, output } = ctx; diff --git a/packages/cli/src/gdal/__test__/gdal.test.ts b/packages/cli/src/gdal/__test__/gdal.test.ts index a358ab3157..93681787a5 100644 --- a/packages/cli/src/gdal/__test__/gdal.test.ts +++ b/packages/cli/src/gdal/__test__/gdal.test.ts @@ -1,5 +1,5 @@ import o from 'ospec'; -import { GdalCogBuilder } from '../gdal'; +import { GdalCogBuilder } from '../gdal.cog'; import { normalizeAwsEnv } from '../gdal.command'; import { GdalCogBuilderDefaults } from '../gdal.config'; diff --git a/packages/cli/src/gdal/gdal.cog.ts b/packages/cli/src/gdal/gdal.cog.ts new file mode 100644 index 0000000000..f3bf126be9 --- /dev/null +++ b/packages/cli/src/gdal/gdal.cog.ts @@ -0,0 +1,125 @@ +import { LogType } from '@basemaps/shared'; +import { ChildProcessWithoutNullStreams } from 'child_process'; +import { Gdal } from './gdal'; +import { GdalCommand } from './gdal.command'; +import { GdalCogBuilderDefaults, GdalCogBuilderOptions } from './gdal.config'; + +/** 1% Buffer to the tiff to help prevent gaps between tiles */ +// const TiffBuffer = 1.01; + +/** + * A docker based GDAL Cog Builder + * + * This uses the new 3.1 COG Driver https://gdal.org/drivers/raster/cog.html + * + * When GDAL 3.1 is released docker could be removed from this process. + */ +export class GdalCogBuilder { + config: GdalCogBuilderOptions; + + /** + * Source file generally a .vrt + */ + source: string; + /** + * Output file + */ + target: string; + + /** + * Current running child process + */ + child: ChildProcessWithoutNullStreams | null; + /** + * Promise waiting for child process to finish + */ + promise: Promise | null; + /** When the process started */ + startTime: number; + /** Gdal process */ + gdal: GdalCommand; + + constructor(source: string, target: string, config: Partial = {}) { + this.source = source; + this.target = target; + + this.config = { + bbox: config.bbox, + projection: config.projection ?? GdalCogBuilderDefaults.projection, + alignmentLevels: config.alignmentLevels ?? GdalCogBuilderDefaults.alignmentLevels, + compression: config.compression ?? GdalCogBuilderDefaults.compression, + tilingScheme: config.tilingScheme ?? GdalCogBuilderDefaults.tilingScheme, + resampling: config.resampling ?? GdalCogBuilderDefaults.resampling, + blockSize: config.blockSize ?? GdalCogBuilderDefaults.blockSize, + targetRes: config.targetRes ?? GdalCogBuilderDefaults.targetRes, + quality: config.quality ?? GdalCogBuilderDefaults.quality, + }; + this.gdal = Gdal.create(); + + this.gdal.mount?.(source); + this.gdal.mount?.(target); + } + + getBounds(): string[] { + if (this.config.bbox == null) { + return []; + } + + // TODO in theory this should be clamped to the lower right of the imagery, as there is no point generating large empty tiffs + const [ulX, ulY, lrX, lrY] = this.config.bbox; + return ['-projwin', ulX, ulY, lrX, lrY, '-projwin_srs', this.config.projection.toEpsgString()].map(String); + } + + get args(): string[] { + const tr = this.config.targetRes.toString(); + return [ + // Force output using COG Driver + '-of', + 'COG', + // Force GoogleMaps tiling + '-co', + `TILING_SCHEME=${this.config.tilingScheme}`, + // Max CPU POWER + '-co', + 'NUM_THREADS=ALL_CPUS', + // Force big tiff the extra few bytes savings of using little tiffs does not affect us + '-co', + 'BIGTIFF=YES', + // Force a alpha layer + '-co', + 'ADD_ALPHA=YES', + // User configured output block size + '-co', + `BLOCKSIZE=${this.config.blockSize}`, + // Configured resampling methods + '-co', + `WARP_RESAMPLING=${this.config.resampling.warp}`, + '-co', + `OVERVIEW_RESAMPLING=${this.config.resampling.overview}`, + // User configured compression + '-co', + `COMPRESS=${this.config.compression}`, + // Number of levels to align to web mercator + '-co', + `ALIGNED_LEVELS=${this.config.alignmentLevels}`, + // Default quality of 75 is too low for our needs + '-co', + `QUALITY=${this.config.quality}`, + // most of the imagery contains a lot of empty tiles, no need to output them + '-co', + `SPARSE_OK=YES`, + // Force a target resolution to be better than the imagery not worse + '-tr', + tr, + tr, + ...this.getBounds(), + + this.source, + this.target, + ]; + } + + async convert(log: LogType): Promise { + await this.gdal.run('gdal_translate', this.args, log); + } +} diff --git a/packages/cli/src/gdal/gdal.command.ts b/packages/cli/src/gdal/gdal.command.ts index eb1c47499c..63cf1775a5 100644 --- a/packages/cli/src/gdal/gdal.command.ts +++ b/packages/cli/src/gdal/gdal.command.ts @@ -29,8 +29,6 @@ export abstract class GdalCommand { protected child: ChildProcessWithoutNullStreams; protected promise?: Promise<{ stdout: string; stderr: string }>; protected startTime: number; - /** Should log all of stdout/stderr */ - verbose = true; /** AWS Access */ protected credentials?: AWS.Credentials; @@ -43,10 +41,14 @@ export abstract class GdalCommand { this.credentials = credentials; } + /** + * Run a GDAL command + * @param cmd command to run eg "gdal_translate" + * @param args command arguments + * @param log logger to use + */ async run(cmd: string, args: string[], log: LogType): Promise<{ stdout: string; stderr: string }> { - if (this.promise != null) { - return this.promise; - } + if (this.promise != null) throw new Error('Cannot create multiple gdal processes, create a new GdalCommand'); this.parser?.reset(); this.startTime = Date.now(); @@ -70,6 +72,7 @@ export abstract class GdalCommand { } errBuff.push(data); }); + child.stdout.on('data', (data: Buffer) => { outputBuff.push(data); this.parser?.data(data); @@ -79,20 +82,24 @@ export abstract class GdalCommand { child.on('exit', (code: number) => { const stdout = outputBuff.join('').trim(); const stderr = errBuff.join('').trim(); + const duration = Date.now() - this.startTime; if (code != 0) { - log.error({ code, stdout, stderr }, 'GdalFailed'); + log.error({ code, stdout, stderr, duration }, 'GdalFailed'); return reject(new Error('Failed to execute GDAL command')); } - if (this.verbose) log.warn({ stdout, stderr }, 'GdalOutput'); + log.trace({ stdout, stderr, duration }, 'GdalDone'); this.promise = undefined; return resolve({ stdout, stderr }); }); + child.on('error', (error: Error) => { const stdout = outputBuff.join('').trim(); const stderr = errBuff.join('').trim(); - log.error({ stdout, stderr }, 'GdalFailed'); + const duration = Date.now() - this.startTime; + + log.error({ stdout, stderr, duration }, 'GdalFailed'); this.promise = undefined; reject(error); }); diff --git a/packages/cli/src/gdal/gdal.docker.ts b/packages/cli/src/gdal/gdal.docker.ts index 2bf61f946e..25b00046cc 100644 --- a/packages/cli/src/gdal/gdal.docker.ts +++ b/packages/cli/src/gdal/gdal.docker.ts @@ -74,20 +74,24 @@ export class GdalDocker extends GdalCommand { } /** Provide redacted argument string for logging which removes sensitive information */ - maskArgs(args: string[]): string { - const argsStr = args.join(' '); - if (this.credentials) { - return argsStr - .replace(this.credentials.secretAccessKey, '****') - .replace(this.credentials.sessionToken, '****'); - } - return argsStr; + maskArgs(args: string[]): string[] { + const cred = this.credentials; + if (cred == null) return args; + + return args.map((c) => c.replace(cred.secretAccessKey, '****').replace(cred.sessionToken, '****')); } async run(cmd: string, args: string[], log: LogType): Promise<{ stdout: string; stderr: string }> { const dockerArgs = await this.getDockerArgs(); - log.info({ mounts: this.mounts, docker: this.maskArgs(dockerArgs) }, 'SpawnDocker'); - + log.debug( + { + mounts: this.mounts, + cmd, + docker: this.maskArgs(dockerArgs).join(' '), + gdalArgs: args.slice(0, 50).join(' '), + }, + 'StartGdal:Docker', + ); return super.run('docker', [...dockerArgs, cmd, ...args], log); } } diff --git a/packages/cli/src/gdal/gdal.local.ts b/packages/cli/src/gdal/gdal.local.ts index 99e0421bf7..cd3caa7112 100644 --- a/packages/cli/src/gdal/gdal.local.ts +++ b/packages/cli/src/gdal/gdal.local.ts @@ -1,4 +1,5 @@ import { GdalCommand } from './gdal.command'; +import { LogType } from '@basemaps/shared'; export class GdalLocal extends GdalCommand { async env(): Promise> { @@ -15,4 +16,9 @@ export class GdalLocal extends GdalCommand { AWS_SESSION_TOKEN: this.credentials.sessionToken, }; } + + async run(cmd: string, args: string[], log: LogType): Promise<{ stdout: string; stderr: string }> { + log.debug({ cmd, gdalArgs: args.slice(0, 50).join(' ') }, 'StartGdal:Local'); + return super.run(cmd, args, log); + } } diff --git a/packages/cli/src/gdal/gdal.ts b/packages/cli/src/gdal/gdal.ts index fb02c69453..cdec5cbd12 100644 --- a/packages/cli/src/gdal/gdal.ts +++ b/packages/cli/src/gdal/gdal.ts @@ -1,140 +1,31 @@ -import { Env, LogType } from '@basemaps/shared'; -import { ChildProcessWithoutNullStreams } from 'child_process'; import { GdalCommand } from './gdal.command'; -import { GdalCogBuilderDefaults, GdalCogBuilderOptions } from './gdal.config'; +import { Env, LogType } from '@basemaps/shared'; import { GdalDocker } from './gdal.docker'; import { GdalLocal } from './gdal.local'; -/** 1% Buffer to the tiff to help prevent gaps between tiles */ -// const TiffBuffer = 1.01; - -/** - * A docker based GDAL Cog Builder - * - * This uses the new 3.1 COG Driver https://gdal.org/drivers/raster/cog.html - * - * When GDAL 3.1 is released docker could be removed from this process. - */ -export class GdalCogBuilder { - config: GdalCogBuilderOptions; - - /** - * Source file generally a .vrt - */ - source: string; - /** - * Output file - */ - target: string; - - /** - * Current running child process - */ - child: ChildProcessWithoutNullStreams | null; +export class Gdal { /** - * Promise waiting for child process to finish + * Create a new GdalCommand instance ready to run commands + * + * This could be a local or docker container depending on environment variables + * @see Env.Gdal.UseDocker */ - promise: Promise | null; - /** When the process started */ - startTime: number; - /** Gdal process */ - gdal: GdalCommand; - - static getGdal(): GdalCommand { + static create(): GdalCommand { if (Env.get(Env.Gdal.UseDocker, undefined)) { return new GdalDocker(); } return new GdalLocal(); } - static async getVersion(logger: LogType): Promise { - const gdal = GdalCogBuilder.getGdal(); - gdal.verbose = false; + /** + * Run a `gdal_translate --version` to extract the current gdal version + * + * @example "GDAL 2.4.2, released 2019/06/28" + * @example "GDAL 3.2.0dev-69b0c4ec4174fde36c609a4aac6f4281424021b3, released 2020/06/26" + */ + static async version(logger: LogType): Promise { + const gdal = Gdal.create(); const { stdout } = await gdal.run('gdal_translate', ['--version'], logger); return stdout; } - - constructor(source: string, target: string, config: Partial = {}) { - this.source = source; - this.target = target; - - this.config = { - bbox: config.bbox, - projection: config.projection ?? GdalCogBuilderDefaults.projection, - alignmentLevels: config.alignmentLevels ?? GdalCogBuilderDefaults.alignmentLevels, - compression: config.compression ?? GdalCogBuilderDefaults.compression, - tilingScheme: config.tilingScheme ?? GdalCogBuilderDefaults.tilingScheme, - resampling: config.resampling ?? GdalCogBuilderDefaults.resampling, - blockSize: config.blockSize ?? GdalCogBuilderDefaults.blockSize, - targetRes: config.targetRes ?? GdalCogBuilderDefaults.targetRes, - quality: config.quality ?? GdalCogBuilderDefaults.quality, - }; - this.gdal = GdalCogBuilder.getGdal(); - - this.gdal.mount?.(source); - this.gdal.mount?.(target); - } - - getBounds(): string[] { - if (this.config.bbox == null) { - return []; - } - - // TODO in theory this should be clamped to the lower right of the imagery, as there is no point generating large empty tiffs - const [ulX, ulY, lrX, lrY] = this.config.bbox; - return ['-projwin', ulX, ulY, lrX, lrY, '-projwin_srs', this.config.projection.toEpsgString()].map(String); - } - - get args(): string[] { - const tr = this.config.targetRes.toString(); - return [ - // Force output using COG Driver - '-of', - 'COG', - // Force GoogleMaps tiling - '-co', - `TILING_SCHEME=${this.config.tilingScheme}`, - // Max CPU POWER - '-co', - 'NUM_THREADS=ALL_CPUS', - // Force big tiff the extra few bytes savings of using little tiffs does not affect us - '-co', - 'BIGTIFF=YES', - // Force a alpha layer - '-co', - 'ADD_ALPHA=YES', - // User configured output block size - '-co', - `BLOCKSIZE=${this.config.blockSize}`, - // Configured resampling methods - '-co', - `WARP_RESAMPLING=${this.config.resampling.warp}`, - '-co', - `OVERVIEW_RESAMPLING=${this.config.resampling.overview}`, - // User configured compression - '-co', - `COMPRESS=${this.config.compression}`, - // Number of levels to align to web mercator - '-co', - `ALIGNED_LEVELS=${this.config.alignmentLevels}`, - // Default quality of 75 is too low for our needs - '-co', - `QUALITY=${this.config.quality}`, - // most of the imagery contains a lot of empty tiles, no need to output them - '-co', - `SPARSE_OK=YES`, - // Force a target resolution to be better than the imagery not worse - '-tr', - tr, - tr, - ...this.getBounds(), - - this.source, - this.target, - ]; - } - - async convert(log: LogType): Promise { - await this.gdal.run('gdal_translate', this.args, log); - } } diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index c393b72166..2f0eacb46b 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -1,4 +1,5 @@ export { CogBuilder } from './cog/builder'; -export { GdalCogBuilder } from './gdal/gdal'; +export { GdalCogBuilder } from './gdal/gdal.cog'; export { GdalCogBuilderOptions } from './gdal/gdal.config'; export { CogJobFactory } from './cog/job'; +export { Gdal } from './gdal/gdal'; diff --git a/packages/geo/CHANGELOG.md b/packages/geo/CHANGELOG.md index 74a8de5fe6..f543a9a009 100644 --- a/packages/geo/CHANGELOG.md +++ b/packages/geo/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.0.0](https://github.com/linz/basemaps/compare/v3.6.0...v4.0.0) (2020-07-09) + +**Note:** Version bump only for package @basemaps/geo + + + + + # [3.5.0](https://github.com/linz/basemaps/compare/v3.4.2...v3.5.0) (2020-07-05) diff --git a/packages/geo/package.json b/packages/geo/package.json index d30c40d753..9fdeb209f7 100644 --- a/packages/geo/package.json +++ b/packages/geo/package.json @@ -1,6 +1,6 @@ { "name": "@basemaps/geo", - "version": "3.5.0", + "version": "4.0.0", "repository": "git@github.com:linz/basemaps.git", "author": "", "license": "MIT", diff --git a/packages/lambda-api-tracker/CHANGELOG.md b/packages/lambda-api-tracker/CHANGELOG.md index d91c01f4c5..718002d7bd 100644 --- a/packages/lambda-api-tracker/CHANGELOG.md +++ b/packages/lambda-api-tracker/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.0.0](https://github.com/linz/basemaps/compare/v3.6.0...v4.0.0) (2020-07-09) + +**Note:** Version bump only for package @basemaps/lambda-api-tracker + + + + + +# [3.6.0](https://github.com/linz/basemaps/compare/v3.5.0...v3.6.0) (2020-07-08) + +**Note:** Version bump only for package @basemaps/lambda-api-tracker + + + + + # [3.5.0](https://github.com/linz/basemaps/compare/v3.4.2...v3.5.0) (2020-07-05) **Note:** Version bump only for package @basemaps/lambda-api-tracker diff --git a/packages/lambda-api-tracker/package.json b/packages/lambda-api-tracker/package.json index aa48641b1d..f0dd2557db 100644 --- a/packages/lambda-api-tracker/package.json +++ b/packages/lambda-api-tracker/package.json @@ -1,14 +1,14 @@ { "name": "@basemaps/lambda-api-tracker", - "version": "3.5.0", + "version": "4.0.0", "private": true, "repository": "git@github.com:linz/basemaps.git", "author": "", "license": "MIT", "dependencies": { - "@basemaps/geo": "^3.5.0", - "@basemaps/lambda": "^3.1.0", - "@basemaps/shared": "^3.5.0" + "@basemaps/geo": "^4.0.0", + "@basemaps/lambda": "^4.0.0", + "@basemaps/shared": "^4.0.0" }, "scripts": { "test": "ospec --globs 'build/**/*.test.js' --preload ../../scripts/test.before.js", diff --git a/packages/lambda-xyz/CHANGELOG.md b/packages/lambda-xyz/CHANGELOG.md index 1bbc8e73ca..fa4d3b4f90 100644 --- a/packages/lambda-xyz/CHANGELOG.md +++ b/packages/lambda-xyz/CHANGELOG.md @@ -3,6 +3,25 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.0.0](https://github.com/linz/basemaps/compare/v3.6.0...v4.0.0) (2020-07-09) + +**Note:** Version bump only for package @basemaps/lambda-xyz + + + + + +# [3.6.0](https://github.com/linz/basemaps/compare/v3.5.0...v3.6.0) (2020-07-08) + + +### Bug Fixes + +* **wmts:** add identifier ([#877](https://github.com/linz/basemaps/issues/877)) ([d2d9f56](https://github.com/linz/basemaps/commit/d2d9f56eb348e1131fa951a59e799cc333fb8a31)) + + + + + # [3.5.0](https://github.com/linz/basemaps/compare/v3.4.2...v3.5.0) (2020-07-05) **Note:** Version bump only for package @basemaps/lambda-xyz diff --git a/packages/lambda-xyz/package.json b/packages/lambda-xyz/package.json index ba1bd33f1a..c39362aa01 100644 --- a/packages/lambda-xyz/package.json +++ b/packages/lambda-xyz/package.json @@ -1,16 +1,16 @@ { "name": "@basemaps/lambda-xyz", - "version": "3.5.0", + "version": "4.0.0", "private": true, "repository": "git@github.com:linz/basemaps.git", "author": "", "license": "MIT", "dependencies": { - "@basemaps/geo": "^3.5.0", - "@basemaps/lambda": "^3.1.0", - "@basemaps/shared": "^3.5.0", - "@basemaps/tiler": "^3.5.0", - "@basemaps/tiler-sharp": "^3.5.0", + "@basemaps/geo": "^4.0.0", + "@basemaps/lambda": "^4.0.0", + "@basemaps/shared": "^4.0.0", + "@basemaps/tiler": "^4.0.0", + "@basemaps/tiler-sharp": "^4.0.0", "@cogeotiff/core": "^2.1.1", "@cogeotiff/source-aws": "^2.1.1", "path-to-regexp": "^6.1.0", diff --git a/packages/lambda/CHANGELOG.md b/packages/lambda/CHANGELOG.md index 456f2464ca..7158852b05 100644 --- a/packages/lambda/CHANGELOG.md +++ b/packages/lambda/CHANGELOG.md @@ -3,6 +3,25 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.0.0](https://github.com/linz/basemaps/compare/v3.6.0...v4.0.0) (2020-07-09) + +**Note:** Version bump only for package @basemaps/lambda + + + + + +# [3.6.0](https://github.com/linz/basemaps/compare/v3.5.0...v3.6.0) (2020-07-08) + + +### Bug Fixes + +* **lambda:** Set Cors header on GET requests ([#865](https://github.com/linz/basemaps/issues/865)) ([c3e3c4c](https://github.com/linz/basemaps/commit/c3e3c4c331458a2d3ea5570a84e2ae961c19fd7f)) + + + + + # [3.1.0](https://github.com/linz/basemaps/compare/v3.0.0...v3.1.0) (2020-06-25) **Note:** Version bump only for package @basemaps/lambda diff --git a/packages/lambda/package.json b/packages/lambda/package.json index 56f923152c..e7c2b10a60 100644 --- a/packages/lambda/package.json +++ b/packages/lambda/package.json @@ -1,6 +1,6 @@ { "name": "@basemaps/lambda", - "version": "3.1.0", + "version": "4.0.0", "private": false, "repository": "git@github.com:linz/basemaps.git", "author": "", @@ -11,7 +11,7 @@ "test": "ospec --globs 'build/**/*.test.js' --preload ../../scripts/test.before.js" }, "dependencies": { - "@basemaps/metrics": "^3.1.0", + "@basemaps/metrics": "^4.0.0", "source-map-support": "^0.5.19", "ulid": "^2.3.0" }, diff --git a/packages/landing/CHANGELOG.md b/packages/landing/CHANGELOG.md index 7010831a76..ab071bccb6 100644 --- a/packages/landing/CHANGELOG.md +++ b/packages/landing/CHANGELOG.md @@ -3,6 +3,29 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.0.0](https://github.com/linz/basemaps/compare/v3.6.0...v4.0.0) (2020-07-09) + + +### Bug Fixes + +* **landing:** Fix typos in side menu ([#883](https://github.com/linz/basemaps/issues/883)) ([b380757](https://github.com/linz/basemaps/commit/b380757fb306d9cfd987a7f3255ebd37fbe23d39)) + + + + + +# [3.6.0](https://github.com/linz/basemaps/compare/v3.5.0...v3.6.0) (2020-07-08) + + +### Features + +* **landing:** Add content to contact us mailto: link ([#879](https://github.com/linz/basemaps/issues/879)) ([579ac92](https://github.com/linz/basemaps/commit/579ac92e2f39c70a8d67c2d01613f91e7b194774)) +* **landing:** limit nztm to its extent ([#878](https://github.com/linz/basemaps/issues/878)) ([7470679](https://github.com/linz/basemaps/commit/747067955b0d52343498c81c2c20b29516046a75)) + + + + + # [3.5.0](https://github.com/linz/basemaps/compare/v3.4.2...v3.5.0) (2020-07-05) diff --git a/packages/landing/package.json b/packages/landing/package.json index d2efcbe6ec..4db7a979bb 100644 --- a/packages/landing/package.json +++ b/packages/landing/package.json @@ -1,6 +1,6 @@ { "name": "@basemaps/landing", - "version": "3.5.0", + "version": "4.0.0", "private": true, "repository": "git@github.com:linz/basemaps.git", "author": "", @@ -14,8 +14,8 @@ "deploy:deploy": "yarn deploy:bundle && node scripts/deploy.js" }, "dependencies": { - "@basemaps/geo": "^3.5.0", - "@basemaps/infra": "^3.5.0", + "@basemaps/geo": "^4.0.0", + "@basemaps/infra": "^4.0.0", "@philals/lui": "^0.0.76", "@types/ol": "^6.3.1", "ol": "^6.3.1", diff --git a/packages/landing/src/ui.ts b/packages/landing/src/ui.ts index b1424ebd39..b800f9cf04 100644 --- a/packages/landing/src/ui.ts +++ b/packages/landing/src/ui.ts @@ -23,6 +23,7 @@ export class BasemapsUi { this.bindProjectionButtons(); this.bindApiLinks(); this.bindMenuButton(); + this.bindContactUsButton(); this.setCurrentProjection(this.basemaps.config.projection); } @@ -43,6 +44,30 @@ export class BasemapsUi { this.sideNav = sideNav; } + bindContactUsButton(): void { + const button = document.getElementById('contact-us'); + if (button == null) { + throw new Error('Unable to find contact-us button'); + } + + button.onclick = (): void => { + const subject = 'Request Basemaps Developer Access'; + const body = ` +Give us a few key details to sign up for Developer Access to LINZ Basemaps. We will respond with your Apps' unique API key. + +Your Name: + +Your Email: + +Your Service/App URL: + +`; + gaEvent(GaEvent.Ui, 'contact-us:click', 1); + + location.href = `mailto:basemaps@linz.govt.nz?subject=${encodeURI(subject)}&body=${encodeURI(body)}`; + }; + } + menuOnClick = (): void => { if (this.sideNav.classList.contains('side-nav--opened')) { gaEvent(GaEvent.Ui, 'menu:close', 1); diff --git a/packages/landing/static/index.html b/packages/landing/static/index.html index 8b10b349d1..d41661a16a 100644 --- a/packages/landing/static/index.html +++ b/packages/landing/static/index.html @@ -156,13 +156,12 @@
Get an API Key
Developer Access

Contact us for free API keys with better support for public web and mobile apps.

- + -
About basemaps
+
About Basemaps