Organise imports in tileserver
This commit is contained in:
parent
175d3236eb
commit
8019e77200
@ -1,4 +1,5 @@
|
|||||||
import { strictParseInt } from "../parse";
|
import { strictParseInt } from "../parse";
|
||||||
|
|
||||||
import { DataConfig } from "./types";
|
import { DataConfig } from "./types";
|
||||||
|
|
||||||
const BUILDING_LAYER_DEFINITIONS = {
|
const BUILDING_LAYER_DEFINITIONS = {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { TileCache } from "./tileCache";
|
import { getAllLayerNames, getBuildingLayerNames, getBuildingsDataConfig, getHighlightDataConfig } from "./dataDefinition";
|
||||||
import { BoundingBox, TileParams, Tile } from "./types";
|
|
||||||
import { getBuildingsDataConfig, getHighlightDataConfig, getAllLayerNames, getBuildingLayerNames } from "./dataDefinition";
|
|
||||||
import { isOutsideExtent } from "./util";
|
|
||||||
import { renderDataSourceTile } from "./renderers/renderDataSourceTile";
|
|
||||||
import { getTileWithCaching } from "./renderers/getTileWithCaching";
|
|
||||||
import { stitchTile } from "./renderers/stitchTile";
|
|
||||||
import { createBlankTile } from "./renderers/createBlankTile";
|
import { createBlankTile } from "./renderers/createBlankTile";
|
||||||
|
import { getTileWithCaching } from "./renderers/getTileWithCaching";
|
||||||
|
import { renderDataSourceTile } from "./renderers/renderDataSourceTile";
|
||||||
|
import { stitchTile } from "./renderers/stitchTile";
|
||||||
|
import { TileCache } from "./tileCache";
|
||||||
|
import { BoundingBox, Tile, TileParams } from "./types";
|
||||||
|
import { isOutsideExtent } from "./util";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of all tilesets handled by the tile server
|
* A list of all tilesets handled by the tile server
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { TileParams, RendererFunction, Tile } from "../types";
|
|
||||||
import { TileCache } from "../tileCache";
|
import { TileCache } from "../tileCache";
|
||||||
|
import { RendererFunction, Tile, TileParams } from "../types";
|
||||||
|
|
||||||
|
|
||||||
async function getTileWithCaching(tileParams: TileParams, dataParams: any, tileCache: TileCache, renderTile: RendererFunction): Promise<Tile> {
|
async function getTileWithCaching(tileParams: TileParams, dataParams: any, tileCache: TileCache, renderTile: RendererFunction): Promise<Tile> {
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
import path from 'path';
|
|
||||||
|
|
||||||
import mapnik from "mapnik";
|
import mapnik from "mapnik";
|
||||||
|
import path from 'path';
|
||||||
import { TileParams, Tile, TableDefinitionFunction } from "../types";
|
|
||||||
import { getBbox, TILE_SIZE } from "../util";
|
|
||||||
import { promisify } from "util";
|
import { promisify } from "util";
|
||||||
|
|
||||||
|
import { TableDefinitionFunction, Tile, TileParams } from "../types";
|
||||||
|
import { getBbox, TILE_SIZE } from "../util";
|
||||||
|
|
||||||
|
|
||||||
const TILE_BUFFER_SIZE = 64;
|
const TILE_BUFFER_SIZE = 64;
|
||||||
const PROJ4_STRING = '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over';
|
const PROJ4_STRING = '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import sharp from 'sharp';
|
import sharp from 'sharp';
|
||||||
|
|
||||||
import { TileParams, RendererFunction, Tile } from "../types";
|
import { RendererFunction, Tile, TileParams } from "../types";
|
||||||
import { getBbox, getXYZ, TILE_SIZE } from "../util";
|
import { getBbox, getXYZ, TILE_SIZE } from "../util";
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,12 +16,12 @@
|
|||||||
// Using node-fs package to patch fs
|
// Using node-fs package to patch fs
|
||||||
// for node >10 we could drop this in favour of fs.mkdir (which has recursive option)
|
// for node >10 we could drop this in favour of fs.mkdir (which has recursive option)
|
||||||
// and then use stdlib `import fs from 'fs';`
|
// and then use stdlib `import fs from 'fs';`
|
||||||
|
import { Image } from 'mapnik';
|
||||||
import fs from 'node-fs';
|
import fs from 'node-fs';
|
||||||
import { promisify } from 'util'
|
import { promisify } from 'util'
|
||||||
import { Image } from 'mapnik';
|
|
||||||
|
|
||||||
import { TileParams, BoundingBox } from './types';
|
import { BoundingBox, TileParams } from './types';
|
||||||
import { getXYZ, formatParams } from './util';
|
import { formatParams, getXYZ } from './util';
|
||||||
|
|
||||||
// TODO: switch to modern node and use built-in fs with promise-based API
|
// TODO: switch to modern node and use built-in fs with promise-based API
|
||||||
const readFile = promisify(fs.readFile),
|
const readFile = promisify(fs.readFile),
|
||||||
|
@ -5,10 +5,11 @@
|
|||||||
*/
|
*/
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
|
|
||||||
import { strictParseInt } from '../parse';
|
|
||||||
import { TileParams } from './types';
|
|
||||||
import { renderTile, allTilesets } from './rendererDefinition';
|
|
||||||
import asyncController from '../api/routes/asyncController';
|
import asyncController from '../api/routes/asyncController';
|
||||||
|
import { strictParseInt } from '../parse';
|
||||||
|
|
||||||
|
import { allTilesets, renderTile } from './rendererDefinition';
|
||||||
|
import { TileParams } from './types';
|
||||||
|
|
||||||
const handleTileRequest = asyncController(async function (req: express.Request, res: express.Response) {
|
const handleTileRequest = asyncController(async function (req: express.Request, res: express.Response) {
|
||||||
try {
|
try {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import SphericalMercator from '@mapbox/sphericalmercator';
|
import SphericalMercator from '@mapbox/sphericalmercator';
|
||||||
|
|
||||||
import { TileParams, BoundingBox } from './types';
|
import { BoundingBox, TileParams } from './types';
|
||||||
|
|
||||||
const TILE_SIZE = 256;
|
const TILE_SIZE = 256;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user