Skip to content

Commit

Permalink
Minor update to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rustprooflabs committed Nov 1, 2021
1 parent acb779a commit b1bca6f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 29 deletions.
28 changes: 2 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,33 +202,9 @@ running without Docker.

## Layer Sets

Layer sets are defined under the directory [pgosm-flex/flex-config/](https://github.com/rustprooflabs/pgosm-flex/tree/main/flex-config), the current `run-*` options are:

* `run-all`
* `run-no-tags`
* `run-road-place`
* `run-unitable`

Each of these layer sets includes the core layer defintions
(see `style/*.lua`)
and post-processing SQL (see `sql/*.sql`).
The `.lua` scripts work with osm2pgsql's Flex output.
PgOSM-Flex is using these styles with a mix-and-match approach.
This is best illustrated by looking within the main `run-all.lua` script.
As the following shows, it does not define any actual styles, only includes
a single style, and runs another layer set (`run-no-tags`).


```lua
require "style.tags"
require "run-no-tags"
```

The `style.tags` script creates a table `osm.tags` that contains all OSM key/value
pairs, but with no geometry. This is the largest table loaded by the `run-all`
layer set and enables joining any OSM data in another layer (e.g. `osm.road_line`)
to find any additional tags.

PgOSM Flex includes a few layersets and makes it easy to customize your own.
See [docs/LAYERSETS.md](docs/LAYERSETS.md) for details.



Expand Down
25 changes: 22 additions & 3 deletions docs/LAYERSETS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
## PgOSM Flex layersets
# PgOSM Flex layersets

A layerset defines one or more layers, where each layer includes
one or more tables and/or views.
Layers are defined by a matched pair of Lua and SQL scripts. For example,
the road layer is defined by `flex-config/style/road.lua` and
`flex-config/sql/road.sql`.


Layersets are defined in `.ini` files.


## Included layersets

A few layersets are included with PgOSM Flex under `flex-config/layerset/`.
If the `--layerset` is not defined, the `default` layerset is used.

* `minimal`
* `basic`
* `default`
* `everything`


## Custom layerset

Layersets are defined in `.ini` files. A few layersets are included with PgOSM Flex under
`flex-config/layerset/`.

A layerset including the `poi` and `road_major` layers would look
like:
Expand All @@ -17,3 +35,4 @@ road_major=true

Layers not listed in the layerset `.ini` are not included.


0 comments on commit b1bca6f

Please sign in to comment.