Skip to content

Commit

Permalink
fix(server): indexing local tiffs should not crash (#2152)
Browse files Browse the repository at this point in the history
  • Loading branch information
blacha committed Apr 13, 2022
1 parent a3420bc commit 066f39f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
21 changes: 18 additions & 3 deletions packages/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This wraps the @basemaps/lambda-tiler into a standalone express http server.
## Usage

```
./basemaps-server path/to/config
basemaps-server --config path/to/config
```

Usage with basemaps config, you will need access to basemaps' imagery cache
Expand All @@ -16,5 +16,20 @@ please contact basemaps@linz.govt.nz if you need access.
```
git clone github.com/linz/basemaps-config
./basemaps-server basemaps-config/config
```
basemaps-server --config basemaps-config/config
```


### Direct TIFF access

If you have a folder of tiffs the basemaps-server can index the folder and create tiles from


For example given a structure where there are two folders full of tiffs

```
/images/00_gebco_2021_305-75m/01G0DBCAEQAAPD0D2F2VZS40XM/*.tiff
/images/10_geographx_nz_texture_shade_2012_8-0m_01FHRPYJ5FV1XAARZAC4T4K6MC/*.tiff
```

running `basemaps-server --config /images` will create two tile sets one for each folder `gebco_2021...` and `geographx_nz_t...` and then also create a combined layer in the order the tiffs are found.
1 change: 1 addition & 0 deletions packages/server/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export class BasemapsServerCommand extends Command {

const tileSet = basename(tiffPath);
const tsl = new TileSetLocal(tileSet, tiffPath);
tifSets.set(tiffPath, tsl);

await tsl.load();
TileSets.add(tsl, new Date('3000-01-01').getTime());
Expand Down

0 comments on commit 066f39f

Please sign in to comment.