2018-10-12 18:18:34 +03:00
|
|
|
---
|
2019-02-04 13:39:57 +03:00
|
|
|
# Connection keep alive timeout [default: 75]
|
2018-10-12 18:18:34 +03:00
|
|
|
keep_alive: 75
|
2019-02-04 13:39:57 +03:00
|
|
|
|
2022-09-28 11:19:23 +03:00
|
|
|
# The socket address to bind [default: 0.0.0.0:3000]
|
2022-12-12 17:11:10 +03:00
|
|
|
listen_addresses: '0.0.0.0:3000'
|
2022-02-13 15:43:52 +03:00
|
|
|
|
2022-09-28 11:19:23 +03:00
|
|
|
# Number of web server workers
|
|
|
|
worker_processes: 8
|
2020-06-02 09:49:21 +03:00
|
|
|
|
2023-12-31 06:48:23 +03:00
|
|
|
# Amount of memory (in MB) to use for caching tiles [default: 512, 0 to disable]
|
|
|
|
cache_size_mb: 8
|
|
|
|
|
2022-12-22 09:35:29 +03:00
|
|
|
# Database configuration. This can also be a list of PG configs.
|
|
|
|
postgres:
|
|
|
|
# Database connection string
|
|
|
|
connection_string: '${DATABASE_URL:postgresql://postgres@localhost:5432/db}'
|
|
|
|
|
|
|
|
# If a spatial table has SRID 0, then this SRID will be used as a fallback
|
|
|
|
default_srid: 4326
|
|
|
|
|
2023-11-19 13:06:37 +03:00
|
|
|
# Maximum Postgres connections pool size [default: 20]
|
2022-12-22 09:35:29 +03:00
|
|
|
pool_size: 20
|
|
|
|
|
2023-08-04 00:51:10 +03:00
|
|
|
auto_publish:
|
|
|
|
tables:
|
|
|
|
from_schemas: autodetect
|
2023-08-13 05:06:23 +03:00
|
|
|
id_columns: [feat_id, big_feat_id]
|
2023-09-21 17:18:09 +03:00
|
|
|
clip_geom: false
|
|
|
|
buffer: 3
|
|
|
|
extent: 9000
|
2023-08-04 00:51:10 +03:00
|
|
|
|
2022-12-22 09:35:29 +03:00
|
|
|
# Associative arrays of table sources
|
|
|
|
tables:
|
|
|
|
table_source:
|
|
|
|
# Table schema (required)
|
|
|
|
schema: public
|
|
|
|
|
|
|
|
# Table name (required)
|
|
|
|
table: table_source
|
|
|
|
|
|
|
|
# Geometry SRID (required)
|
|
|
|
srid: 4326
|
|
|
|
|
|
|
|
# Geometry column name (required)
|
|
|
|
geometry_column: geom
|
|
|
|
|
|
|
|
# Feature id column name
|
|
|
|
id_column: ~
|
|
|
|
|
|
|
|
# An integer specifying the minimum zoom level
|
|
|
|
minzoom: 0
|
|
|
|
|
|
|
|
# An integer specifying the maximum zoom level. MUST be >= minzoom
|
|
|
|
maxzoom: 30
|
|
|
|
|
|
|
|
# The maximum extent of available map tiles. Bounds MUST define an area
|
|
|
|
# covered by all zoom levels. The bounds are represented in WGS:84
|
|
|
|
# latitude and longitude values, in the order left, bottom, right, top.
|
|
|
|
# Values may be integers or floating point numbers.
|
|
|
|
bounds: [-180.0, -90.0, 180.0, 90.0]
|
|
|
|
|
|
|
|
# Tile extent in tile coordinate space
|
|
|
|
extent: 4096
|
|
|
|
|
|
|
|
# Buffer distance in tile coordinate space to optionally clip geometries
|
|
|
|
buffer: 64
|
|
|
|
|
|
|
|
# Boolean to control if geometries should be clipped or encoded as is
|
|
|
|
clip_geom: true
|
|
|
|
|
|
|
|
# Geometry type
|
|
|
|
geometry_type: GEOMETRY
|
|
|
|
|
|
|
|
# List of columns, that should be encoded as tile properties (required)
|
|
|
|
properties:
|
|
|
|
gid: int4
|
|
|
|
|
|
|
|
MixPoints:
|
|
|
|
schema: MIXEDCASE
|
|
|
|
table: MixPoints
|
|
|
|
id_column: giD
|
|
|
|
geometry_column: geoM
|
|
|
|
srid: 4326
|
|
|
|
geometry_type: POINT
|
|
|
|
properties:
|
|
|
|
taBLe: text
|
|
|
|
|
|
|
|
points1:
|
2023-03-13 14:41:25 +03:00
|
|
|
layer_id: abc
|
2022-12-22 09:35:29 +03:00
|
|
|
schema: public
|
|
|
|
table: points1
|
|
|
|
minzoom: 0
|
|
|
|
maxzoom: 30
|
|
|
|
bounds: [-180.0, -90.0, 180.0, 90.0]
|
|
|
|
id_column: ~
|
|
|
|
geometry_column: geom
|
|
|
|
srid: 4326
|
|
|
|
extent: 4096
|
|
|
|
buffer: 64
|
|
|
|
clip_geom: true
|
|
|
|
geometry_type: POINT
|
|
|
|
properties:
|
|
|
|
gid: int4
|
|
|
|
|
|
|
|
points2:
|
|
|
|
schema: public
|
|
|
|
table: points2
|
|
|
|
minzoom: 0
|
|
|
|
maxzoom: 30
|
|
|
|
bounds: [-180.0, -90.0, 180.0, 90.0]
|
|
|
|
id_column: ~
|
|
|
|
geometry_column: geom
|
|
|
|
srid: 4326
|
|
|
|
extent: 4096
|
|
|
|
buffer: 64
|
|
|
|
clip_geom: true
|
|
|
|
geometry_type: POINT
|
|
|
|
properties:
|
|
|
|
gid: int4
|
|
|
|
|
|
|
|
points3857:
|
|
|
|
schema: public
|
|
|
|
table: points3857
|
|
|
|
minzoom: 0
|
|
|
|
maxzoom: 30
|
|
|
|
bounds: [-180.0, -90.0, 180.0, 90.0]
|
|
|
|
id_column: ~
|
|
|
|
geometry_column: geom
|
|
|
|
srid: 3857
|
|
|
|
extent: 4096
|
|
|
|
buffer: 64
|
|
|
|
clip_geom: true
|
|
|
|
geometry_type: POINT
|
|
|
|
properties:
|
|
|
|
gid: int4
|
|
|
|
|
|
|
|
# Associative arrays of function sources
|
|
|
|
functions:
|
|
|
|
function_zxy_query:
|
|
|
|
# Schema name (required)
|
|
|
|
schema: public
|
|
|
|
|
|
|
|
# Function name (required)
|
|
|
|
function: function_zxy_query
|
|
|
|
|
|
|
|
# An integer specifying the minimum zoom level
|
|
|
|
minzoom: 0
|
|
|
|
|
|
|
|
# An integer specifying the maximum zoom level. MUST be >= minzoom
|
|
|
|
maxzoom: 30
|
|
|
|
|
|
|
|
# The maximum extent of available map tiles. Bounds MUST define an area
|
|
|
|
# covered by all zoom levels. The bounds are represented in WGS:84
|
|
|
|
# latitude and longitude values, in the order left, bottom, right, top.
|
|
|
|
# Values may be integers or floating point numbers.
|
|
|
|
bounds: [-180.0, -90.0, 180.0, 90.0]
|
|
|
|
|
|
|
|
function_zxy_query_test:
|
|
|
|
schema: public
|
|
|
|
function: function_zxy_query_test
|
|
|
|
minzoom: 0
|
|
|
|
maxzoom: 30
|
|
|
|
bounds: [-180.0, -90.0, 180.0, 90.0]
|
2023-01-08 22:19:11 +03:00
|
|
|
|
2023-12-07 10:24:51 +03:00
|
|
|
fnc_Mixed_Name:
|
|
|
|
schema: MixedCase
|
|
|
|
function: function_Mixed_Name
|
|
|
|
|
|
|
|
|
2023-01-08 22:19:11 +03:00
|
|
|
pmtiles:
|
2023-12-22 09:01:50 +03:00
|
|
|
paths:
|
|
|
|
- http://localhost:5412/webp2.pmtiles
|
2023-01-08 22:19:11 +03:00
|
|
|
sources:
|
2023-09-29 21:37:18 +03:00
|
|
|
pmt: tests/fixtures/pmtiles/stamen_toner__raster_CC-BY+ODbL_z3.pmtiles
|
2023-12-22 09:01:50 +03:00
|
|
|
pmt2: http://localhost:5412/webp2.pmtiles
|
Add dynamic sprites support (#715)
Dynamically create image sprites for MapLibre rendering, given a
directory with images.
### TODO
* [x] Work with @flother to merge these PRs
* [x] https://github.com/flother/spreet/pull/59 (must have)
* [x] https://github.com/flother/spreet/pull/57
* [x] https://github.com/flother/spreet/pull/56
* [ ] https://github.com/flother/spreet/pull/62 (not required but nice
to have, can upgrade later without any code changes)
* [x] Add docs to the book
* [x] Add CLI param, e.g. `--sprite <dir_path>`
* [x] Don't output `.sprites` in auto-genned config when not in use
### API
Per [MapLibre sprites
API](https://maplibre.org/maplibre-style-spec/sprite/), we need to
support the following:
* `/sprite/<sprite_id>.json` metadata about the sprite file - all coming
from a single directory
* `/sprite/<sprite_id>.png` all images combined into a single PNG
* `/sprite/<sprite_id>@2x.json` same but for high DPI devices
* `/sprite/<sprite_id>@2x.png`
Multiple sprite_id values can be combined into one sprite with the same
pattern as for tile joining:
`/sprite/<sprite_id1>,<sprite_id2>,...,<sprite_idN>[.json|.png|@2x.json|@2x.png]`.
No ID renaming is done, so identical names will override one another.
### Configuration
[Config file](https://maplibre.org/martin/config-file.html) and possibly
CLI should have a simple option to serve sprites. The configuration may
look similar to how mbtiles and pmtiles are configured:
```yaml
# Publish sprite images
sprites:
paths:
# scan this whole dir, matching all image files, and publishing it as "my_images" sprite source
- /path/to/my_images
sources:
# named source matching source name to a directory
my_sprites: /path/to/some_dir
```
Implement #705
2023-06-16 15:19:47 +03:00
|
|
|
|
|
|
|
sprites:
|
|
|
|
paths: tests/fixtures/sprites/src1
|
|
|
|
sources:
|
|
|
|
mysrc: tests/fixtures/sprites/src2
|
Implement dynamic font support `/font/<name>/<start>-<end>` (#755)
This implements dynamic font protobuf generation, allowing users to
request font ranges on the fly, and combining them in any order, e.g.
`Font1,Font2,Font3`, same as with sprites and tiles
This is a first iteration, without any multithreading support. In
theory, this could be done far faster by generating SDFs with multiple
threads.
### Current process
* during init, figure out all glyphs available in each font, and store
them as a bitset
* during request:
* combine requested bitsets to figure out which glyph should come from
which font file
* load those glyphs from files (using a single instance of the freetype
lib)
* convert them to SDFs and package them into a protobuf
---------
Co-authored-by: Lucas <zhangyijunmetro@hotmail.com>
2023-10-28 08:10:48 +03:00
|
|
|
|
|
|
|
fonts:
|
|
|
|
- tests/fixtures/fonts/overpass-mono-regular.ttf
|
|
|
|
- tests/fixtures/fonts
|