See the Flex Output chapter in the manual for all the details.
This directory contains example config files for the flex output. All config files are documented extensively with inline comments.
If you are learning about the flex output, read the config files in the following order (from easiest to understand to the more complex ones):
- simple.lua -- Introduction to config file format
- geometries.lua -- Geometry column options
- data-types.lua -- Data types and how to handle them
After that you can dive into more advanced topics:
- public-transport.lua -- Use multi-stage processing to bring tags from public transport relations to member nodes and ways
- route-relations.lua -- Use multi-stage processing to bring tags from relations to member ways
- unitable.lua -- Put all OSM data into a single table
- places.lua -- Creating JSON/JSONB columns
- with-schema.lua -- Use a database schema
- attributes.lua -- How to access OSM object attributes
The "generic" configuration is a full-featured but simple configuration that is a good starting point for your own real-world configuration:
The following config file tries to be more or less compatible with the old pgsql (C transform) output:
The other files demonstrate some specific functionality, look at these if and when you need that functionality.
- addresses.lua -- Get all objects with addresses and store as point objects in the database
- bbox.lua -- Use of the
get_bbox()
function to get the bounding boxes of features - expire.lua -- Tile expiry configuration
- indexes.lua -- Various options around index creation
- labelpoint.lua -- How to get good labelling points using
the
centroid()
andpole_of_inaccessibility()
functions. - untagged -- How to access untagged objects.
The subdirectory gen contains example configurations for generalization support.
Some of the example files use the inspect
Lua library to show debugging
output. It is not needed for the actual functionality of the examples, so if
you don't have the library, you can remove all uses of inspect
and the
scripts should still work.
The library is available from the
source or using
LuaRocks. Debian/Ubuntu users
can install the lua-inspect
package.
All the example config files in this directory are released into the Public Domain. You may use them in any way you like.