@basemaps/landing 6.45.0 → 7.0.0

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.
Files changed (96) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +0 -2
  3. package/build/components/layer.switcher.dropdown.d.ts.map +1 -1
  4. package/build/components/layer.switcher.dropdown.js +19 -18
  5. package/build/components/layer.switcher.dropdown.js.map +1 -1
  6. package/build/components/map.switcher.d.ts.map +1 -1
  7. package/build/components/map.switcher.js +3 -1
  8. package/build/components/map.switcher.js.map +1 -1
  9. package/build/config.map.d.ts +2 -2
  10. package/build/config.map.d.ts.map +1 -1
  11. package/build/config.map.js +34 -12
  12. package/build/config.map.js.map +1 -1
  13. package/dist/docs/404.html +824 -0
  14. package/dist/docs/assets/images/favicon.png +0 -0
  15. package/dist/docs/assets/javascripts/bundle.cd18aaf1.min.js +29 -0
  16. package/dist/docs/assets/javascripts/bundle.cd18aaf1.min.js.map +7 -0
  17. package/dist/docs/assets/javascripts/lunr/min/lunr.ar.min.js +1 -0
  18. package/dist/docs/assets/javascripts/lunr/min/lunr.da.min.js +18 -0
  19. package/dist/docs/assets/javascripts/lunr/min/lunr.de.min.js +18 -0
  20. package/dist/docs/assets/javascripts/lunr/min/lunr.du.min.js +18 -0
  21. package/dist/docs/assets/javascripts/lunr/min/lunr.el.min.js +1 -0
  22. package/dist/docs/assets/javascripts/lunr/min/lunr.es.min.js +18 -0
  23. package/dist/docs/assets/javascripts/lunr/min/lunr.fi.min.js +18 -0
  24. package/dist/docs/assets/javascripts/lunr/min/lunr.fr.min.js +18 -0
  25. package/dist/docs/assets/javascripts/lunr/min/lunr.he.min.js +1 -0
  26. package/dist/docs/assets/javascripts/lunr/min/lunr.hi.min.js +1 -0
  27. package/dist/docs/assets/javascripts/lunr/min/lunr.hu.min.js +18 -0
  28. package/dist/docs/assets/javascripts/lunr/min/lunr.hy.min.js +1 -0
  29. package/dist/docs/assets/javascripts/lunr/min/lunr.it.min.js +18 -0
  30. package/dist/docs/assets/javascripts/lunr/min/lunr.ja.min.js +1 -0
  31. package/dist/docs/assets/javascripts/lunr/min/lunr.jp.min.js +1 -0
  32. package/dist/docs/assets/javascripts/lunr/min/lunr.kn.min.js +1 -0
  33. package/dist/docs/assets/javascripts/lunr/min/lunr.ko.min.js +1 -0
  34. package/dist/docs/assets/javascripts/lunr/min/lunr.multi.min.js +1 -0
  35. package/dist/docs/assets/javascripts/lunr/min/lunr.nl.min.js +18 -0
  36. package/dist/docs/assets/javascripts/lunr/min/lunr.no.min.js +18 -0
  37. package/dist/docs/assets/javascripts/lunr/min/lunr.pt.min.js +18 -0
  38. package/dist/docs/assets/javascripts/lunr/min/lunr.ro.min.js +18 -0
  39. package/dist/docs/assets/javascripts/lunr/min/lunr.ru.min.js +18 -0
  40. package/dist/docs/assets/javascripts/lunr/min/lunr.sa.min.js +1 -0
  41. package/dist/docs/assets/javascripts/lunr/min/lunr.stemmer.support.min.js +1 -0
  42. package/dist/docs/assets/javascripts/lunr/min/lunr.sv.min.js +18 -0
  43. package/dist/docs/assets/javascripts/lunr/min/lunr.ta.min.js +1 -0
  44. package/dist/docs/assets/javascripts/lunr/min/lunr.te.min.js +1 -0
  45. package/dist/docs/assets/javascripts/lunr/min/lunr.th.min.js +1 -0
  46. package/dist/docs/assets/javascripts/lunr/min/lunr.tr.min.js +18 -0
  47. package/dist/docs/assets/javascripts/lunr/min/lunr.vi.min.js +1 -0
  48. package/dist/docs/assets/javascripts/lunr/min/lunr.zh.min.js +1 -0
  49. package/dist/docs/assets/javascripts/lunr/tinyseg.js +206 -0
  50. package/dist/docs/assets/javascripts/lunr/wordcut.js +6708 -0
  51. package/dist/docs/assets/javascripts/workers/search.f886a092.min.js +42 -0
  52. package/dist/docs/assets/javascripts/workers/search.f886a092.min.js.map +7 -0
  53. package/dist/docs/assets/stylesheets/main.fad675c6.min.css +1 -0
  54. package/dist/docs/assets/stylesheets/main.fad675c6.min.css.map +1 -0
  55. package/dist/docs/assets/stylesheets/palette.356b1318.min.css +1 -0
  56. package/dist/docs/assets/stylesheets/palette.356b1318.min.css.map +1 -0
  57. package/dist/docs/configuration/index.html +981 -0
  58. package/dist/docs/deployment/index.html +932 -0
  59. package/dist/docs/developer-guide/index.html +884 -0
  60. package/dist/docs/examples/_overview/index.html +870 -0
  61. package/dist/docs/examples/index.leaflet.xyz.3857.html +38 -0
  62. package/dist/docs/examples/index.maplibre.opacity.3857.html +215 -0
  63. package/dist/docs/examples/index.maplibre.vector.3857.html +45 -0
  64. package/dist/docs/examples/leaflet.xyz.3857/index.html +904 -0
  65. package/dist/docs/examples/maplibre.opacity.3857/index.html +1081 -0
  66. package/dist/docs/examples/maplibre.vector.3857/index.html +911 -0
  67. package/dist/docs/index.css +3 -0
  68. package/dist/docs/index.html +1141 -0
  69. package/dist/docs/linz-motif.svg +124 -0
  70. package/dist/docs/operator-guide/cog-quality/index.html +1121 -0
  71. package/dist/docs/operator-guide/empty-tiles/index.html +990 -0
  72. package/dist/docs/operator-guide/index.html +859 -0
  73. package/dist/docs/operator-guide/quick-start/index.html +1104 -0
  74. package/dist/docs/operator-guide/relief-shade/index.html +971 -0
  75. package/dist/docs/operator-guide/static/2023-06-26-gisborne-2023.png +0 -0
  76. package/dist/docs/operator-guide/static/quality__005_006_0_bilinear.webp +0 -0
  77. package/dist/docs/operator-guide/static/quality__005_006_0_lanczos.webp +0 -0
  78. package/dist/docs/operator-guide/static/quality__i6.bilinear.webp +0 -0
  79. package/dist/docs/operator-guide/static/quality__i6.cubic.webp +0 -0
  80. package/dist/docs/operator-guide/static/quality__i6.lanczos.webp +0 -0
  81. package/dist/docs/operator-guide/static/quality__resampling-overview.webp +0 -0
  82. package/dist/docs/operator-guide/static/quick-start__layers.png +0 -0
  83. package/dist/docs/operator-guide/static/relief__aerial.webp +0 -0
  84. package/dist/docs/operator-guide/static/relief__base.webp +0 -0
  85. package/dist/docs/operator-guide/static/relief__darken.webp +0 -0
  86. package/dist/docs/operator-guide/static/relief__lighten.webp +0 -0
  87. package/dist/docs/operator-guide/texture-shade/index.html +1014 -0
  88. package/dist/docs/quick-start/index.html +872 -0
  89. package/dist/docs/search/search_index.json +1 -0
  90. package/dist/docs/sitemap.xml +83 -0
  91. package/dist/docs/sitemap.xml.gz +0 -0
  92. package/dist/docs/static/basemaps-service.png +0 -0
  93. package/dist/docs/static/tile-resize.png +0 -0
  94. package/dist/docs/static/workflow-run.png +0 -0
  95. package/dist/docs/user-guide/index.html +856 -0
  96. package/package.json +7 -7
@@ -0,0 +1 @@
1
+ {"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"LINZ Basemaps","text":"<p>LINZ Basemaps is a collection of tools to create and serve vector and raster basemaps using open source and open standards. It is designed to be light weight, cost efficient and fast.</p> <p>Basemaps currently supports both Imagery and Vector data</p>"},{"location":"#background","title":"Background","text":"<p>Land Information New Zealand has a large archive of aerial and satellite imagery freely available from LINZ Data Service and the Registry of Open Data on AWS. This imagery was a primary driver for the creation of the LINZ Basemaps product and service. For more information on how LINZ acquires, ingests and publishes aerial and satellite imagery see linz/imagery.</p> <p>While linz/basemaps is public, its primary reason is to work in the open, so that we can share knowledge and foster collaboration with peers across the world. While the LINZ Basemaps product and services can be customised and deployed we are primarily focused on our own use cases of sharing New Zealand's Aerial Imagery archive and Topographic vector data.</p>"},{"location":"#basemaps-service","title":"Basemaps Service","text":"<p> The core of the LINZ Basemaps Service consists of</p> <ul> <li>AWS S3 - COG Storage location</li> <li>AWS Lambda function - Tile Server - @basemaps/lambda-tiler</li> <li>AWS Cloudfront - Content distribution and tile cache</li> <li>linz/basemaps-config - Basemaps configuration</li> </ul>"},{"location":"#imagery-tile-requests","title":"Imagery Tile Requests","text":"<p>A tile request flows a number of basemaps packages:</p> <p>Given a request <code>/v1/tiles/aerial/WebMercatorQuad/6/1/40.webp</code>, Breaking down this request url <code>lambda-tiler</code> needs to serve a <code>webp</code> image that for the tile <code>{z: 6, x: 1, y: 40}</code> from the <code>WebMercatorQuad</code> tile matrix from the tile set named <code>aerial</code> in the default configuration.</p> <p>Which will then utlize the following packages</p> <ul> <li>@basemaps/config - Load configuration (<code>?config</code>)</li> <li>@basemaps/lambda-tiler Convert tile XYZ into output coordinates bounding box</li> <li>@basemaps/lambda-tiler Determine which tiffs intersect the output coordinates</li> <li>@basemaps/tiler Determine which parts of the tiffs need to be loaded and resampled</li> <li>@basemaps/tiler-sharp - Load the bytes from the tiff and render it as a output image.</li> </ul> <p>Imagery is stored as cloud optimised geotiffs by survey then layered together dynamically based on a configured priority order.</p> <p>@basemaps/tiler takes the collection of tiffs and determines how resample (resize/crop) and paint them onto the output tile.</p> <p></p> <p>@basemaps/tiler-sharp uses sharp/libvips to take the output of @basemaps/tiler then load the raw tiff bytes and render them into output image.</p>"},{"location":"#vector-tile-requests","title":"Vector tile requests","text":"<p>Vector tiles are pre-rendered as Mapbox Vector Tiles and served directly from a Cloud Optimised Tar. Since there is no merging or dynamic configuration the tile server will just request the specified tile directly from the tar file.</p>"},{"location":"#additional-processing","title":"Additional Processing","text":""},{"location":"#aerial-satellite-imagery-processing","title":"Aerial &amp; Satellite Imagery Processing","text":"<p>To efficiently serve aerial imagery to huge number of consumers, it should be optimised into a format that makes it easy to serve. All of LINZ's imagery is stored as Cloud Optimised GeoTIFFs (COGs), and to ensure they are served as efficiently as possible some additional processing steps are generally pre-applied to the imagery.</p> <ul> <li>Reprojection: reprojecting the imagery into common consumption formats (EPSG:3857 and EPSG:2193) will greatly reduce the amount of load and complexity of the basemaps service service</li> <li>Tile Alignment: By aligning the COGs to the output XYZ tile grid</li> <li>Additional overviews: It is hard to fetch data from 1,000s of COGs to create a single tile, so we create additional overviews up to z0.</li> </ul> <p>These additional processing steps are part of the basemaps import process and are controlled by @basemaps/cogify</p> <p>The additional steps are optional but do greatly improve the tile serving performance of the service.</p>"},{"location":"#vector-data","title":"Vector Data","text":"<p>Vector data is processed from the LINZ topographic vector datasets using tippecanoe, this process is still a work in progress and will.</p>"},{"location":"#development","title":"Development","text":"<p>Deployments are handled by Github Actions see Deployments for more information.</p>"},{"location":"#diagrams","title":"Diagrams","text":"<p>All diagrams across this repository are created with excalidraw and embed the excalidraw configuration inside them, so can be re-edited on excalidraw</p>"},{"location":"configuration/","title":"Configuration","text":""},{"location":"configuration/#configuration","title":"Configuration","text":"<p>Basemaps has two main components to its configuration</p> <ul> <li>Imagery - List of tiffs that make up a imagery set</li> <li>TileSet - List of imagery or vector layers that make up a output layer.</li> </ul> <p>The configuration can be stored as individual AWS DynamoDB objects or can be stored as a bundled JSON object.</p> <p>The configuration is generally generated directly from the source tiffs and associated STAC metadata using the @basemaps/cli import process, with LINZ's specific configuration being stored in linz/basemaps-config.</p> <p>This allows the configuration objects to be somewhat short, below is a snippet from the aerial tile set configuration which layers 100+ aerial imagery layers together.</p> <pre><code>{\n // Raster or Vector layer\n \"type\": \"raster\",\n // all id's are prefixed by type eg 'ts_' is TileSet\n \"id\": \"ts_aerial\",\n // Human friendly name\n \"title\": \"Aerial Imagery Basemap\",\n \"category\": \"Basemaps\",\n // If there is no data create a background color as hex RGBA\n \"background\": \"dce9edff\",\n \"layers\": [\n {\n // Source location for EPSG:2193 Imagery\n \"2193\": \"s3://linz-basemaps/2193/gebco_2020_Nztm2000Quad_305-75m/01F1BFJN8R8P7BXN3XTHC5MT5G\",\n // Source location for EPSG:3857 Imagery\n \"3857\": \"s3://linz-basemaps/3857/gebco_2020_305-75m/01EDMTM3P563P06TWYQAZRA9F6\",\n // url/slug friendly name of the imagery set\n \"name\": \"gebco-2020-305.75m\",\n // At what level should the imagery be turned off\n \"maxZoom\": 15,\n // Human friendly name for the imagery\n \"title\": \"GEBCO Gridded Bathymetry (2020)\",\n \"category\": \"Bathymetry\"\n },\n ...\n ]\n}\n</code></pre> <p>When this configuration is imported it will list all of the source locations looking for <code>collection.json</code> and <code>*.tiff|*.tif</code> files.</p>"},{"location":"configuration/#dynamic-configuration","title":"Dynamic configuration","text":"<p>Configuration can be stored as single JSON object in s3 and then passed directly to the basemaps service with <code>?config=s3://linz-basemaps/config/config-latest.json.gz</code> this allows basemaps to preview a configuration before being deployed.</p>"},{"location":"deployment/","title":"Deployment","text":"<p>Deployments of Basemaps are managed with github actions.</p> <p>To trigger a deployment, make sure your branch is up to date and run the version bump script version.bump.sh.</p> <p>This script will create a <code>release:</code> commit and branch, please review the commit then create a pull request from it.</p> <p>Once the release pull request is merged the CI system will deploy the released version into dev then into production.</p>"},{"location":"deployment/#deployment-rollback","title":"Deployment Rollback","text":"<p>If a deployment breaks production, don't try to fix it on the fly, this risks introducing more errors and downtime. The fastest way to ensure production is stable again is to roll back to the previous release immediately and then focus on fixing the problem before the next release.</p> <p>As Basemaps deployments are managed with GitHub Actions, every release will bundle the release packages and deployment in the GitHub Action run automatically. So, it is very simple for us to roll back to a previous release as all the previous deployments remain in history. Please use the following steps to trigger a roll back when needed.</p> <ul> <li>Open the Basemaps Deployments page - linz/basemaps/deployments</li> <li>Choose the environment that needs to be rolled back</li> <li>Open the workflow run for an older release</li> </ul> <p></p> <ul> <li>Select the <code>Build / deploy-prod (push)</code> workflow and re-run it to roll back to a previous release.</li> </ul>"},{"location":"quick-start/","title":"Quick start guide","text":"<p>This document is broken down into three user types: User, Operator and Developer.</p> <ul> <li>User wants to use the basemaps service running on https://basemaps.linz.govt.nz</li> <li>Operator wants to use <code>@basemaps/server</code> or <code>@linzjs/lambda-tiler</code> on their own imagery</li> <li>Developer wants to modify the linz/basemaps source code to meet their needs.</li> </ul> <p>There are three separate quick start guides for these users.</p> <ul> <li>User Quick Start</li> <li>Operator Quick Start</li> <li>Developer Quick Start</li> </ul>"},{"location":"developer-guide/","title":"Developer guide","text":"<p>Documentation of the Basemaps codebase for developers</p> <ul> <li>How to build</li> <li>Contributing guidelines</li> <li>TypeDoc API docs</li> </ul>"},{"location":"developer-guide/#creating-and-updating-docs","title":"Creating and updating docs","text":"<p>The best way to run the docs locally is to use the same container as the CI process</p> <p>To start the container in a local dev mode which creates a server on http://localhost:8000</p> <pre><code>docker run --rm \\\n -v $PWD:/docs \\\n -p 8000:8000 \\\n squidfunk/mkdocs-material:9.4 serve -a 0.0.0.0:8000\n</code></pre> <p>As it is run inside of a container the additional <code>-a</code> to allow external connections to access it.</p>"},{"location":"examples/_overview/","title":"Overview","text":"<p>Use leaflet render raster map</p> <p>Use Maplibre adjust opacity of the map</p> <p>Use Maplibre to load vector tiles</p>"},{"location":"examples/leaflet.xyz.3857/","title":"Leaflet Raster Map","text":"<p>Use leaflet render raster map</p> <pre><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n &lt;head&gt;\n &lt;meta charset=\"UTF-8\" /&gt;\n &lt;title&gt;Leaflet WGS84 Basemaps Demo&lt;/title&gt;\n &lt;link rel=\"stylesheet\" href=\"https://unpkg.com/leaflet@1.9.4/dist/leaflet.css\" /&gt;\n &lt;script\n src=\"https://unpkg.com/leaflet@1.9.4/dist/leaflet.js\"\n integrity=\"sha384-cxOPjt7s7Iz04uaHJceBmS+qpjv2JkIHNVcuOrM+YHwZOmJGBXI00mdUXEq65HTH\"\n crossorigin=\"anonymous\"\n &gt;&lt;/script&gt;\n &lt;style&gt;\n html,\n body {\n height: 100%;\n margin: 0;\n }\n &lt;/style&gt;\n &lt;/head&gt;\n\n &lt;body&gt;\n &lt;div id=\"map\" style=\"width: 100%; height: 500px\"&gt;&lt;/div&gt;\n &lt;script&gt;\n const startPos = [-40.5, 173];\n const startZoom = 6;\n\n const url =\n 'https://basemaps.linz.govt.nz/v1/tiles/aerial/WebMercatorQuad/{z}/{x}/{y}.webp?api=d01hep5551e30kxb7w85hck49tp';\n\n const tiles = L.tileLayer(url, {\n attribution:\n '&lt;a href=\"https://www.linz.govt.nz/data/linz-data/linz-basemaps/data-attribution\"&gt;LINZ CC BY 4.0 \u00a9 Imagery Basemap contributors&lt;/a&gt;',\n });\n\n L.map('map').addLayer(tiles).setView(startPos, startZoom);\n &lt;/script&gt;\n &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>"},{"location":"examples/maplibre.opacity.3857/","title":"Maplibre Opacity Slider","text":"<p>Use Maplibre adjust opacity of the map</p> <pre><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n &lt;head&gt;\n &lt;meta charset=\"utf-8\" /&gt;\n &lt;title&gt;Adjust a layer's opacity&lt;/title&gt;\n &lt;meta name=\"viewport\" content=\"initial-scale=1,maximum-scale=1,user-scalable=no\" /&gt;\n &lt;link rel=\"stylesheet\" href=\"https://unpkg.com/maplibre-gl@3.6.0/dist/maplibre-gl.css\" /&gt;\n &lt;script\n src=\"https://unpkg.com/maplibre-gl@3.6.0/dist/maplibre-gl.js\"\n integrity=\"sha384-EYXW8ZhnlWPofZd2XtrFMKIJZXd8x1vTls280ww621jL26+4304H6YXxvU6RcKYd\"\n crossorigin=\"anonymous\"\n &gt;&lt;/script&gt;\n &lt;style&gt;\n body {\n margin: 0;\n padding: 0;\n overflow: hidden;\n }\n\n body * {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n\n .map {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 100%;\n }\n\n .map-overlay {\n font: bold 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif;\n position: absolute;\n width: 25%;\n top: 0;\n left: 0;\n padding: 10px;\n }\n\n .map-overlay .map-overlay-inner {\n background-color: #fff;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n border-radius: 3px;\n padding: 10px;\n margin-bottom: 10px;\n }\n\n .map-overlay label {\n display: block;\n margin: 0 0 10px;\n }\n\n .map-overlay input {\n background-color: transparent;\n display: inline-block;\n width: 100%;\n position: relative;\n margin: 0;\n cursor: ew-resize;\n }\n &lt;/style&gt;\n &lt;/head&gt;\n\n &lt;body&gt;\n &lt;div id=\"raster\" class=\"map\"&gt;&lt;/div&gt;\n &lt;div id=\"vector\" class=\"map\"&gt;&lt;/div&gt;\n\n &lt;div class=\"map-overlay top\"&gt;\n &lt;div class=\"map-overlay-inner\"&gt;\n &lt;label&gt;Layer opacity: &lt;span id=\"slider-value\"&gt;100%&lt;/span&gt;&lt;/label&gt;\n &lt;input id=\"slider\" type=\"range\" min=\"0\" max=\"100\" step=\"0\" value=\"100\" /&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n\n &lt;script&gt;\n // vector layers\n const styleUrl =\n 'https://basemaps.linz.govt.nz/v1/tiles/topographic/WebMercatorQuad/style/topographic.json?api=d01hep5551e30kxb7w85hck49tp';\n\n // Raster layers\n const url =\n 'https://basemaps.linz.govt.nz/v1/tiles/aerial/WebMercatorQuad/{z}/{x}/{y}.webp?api=d01hep5551e30kxb7w85hck49tp';\n\n const startPos = [173, -40.5];\n const startZoom = 6;\n\n var raster = new maplibregl.Map({\n container: 'raster', // Container ID\n style: {\n version: 8,\n sources: {\n 'raster-tiles': {\n type: 'raster',\n tiles: [url],\n tileSize: 256,\n },\n },\n layers: [\n {\n id: 'LINZ Raster Basemaps',\n type: 'raster',\n source: 'raster-tiles',\n },\n ],\n },\n center: startPos,\n zoom: startZoom,\n });\n\n var vector = new maplibregl.Map({\n container: 'vector', // Container ID\n style: styleUrl,\n center: startPos,\n zoom: startZoom,\n });\n\n var slider = document.getElementById('slider');\n var sliderValue = document.getElementById('slider-value');\n\n vector.on('load', function () {\n slider.addEventListener('input', function (e) {\n var vectorMap = document.querySelector('#vector');\n vectorMap.style.opacity = parseInt(e.target.value, 10) / 100;\n sliderValue.textContent = e.target.value + '%';\n });\n });\n\n // Copyright (c) 2016, Mapbox - ISC License\n // https://github.com/mapbox/mapbox-gl-sync-move\n function moveToMapPosition(master, clones) {\n let center = master.getCenter();\n let zoom = master.getZoom();\n let bearing = master.getBearing();\n let pitch = master.getPitch();\n\n clones.forEach(function (clone) {\n clone.jumpTo({\n center: center,\n zoom: zoom,\n bearing: bearing,\n pitch: pitch,\n });\n });\n }\n\n // Sync movements of two maps.\n //\n // All interactions that result in movement end up firing\n // a \"move\" event. The trick here, though, is to\n // ensure that movements don't cycle from one map\n // to the other and back again, because such a cycle\n // - could cause an infinite loop\n // - prematurely halts prolonged movements like\n // double-click zooming, box-zooming, and flying\n function syncMaps() {\n let maps;\n let argLen = arguments.length;\n if (argLen === 1) {\n maps = arguments[0];\n } else {\n maps = [];\n for (let i = 0; i &lt; argLen; i++) {\n maps.push(arguments[i]);\n }\n }\n\n // Create all the movement functions, because if they're created every time\n // they wouldn't be the same and couldn't be removed.\n let fns = [];\n maps.forEach(function (map, index) {\n fns[index] = sync.bind(\n null,\n map,\n maps.filter(function (o, i) {\n return i !== index;\n }),\n );\n });\n\n function on() {\n maps.forEach(function (map, index) {\n map.on('move', fns[index]);\n });\n }\n\n function off() {\n maps.forEach(function (map, index) {\n map.off('move', fns[index]);\n });\n }\n\n // When one map moves, we turn off the movement listeners\n // on all the maps, move it, then turn the listeners on again\n function sync(master, clones) {\n off();\n moveToMapPosition(master, clones);\n on();\n }\n\n on();\n return function () {\n off();\n fns = [];\n maps = [];\n };\n }\n\n syncMaps(raster, vector);\n &lt;/script&gt;\n &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>"},{"location":"examples/maplibre.vector.3857/","title":"Maplibre Vector Map","text":"<p>Use Maplibre to load vector tiles</p> <pre><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n &lt;head&gt;\n &lt;meta charset=\"utf-8\" /&gt;\n &lt;title&gt;Maplibre WGS84 Topographic Vector Basemaps Demo&lt;/title&gt;\n &lt;meta name=\"viewport\" content=\"initial-scale=1,maximum-scale=1,user-scalable=no\" /&gt;\n &lt;link rel=\"stylesheet\" href=\"https://unpkg.com/maplibre-gl@3.6.0/dist/maplibre-gl.css\" /&gt;\n &lt;script\n src=\"https://unpkg.com/maplibre-gl@3.6.0/dist/maplibre-gl.js\"\n integrity=\"sha384-EYXW8ZhnlWPofZd2XtrFMKIJZXd8x1vTls280ww621jL26+4304H6YXxvU6RcKYd\"\n crossorigin=\"anonymous\"\n &gt;&lt;/script&gt;\n &lt;style&gt;\n body {\n margin: 0;\n padding: 0;\n }\n\n #map {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 100%;\n }\n &lt;/style&gt;\n &lt;/head&gt;\n\n &lt;body&gt;\n &lt;div id=\"map\"&gt;&lt;/div&gt;\n &lt;script&gt;\n const startPos = [173, -40.5];\n const startZoom = 6;\n\n // vector layers\n const style =\n 'https://basemaps.linz.govt.nz/v1/tiles/topographic/WebMercatorQuad/style/topographic.json?api=d01hep5551e30kxb7w85hck49tp';\n var map = new maplibregl.Map({\n container: 'map', // container id\n style: style, // style URL\n center: startPos, // starting position [lng, lat]\n zoom: startZoom, // starting zoom\n });\n &lt;/script&gt;\n &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>"},{"location":"operator-guide/","title":"Basemaps operator guide","text":"<p>How to deploy your own instance of Basemaps</p> <ul> <li>How to run basemaps on your own imagery</li> <li>Simple CLI examples on how to serve tiffs from docker</li> <li>How to process imagery into more efficent formats</li> <li>Complex TIFF examples</li> </ul>"},{"location":"operator-guide/cog-quality/","title":"COG Quality","text":""},{"location":"operator-guide/cog-quality/#resampling-with-reprojecton-and-overview-creation","title":"Resampling with reprojecton and overview creation","text":"<p>creating COGs using a command very similar to</p> <pre><code>gdal_translate --version\n\nCOMPRESS=webp\nBLOCKSIZE=256\n\nfor RESAMPLE in cubic lanczos bilinear\ndo\ngdal_translate \\\n -of COG \\\n -co COMPRESS=$COMPRESS\\\n -co NUM_THREADS=ALL_CPUS \\\n -co BIGTIFF=YES \\\n -co TILING_SCHEME=GoogleMapsCompatible \\\n --config BIGTIFF_OVERVIEW YES \\\n -co ALIGNED_LEVELS=1 \\\n -co SPARSE_OK=TRUE \\\n -co ADD_ALPHA=YES \\\n -co BLOCKSIZE=$BLOCKSIZE \\\n -co RESAMPLING=$RESAMPLE \\\n -co QUALITY=90 \\\n -co ZOOM_LEVEL_STRATEGY=UPPER \\\n $PWD/$TIF_FOLDER/.vrt $PWD/$TIF_FOLDER.$COMPRESS.google.r_$RESAMPLE.bs_$BLOCKSIZE.aligned.cog.tif\ndone\n</code></pre>"},{"location":"operator-guide/cog-quality/#overviews","title":"Overviews","text":"<p>When creating COGs using the different resampling methods the output quality differs a lot.</p> <p>Here are some overviews created using some of the different resampling methods:</p> <p></p>"},{"location":"operator-guide/cog-quality/#lanczos","title":"Lanczos","text":"<p>Provides quite a nice and crisp output</p> <p></p>"},{"location":"operator-guide/cog-quality/#cubic","title":"Cubic","text":"<p>Creates weird artifacts around the edges</p> <p></p>"},{"location":"operator-guide/cog-quality/#bilinear","title":"Bilinear","text":"<p>looks blury</p> <p></p> <p>Using lanczos looks best for our overview creation.</p>"},{"location":"operator-guide/cog-quality/#reprojection-resampling","title":"Reprojection resampling","text":"<p>However when we use lanczos for the cog creation we start getting jagged lines inside the high resolution images</p> <p>Here are some higher resolution aerial imagery image 0 with different resampling methods, these are tiles taken directly from a tiff and converted to webp.</p>"},{"location":"operator-guide/cog-quality/#lanczos_1","title":"Lanczos","text":"<p>Creates a jaggeredness, look at the street markings and the edges of the buildings</p> <p></p>"},{"location":"operator-guide/cog-quality/#bilinear_1","title":"Bilinear","text":"<p>Creates a nice image</p> <p></p> <p>For our aerial imagery reprojection seems to be best done as bilinear, where as Overview creation seems to be best done as lanczos.</p> <p>Using GDAL 3.2.x+ this can be configured with as it was fixed in osgeo/gdal#2671</p> <pre><code>gdal_translate -co WARP_RESAMPLING=bilinear -co OVERVIEW_RESAMPLING=lanczos\n</code></pre>"},{"location":"operator-guide/empty-tiles/","title":"Sparse Datasets and empty tiles","text":""},{"location":"operator-guide/empty-tiles/#tldr","title":"TLDR","text":"<p>Basemaps should continue to serve transparent images for areas which do not have any data, for maximum compatibility with clients. Once clients upgrade and fix bugs, either HTTP <code>204 No Content</code> or HTTP <code>200 Ok</code> with a 0 byte payload responses would be preferable.</p> <p>Further investigation should also be done on <code>OATiles-hint: empty</code> response headers, as well as converting more clients to TileJSON which allows specify a bounding box to restrict where a client requests tiles from.</p>"},{"location":"operator-guide/empty-tiles/#background","title":"Background","text":"<p>LINZ has imagery datasets which are very sparse, with large empty areas between smaller sections of valid data, for example Gisborne Urban 2022-2023.</p> <p></p> <p>Even when providing a bounding box for the imagery, there is still a very large amount of empty space, which results in a large number of empty tiles being served.</p>"},{"location":"operator-guide/empty-tiles/#question","title":"Question","text":"<p>What is the best way to tell clients that the area they are requesting has no data?</p>"},{"location":"operator-guide/empty-tiles/#response-options","title":"Response Options","text":"<p>A server can return different responses to clients to signal that there is no data. The following section is specifically for WebP, JPEG and PNG imagery tiles returned from a tile server.</p> <p>For Mapbox Vector Tiles, a 0 byte response of either <code>204 No Content</code> or <code>200 Ok</code> works in clients as a 0 byte vector tile is a valid vector tile.</p>"},{"location":"operator-guide/empty-tiles/#200-transparent-image","title":"200 Transparent Image","text":"<p>Serve a valid image in the request format (e.g. WebP, JPEG, or PNG). For example if a client requests a PNG, serve a fully transparent PNG tile.</p> <p>Pros:</p> <ul> <li>\u2714\ufe0f Supported everywhere</li> </ul> <p>Cons:</p> <ul> <li>\u274c JPEG does not support transparency, so users get a black image</li> <li>\u274c Much larger responses: 1KB vs 0 byte payload</li> <li>\u274c Difficult to know in logs if the tile request was for a valid region</li> </ul>"},{"location":"operator-guide/empty-tiles/#200-0-byte","title":"200 - 0 Byte","text":"<p>Serve HTTP <code>200 Ok</code>, With a <code>content-length: 0</code> response header, which is a 0 byte response</p> <p>Pros:</p> <ul> <li>\u2714\ufe0f Supported in ArcGIS Pro and QGIS</li> <li>\u2714\ufe0f Supported by ArcGIS Online, Leaflet, and OpenLayers</li> <li>\u2714\ufe0f Supported by HTTP RFC, which allows 0 byte <code>200 Ok</code> responses as long as the message framing indicates this (via <code>Content-length=0</code> response header</li> <li>\u2714\ufe0f Recommended option from OGC Tile API</li> </ul> <p>Cons:</p> <ul> <li>\u274c Not supported by maplibre/mapbox</li> <li>\u274c HTTP RFC suggests that while valid, servers \"ought to return 204 No content\"</li> </ul>"},{"location":"operator-guide/empty-tiles/#204-no-content","title":"204 No Content","text":"<p>Return HTTP <code>204 No Content</code>, with no body</p> <p>Pros:</p> <ul> <li>\u2714\ufe0f Supported in ArcGIS Pro and QGIS</li> <li>\u2714\ufe0f Supported by Leaflet and OpenLayers</li> <li>\u2714\ufe0f Supported by HTTP RFC: \"server ought to return 204 No content\"</li> <li>\u2714\ufe0f Recommended option from OGC Tile API</li> </ul> <p>Cons:</p> <ul> <li>\u274c Not supported by ArcGIS Online</li> <li>\u274c Not supported by maplibre</li> <li>https://github.com/maplibre/maplibre-gl-js/pull/2325</li> <li>https://github.com/maplibre/maplibre-gl-js/pull/1586</li> <li>\u274c Not supported by mapbox gl</li> <li>https://github.com/mapbox/mapbox-gl-js/issues/9304</li> <li>Not always cached by browser</li> </ul>"},{"location":"operator-guide/empty-tiles/#404-tile-not-found","title":"404 Tile Not found","text":"<p>Return a error state saying the tile is not found</p> <ul> <li>\u274c Is an error state</li> <li>\u274c Not always cached: browsers / CDNs often do not cache 404 responses</li> </ul>"},{"location":"operator-guide/empty-tiles/#references","title":"References","text":"<ul> <li>https://github.com/opengeospatial/ogcapi-tiles/issues/63 - <code>OATiles-hint: empty</code> <code>OATiles-hint: full</code></li> <li>https://github.com/opengeospatial/ogcapi-tiles/issues/21</li> </ul> <p>Simple proxy that converts <code>204 No Content</code> into different results.</p> <ul> <li>https://github.com/blacha/tile-status-code</li> </ul>"},{"location":"operator-guide/quick-start/","title":"Running LINZ Basemaps - Quick Start","text":"<p>There are three options for LINZ basemaps server deployment</p> <ul> <li>Using docker and <code>@basemaps/server</code></li> <li>Running <code>@basemaps/server</code> directly</li> <li>Deploying <code>@basemaps/server</code> as a AWS Lambda Function</li> </ul> <p>The easiest option for running linz/basemaps is using docker and @basemaps/server container</p> <p>As a base you will need some imagery, docker and the AWS Command line</p>"},{"location":"operator-guide/quick-start/#sample-imagery","title":"Sample Imagery","text":"<p>To use basemaps, we need some Cloud optimised geotiffs (COGs), and optionally their STAC metadata</p> <p>LINZ has a public bucket <code>s3://nz-imagery</code> which contains COGs which work well with basemaps.</p> <p>W\u0101naka is a nice location so lets grab a combination of rural and urban imagery around W\u0101naka</p> <ul> <li>Queenstown-Lakes 2022-2023 0.1m</li> <li>Otago Rural 2017-2019 0.3m</li> </ul> <p>Make a location to put the imagery</p> <pre><code>mkdir -p imagery/queenstown-lakes_2022-2023_0.1m/\nmkdir -p imagery/otago_2017-2019_0.3m/\n</code></pre> <p>First download the <code>collection.json</code> since this bucket is public, use <code>--no-sign-request</code> with the aws cli to ensure your local aws credentials are not used.</p> <pre><code>aws --no-sign-request s3 cp s3://nz-imagery/otago/queenstown-lakes_2022-2023_0.1m/rgb/2193/collection.json imagery/queenstown-lakes_2022-2023_0.1m/collection.json\naws --no-sign-request s3 cp s3://nz-imagery/otago/otago_2017-2019_0.3m/rgb/2193/collection.json imagery/otago_2017-2019_0.3m/collection.json\n</code></pre> <p>Download the Rural imagery 0.3m resolution</p> <pre><code>aws --no-sign-request s3 cp s3://nz-imagery/otago/otago_2017-2019_0.3m/rgb/2193/CB12_5000_0107.tiff imagery/otago_2017-2019_0.3m/CB12_5000_0107.tiff\naws --no-sign-request s3 cp s3://nz-imagery/otago/otago_2017-2019_0.3m/rgb/2193/CB12_5000_0108.tiff imagery/otago_2017-2019_0.3m/CB12_5000_0108.tiff\naws --no-sign-request s3 cp s3://nz-imagery/otago/otago_2017-2019_0.3m/rgb/2193/CA12_5000_1007.tiff imagery/otago_2017-2019_0.3m/CA12_5000_1007.tiff\naws --no-sign-request s3 cp s3://nz-imagery/otago/otago_2017-2019_0.3m/rgb/2193/CA12_5000_1008.tiff imagery/otago_2017-2019_0.3m/CA12_5000_1008.tiff\n</code></pre> <p>Download the Urban imagery 0.1m resolution</p> <pre><code>aws --no-sign-request s3 cp s3://nz-imagery/otago/queenstown-lakes_2022-2023_0.1m/rgb/2193/CB12_1000_0434.tiff imagery/queenstown-lakes_2022-2023_0.1m/CB12_1000_0434.tiff\naws --no-sign-request s3 cp s3://nz-imagery/otago/queenstown-lakes_2022-2023_0.1m/rgb/2193/CB12_1000_0435.tiff imagery/queenstown-lakes_2022-2023_0.1m/CB12_1000_0435.tiff\naws --no-sign-request s3 cp s3://nz-imagery/otago/queenstown-lakes_2022-2023_0.1m/rgb/2193/CB12_1000_0435.tiff imagery/queenstown-lakes_2022-2023_0.1m/CB12_1000_0435.tiff\naws --no-sign-request s3 cp s3://nz-imagery/otago/queenstown-lakes_2022-2023_0.1m/rgb/2193/CB12_1000_0436.tiff imagery/queenstown-lakes_2022-2023_0.1m/CB12_1000_0436.tiff\naws --no-sign-request s3 cp s3://nz-imagery/otago/queenstown-lakes_2022-2023_0.1m/rgb/2193/CB12_1000_0437.tiff imagery/queenstown-lakes_2022-2023_0.1m/CB12_1000_0437.tiff\naws --no-sign-request s3 cp s3://nz-imagery/otago/queenstown-lakes_2022-2023_0.1m/rgb/2193/CB12_1000_0438.tiff imagery/queenstown-lakes_2022-2023_0.1m/CB12_1000_0438.tiff\n\naws --no-sign-request s3 cp s3://nz-imagery/otago/queenstown-lakes_2022-2023_0.1m/rgb/2193/CB12_1000_0534.tiff imagery/queenstown-lakes_2022-2023_0.1m/CB12_1000_0534.tiff\naws --no-sign-request s3 cp s3://nz-imagery/otago/queenstown-lakes_2022-2023_0.1m/rgb/2193/CB12_1000_0535.tiff imagery/queenstown-lakes_2022-2023_0.1m/CB12_1000_0535.tiff\naws --no-sign-request s3 cp s3://nz-imagery/otago/queenstown-lakes_2022-2023_0.1m/rgb/2193/CB12_1000_0536.tiff imagery/queenstown-lakes_2022-2023_0.1m/CB12_1000_0536.tiff\naws --no-sign-request s3 cp s3://nz-imagery/otago/queenstown-lakes_2022-2023_0.1m/rgb/2193/CB12_1000_0536.tiff imagery/queenstown-lakes_2022-2023_0.1m/CB12_1000_0536.tiff\naws --no-sign-request s3 cp s3://nz-imagery/otago/queenstown-lakes_2022-2023_0.1m/rgb/2193/CB12_1000_0537.tiff imagery/queenstown-lakes_2022-2023_0.1m/CB12_1000_0537.tiff\naws --no-sign-request s3 cp s3://nz-imagery/otago/queenstown-lakes_2022-2023_0.1m/rgb/2193/CB12_1000_0538.tiff imagery/queenstown-lakes_2022-2023_0.1m/CB12_1000_0538.tiff\n</code></pre>"},{"location":"operator-guide/quick-start/#running-basemaps-in-docker","title":"Running Basemaps in Docker","text":"<p>Basemaps server can be run in two modes</p> <ol> <li>Directly from the tiff and stac folders</li> <li>With a configuration file</li> </ol> <p>Directly from the tiffs is easier and faster to setup but does not allow for a more custom setup.</p>"},{"location":"operator-guide/quick-start/#directly-from-the-tiff-files","title":"Directly from the tiff files","text":"<p>To start the server, mount the imagery into <code>/imagery</code> so the server has access to it</p> <pre><code>docker run --rm \\\n -v $PWD:$PWD \\\n -p 5000:5000 \\\n ghcr.io/linz/basemaps/server:latest $PWD/imagery/*\n</code></pre> <p>Note</p> <p>Basemaps logs into structured JSON log format it can be useful to run a pretty printer over it such as pretty-json-log</p> <pre><code>docker run --rm \\\n -v $PWD:$PWD \\\n -p 5000:5000 \\\n ghcr.io/linz/basemaps/server:latest $PWD/imagery/* | pjl\n</code></pre> <p>The server should now be started and you should see the following log lines, informing you that two layers were loaded Otago and Queenstown in NZTM2000Quad tile matrix</p> <pre><code>INFO Imagery:Loaded imagery=/home/user/tmp/basemaps-quick-start/imagery/otago_2017-2019_0.3m title=otago_2017-2019_0.3m tileMatrix=NZTM2000Quad files=4\nINFO Imagery:Loaded imagery=/home/user/tmp/basemaps-quick-start/imagery/queenstown-lakes_2022-2023_0.1m title=queenstown-lakes_2022-2023_0.1m tileMatrix=NZTM2000Quad files=10\n</code></pre> <p>Then open a browser to <code>http://localhost:5000/layers</code> This will load a list of the layers that have been imported into the system, clicking on any of the layers will take you to the layer.</p> <p></p> <p>It is not recommended to run <code>:latest</code> for any prolonged period of time, all of the containers are published with the following tags</p> <ul> <li><code>:latest</code> - Current master branch</li> <li><code>:vX.Y.Z</code> - Specific release tag which does not move eg <code>:v0.0.0</code></li> <li><code>:vX.Y</code> - Moving tag for the latest major.minor release eg <code>:v7.0</code></li> <li><code>:vX</code> - Moving tag for the latest major release eg <code>:v7</code></li> </ul>"},{"location":"operator-guide/quick-start/#creating-a-configuration-from-the-tiff-files","title":"Creating a configuration from the tiff files","text":"<p>Using the basemaps CLI a configuration bundle can be generated.</p> <p>A tileset needs to be created as the entry point for the configuration.</p> <p>Below is a configuration for the two example layers, where the rural imagery sets underneath the urban imagery, and the urban imagery is only turned on when the zoom is greater than z15.</p> <p>storing this JSON into <code>config/aerial.json</code></p> <pre><code>{\n \"type\": \"raster\",\n \"id\": \"ts_basic\",\n \"title\": \"Basic Imagery Basemap\",\n \"layers\": [\n {\n // Source location for EPSG:2193 Imagery, has to be absolute\n \"2193\": \"/home/user/basemaps-quick-start/imagery/otago_2017-2019_0.3m/\",\n // url/slug friendly name of the imagery set\n \"name\": \"otago_2017-2019_0.3m\",\n \"title\": \"Otago 0.3m Rural Aerial Photos (2017-2019)\" // from collection.json#title\n },\n {\n \"2193\": \"/home/user/basemaps-quick-start/imagery/queenstown-lakes_2022-2023_0.1m/\",\n \"name\": \"queenstown-lakes_2022-2023_0.1m\",\n \"title\": \"Queenstown Lakes 0.1m Urban Aerial Photos (2022-2023)\",\n // Limit the imagery to greater than z15\n \"minZoom\": 15\n }\n ]\n}\n</code></pre> <p>Then using the basemaps CLI a config can be bundled, assuming $PWD is the same folder that contains <code>imagery/</code> and <code>config/</code></p> <pre><code>docker run --rm \\\n -v $PWD:$PWD \\\n -it ghcr.io/linz/basemaps/cli:latest bundle --config $PWD/config/ --output $PWD/\n</code></pre> <p>This generates a <code>config.json</code> which has all the information needed to start the server</p> <pre><code>docker run --rm \\\n -v $PWD:$PWD \\\n -p 5000:5000 \\\n ghcr.io/linz/basemaps/server:latest --config $PWD/config.json\n</code></pre> <p>For more advanced usage of configuration files please take a look at linz/basemaps-config</p>"},{"location":"operator-guide/relief-shade/","title":"Relief shade","text":""},{"location":"operator-guide/relief-shade/#creating-a-relief-shade-using-gdal-dems","title":"Creating a relief shade using GDAL &amp; DEMS","text":"<ul> <li>8M DEM of NZ - lds:51768</li> <li>GDAL</li> </ul> <p>Create a VRT of all the imagery</p> <pre><code>gdalbuildvrt dem/*.tif dem.vrt\n</code></pre> <p>Create the relief shade</p> <pre><code>gdaldem hillshade -co COMPRESS=lzw -co TILED=yes -co NUM_THREADS=ALL_CPUS -of gtiff \\\n -z 1.3 -az 315 -alt 60 -compute_edges \\\n dem.vrt dem.hillshade.tiff\n</code></pre> <p>Apply colors to the relief shade</p> <pre><code>gdaldem color-relief -co COMPRESS=lzw -co TILED=yes -co NUM_THREADS=ALL_CPUS -of gtiff \\\n -co ALPHA=YES -alpha \\\n dem.hillshade.tiff color.ramp dem.hillshade.color.tiff\n</code></pre>"},{"location":"operator-guide/relief-shade/#color-ramps-vector-tiles","title":"Color ramps &amp; Vector tiles","text":"<p>Relief shading with vector tiles the only imagery operation is \"overlay\", if any <code>white</code> exists in the relief shade it lightens the image</p> <p>Base Image: </p> <p>gdaldem hillshade: </p> <p>Using default color ramp applys whites </p> <p>Custom color ramp which only applys the darken</p> <pre><code>nv 0 0 0 0\n0 0 0 0 255\n170 0 0 0 64\n220 0 0 0 0\n255 0 0 0 0\n</code></pre> <p><code>nv</code> - No value or NO_DATA set full alpha</p> <p></p>"},{"location":"operator-guide/texture-shade/","title":"Texture shading","text":"<p>Texture shading is a new technique for generating shaded relief images to show the three-dimensional structure of mountainous terrain. It differs from traditional hillshading and can be used either as an alternative shading method, or as an enhancement to hillshading by combining the two methods. Texture shading emphasizes the drainage network (canyons and ridges) of the landscape and exhibits a visual hierarchy that reflects this structure. It can be used to bring out fine details that are present in high-quality elevation data, and likewise as a tool to examine digital elevation models for unwanted data artifacts.</p> <p>See http://www.textureshading.com/Home.html</p>"},{"location":"operator-guide/texture-shade/#process","title":"Process","text":"<pre><code>#!/bin/bash\n#################\n# Process DEM using texture_shade\n#\n# This process requires a huge amount of memory, for the 8M geographx DEM it requires around 100GB of free memory\n# This process has been tested on a AWS R5D with 32VCPUs and 256GB of ram, starting with a base AWS centos image\n#\n#################\n# Install required software\nsudo yum groupinstall 'Development Tools'\nsudo yum install tmux git\n\n# start docker\nsudo systemctl start docker\nsudo docker ps\n\n# Helper function to run docker\nfunction gdal_docker() {\n sudo docker run --rm -it -v $PWD:$PWD --workdir $PWD osgeo/gdal:ubuntu-small-3.3.3 \"$@\"\n}\n\n# Ensure we have access to a GDAL &gt; 3.3\ngdal_docker gdal_translate --version\n\n# Install texture_shade\ngit clone git@github.com:linz/texture-shade.git\ncd texture-shade\nmake clean\nmake\n\n# AWS R5d come with two NVME ssds they will be unmounted and unformatted to begin with\n# Format the disks into ext4 and mount them into the home directory\n# Prepare disk drives\nsudo fdisk -l\nsudo mkfs.ext4 /dev/nvme1n1\nsudo mkfs.ext4 /dev/nvme2n1\n\n# Mount NVME drives\nmkdir n1 n2\nsudo mount /dev/nvme1n1 n1\nsudo mount /dev/nvme2n1 n2\n# Allow our user to write to the folders\nsudo chown ssm-user:ssm-user n* -R\n\n\ncd n1\n\n# Grab required files\naws s3 cp s3://linz-basemaps-source/Geographx-NZ-DEM Geographx-NZ-DEM --recursive\n\n# Craete a VRT\ngdal_docker gdalbuildvrt Geographx-NZ-DEM-FLT.vrt Geographx-NZ-DEM/*.tif\n\n# texture requires a FLT file\ngdal_docker gdal_translate -of EHdr -ot Float32 Geographx-NZ-DEM-FLT.vrt Geographx-NZ-DEM-FLT.flt\n\n# validate flt was created ok\ngdal_docker gdalinfo Geographx-NZ-DEM-FLT.flt\n\nsudo chown ssm-user:ssm-user n1 -R\n\n# Texture shading takes a while run inside of tmux so the session can be resumed with `tmux attach`\ntmux\n../texture-shade/bin/texture 1 Geographx-NZ-DEM-FLT.flt Geographx-NZ-DEM-FLT.detail_1.flt\n../texture-shade/bin/texture_image +1.5 Geographx-NZ-DEM-FLT.detail_1.flt Geographx-NZ-DEM-FLT.detail_1.contrast_1.5.tif # texture-shade only allows \".tif\"\n\n# Compress the output tiff\ngdal_docker gdal_translate -of Gtiff -co COMPRESS=lzw -co BIGTIFF=yes -co NUM_THREADS=ALL_CPUS -co TILED=yes \\\n Geographx-NZ-DEM-FLT.detail_1.contrast_1.5.tif Geographx-NZ-DEM-FLT.detail_1.contrast_1.5.lzw.tiff\n\n\n# Store the result back in s3\n\naws s3 cp Geographx-NZ-DEM-FLT.detail_1.contrast_1.5.lzw.tiff s3://linz-basemaps-source/Geographx-NZ-DEM-FLT/\n</code></pre> <p>Once complete this gives a uint16 tiff that has values between 0-65,536 to make this image usage a color ramp is applied to create a semi transparent image</p> <p>At 0 create a 25% opacity black, <code>rgba(0,0,0,0.25)</code> then slowly ramp to 0% opacity at 32,768</p> <pre><code>nv 0 0 0 0\n0 0 0 0 63\n32768 0 0 0 0\n</code></pre> <p>Using gdal apply the color-relief</p> <pre><code>gdaldem color-relief \\\n -co COMPRESS=lzw \\\n -co TILED=yes \\\n -co NUM_THREADS=ALL_CPUS \\\n -of GTiff \\\n -co BIGTIFF=yes \\\n -co ALPHA=yes -alpha \\\n Geographx-NZ-DEM-FLT.detail_1.contrast_1.5.lzw.tiff color.ramp Geographx-NZ-DEM-FLT.detail_1.contrast_1.5.lzw.ramp.tiff\n</code></pre>"},{"location":"user-guide/","title":"User guide","text":"<p>How to use the Basemaps service for end users.</p> <ul> <li>How to use basemaps.linz.govt.nz.</li> <li>Lots of examples similar to maplibre.</li> <li>Probably only care about WMTS/XYZ/style endpoints.</li> </ul>"}]}
@@ -0,0 +1,83 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3
+ <url>
4
+ <loc>http://localhost:8000/docs/</loc>
5
+ <lastmod>2023-11-27</lastmod>
6
+ <changefreq>daily</changefreq>
7
+ </url>
8
+ <url>
9
+ <loc>http://localhost:8000/docs/configuration/</loc>
10
+ <lastmod>2023-11-27</lastmod>
11
+ <changefreq>daily</changefreq>
12
+ </url>
13
+ <url>
14
+ <loc>http://localhost:8000/docs/deployment/</loc>
15
+ <lastmod>2023-11-27</lastmod>
16
+ <changefreq>daily</changefreq>
17
+ </url>
18
+ <url>
19
+ <loc>http://localhost:8000/docs/quick-start/</loc>
20
+ <lastmod>2023-11-27</lastmod>
21
+ <changefreq>daily</changefreq>
22
+ </url>
23
+ <url>
24
+ <loc>http://localhost:8000/docs/developer-guide/</loc>
25
+ <lastmod>2023-11-27</lastmod>
26
+ <changefreq>daily</changefreq>
27
+ </url>
28
+ <url>
29
+ <loc>http://localhost:8000/docs/examples/_overview/</loc>
30
+ <lastmod>2023-11-27</lastmod>
31
+ <changefreq>daily</changefreq>
32
+ </url>
33
+ <url>
34
+ <loc>http://localhost:8000/docs/examples/leaflet.xyz.3857/</loc>
35
+ <lastmod>2023-11-27</lastmod>
36
+ <changefreq>daily</changefreq>
37
+ </url>
38
+ <url>
39
+ <loc>http://localhost:8000/docs/examples/maplibre.opacity.3857/</loc>
40
+ <lastmod>2023-11-27</lastmod>
41
+ <changefreq>daily</changefreq>
42
+ </url>
43
+ <url>
44
+ <loc>http://localhost:8000/docs/examples/maplibre.vector.3857/</loc>
45
+ <lastmod>2023-11-27</lastmod>
46
+ <changefreq>daily</changefreq>
47
+ </url>
48
+ <url>
49
+ <loc>http://localhost:8000/docs/operator-guide/</loc>
50
+ <lastmod>2023-11-27</lastmod>
51
+ <changefreq>daily</changefreq>
52
+ </url>
53
+ <url>
54
+ <loc>http://localhost:8000/docs/operator-guide/cog-quality/</loc>
55
+ <lastmod>2023-11-27</lastmod>
56
+ <changefreq>daily</changefreq>
57
+ </url>
58
+ <url>
59
+ <loc>http://localhost:8000/docs/operator-guide/empty-tiles/</loc>
60
+ <lastmod>2023-11-27</lastmod>
61
+ <changefreq>daily</changefreq>
62
+ </url>
63
+ <url>
64
+ <loc>http://localhost:8000/docs/operator-guide/quick-start/</loc>
65
+ <lastmod>2023-11-27</lastmod>
66
+ <changefreq>daily</changefreq>
67
+ </url>
68
+ <url>
69
+ <loc>http://localhost:8000/docs/operator-guide/relief-shade/</loc>
70
+ <lastmod>2023-11-27</lastmod>
71
+ <changefreq>daily</changefreq>
72
+ </url>
73
+ <url>
74
+ <loc>http://localhost:8000/docs/operator-guide/texture-shade/</loc>
75
+ <lastmod>2023-11-27</lastmod>
76
+ <changefreq>daily</changefreq>
77
+ </url>
78
+ <url>
79
+ <loc>http://localhost:8000/docs/user-guide/</loc>
80
+ <lastmod>2023-11-27</lastmod>
81
+ <changefreq>daily</changefreq>
82
+ </url>
83
+ </urlset>
Binary file
Binary file