mirror of
https://github.com/maplibre/martin.git
synced 2024-12-19 12:51:37 +03:00
2ee517d135
Can now handle several additional Postgres functions to get a tile, plus tons of small fixes ### Multiple result variants * `getmvt(z,x,y) -> [bytea,md5]` (single row with two columns) * `getmvt(z,x,y) -> [bytea]` (single row with a single column) * `getmvt(z,x,y) -> bytea` (value) ### Multiple input parameter variants * `getmvt(z, x, y)` or `getmvt(zoom, x, y)` (all 3 vars must be integers) * `getmvt(z, x, y, url_query)`, where instead of `url_query` it could be any other name, but must be of type JSON ### Breaking * srid is now the same type as PG -- `i32` * renamed config vals `table_sources` and `function_sources` into `tables` and `functions` ### Features and fixes * if postgis is v3.1+, uses margin parameter to extend the search box by the size of the buffer. I think we should make 3.1 minimal required. * fixes feature ID issue from #466 * fixes mixed case names for schemas, tables and columns, functions and parameter names per #389 ### Notes * More dynamic SQL generation in code instead of using external SQL files. Those should only be used when they are not parametrized. * The new function/table discovery mechanism: query for all functions in the database, and match up those functions with the ones configured (if any), plus adds all the rest of the un-declared ones if discovery mode is on. * During table and function discovery, the code generates a map of `(PgSqlInfo, FunctionInfo)` (or table) tupples containing SQL needed to get the tile. * Auto-discovery mode is currently hidden - the discovery is on only when no tables or functions are configured. TBD - how to configure it in the future * The new system allows for an easy way to auto-discover for the specific schemas only, solving #47 * predictable order of table/function instantiation * bounding boxes computed in parallel for all tables (when not configured) * proper identifier escaping * test cleanup fixes #378 fixes #466 fixes #65 fixes #389
154 lines
3.6 KiB
YAML
154 lines
3.6 KiB
YAML
---
|
|
# Database connection string
|
|
connection_string: 'postgres://postgres@localhost:5432/db'
|
|
|
|
# Trust invalid certificates. This introduces significant vulnerabilities, and should only be used as a last resort.
|
|
danger_accept_invalid_certs: false
|
|
|
|
# If a spatial table has SRID 0, then this SRID will be used as a fallback
|
|
default_srid: 4326
|
|
|
|
# Connection keep alive timeout [default: 75]
|
|
keep_alive: 75
|
|
|
|
# The socket address to bind [default: 0.0.0.0:3000]
|
|
listen_addresses: 0.0.0.0:3000
|
|
|
|
# Maximum connections pool size [default: 20]
|
|
pool_size: 20
|
|
|
|
# Number of web server workers
|
|
worker_processes: 8
|
|
|
|
# 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:
|
|
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]
|