Skip to content

Commit 184a586

Browse files
committed
Expand default.style documentation
These changes are purely in comments and the unused nocache flag Fixes #66
1 parent 20a4a1d commit 184a586

1 file changed

Lines changed: 78 additions & 52 deletions

File tree

default.style

Lines changed: 78 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,94 @@
1-
# This is the style file that matches the old version of osm2pgsql, which
2-
# did not make distinctions between tags for nodes and for ways. There are a
3-
# number of optimisations that can be applied here. Firstly, certain tags
4-
# only apply to only nodes or only ways. By fixing this we reduce the amount
5-
# of useless data loaded into the DB, which is a good thing. Possible
6-
# optimisations for the future:
7-
8-
# 1. Generate this file directly from the mapnik XML config, so it's always
9-
# optimal
10-
11-
# 2. Extend it so it can understand that highway=tertiary is for ways and
12-
# highway=bus_stop is for nodes
13-
14-
# Flags field isn't used much yet, expect if it contains the text "polygon"
15-
# it indicates the shape is candidate for the polygon table. In the future I
16-
# would like to be able to add directives like "nocache" which tells
17-
# osm2pgsql that it is unlikely this node will be used by a way and so it
18-
# doesn't need to be stored (eg coastline nodes). While in essence an
19-
# optimisation hack, for --slim mode it doesn't matter if you're wrong, but
20-
# in non-slim you might break something!
21-
22-
# Also possibly an ignore flag, for things like "note" and "source" which
23-
# can simply be deleted. (In slim mode this is, does not apply to non-slim
24-
# obviously)
1+
# This is the default osm2pgsql .style file that comes with osm2pgsql.
2+
#
3+
# A .style file has 4 columns that define how OSM objects end up in tables in
4+
# the database and what columns are created. It interacts with the command-line
5+
# hstore options.
6+
#
7+
# Columns
8+
# =======
9+
#
10+
# OsmType: This is either "node", "way" or "node,way" and indicates if this tag
11+
# applies to nodes, ways, or both.
12+
#
13+
# Tag: The tag
14+
#
15+
# DataType: The type of the column to be created. Normally "text"
16+
#
17+
# Flags: Flags that indicate what table the OSM object is moved into.
18+
#
19+
# There are 5 possible flags. These flags are used both to indicate if a column
20+
# should be created, and if ways with the tag are assumed to be areas. The area
21+
# assumptions can be overridden with an area=yes/no tag
22+
#
23+
# polygon - Create a column for this tag, and objects the tag with are areas
24+
#
25+
# linear - Create a column for this tag
26+
#
27+
# phstore - Don't create a column for this tag, but objects with the tag are areas
28+
#
29+
# delete - Drop this tag completely and don't create a column for it. This also
30+
# prevents the tag from being added to hstore columns
31+
#
32+
# nocache - Deprecated and does nothing
33+
#
34+
# If an object has a tag that indicates it is an area or has area=yes/1,
35+
# osm2pgsql will try to turn it into an area. If it succeeds, it places it in
36+
# the polygon table. If it fails (e.g. not a closed way) it places it in the
37+
# line table.
38+
#
39+
# Nodes are never placed into the polygon or line table and are always placed in
40+
# the point table.
41+
#
42+
# Hstore
43+
# ======
44+
#
45+
# The options --hstore, --hstore-match-only, and --hstore-all interact with
46+
# the .style file.
47+
#
48+
# With --hstore any tags without a column will be added to the hstore column.
49+
# This will also cause all objects to be kept.
50+
#
51+
# With --hstore-match-only the behavior for tags is the same, but objects are
52+
# only kept if they have a non-NULL value in one of the columns.
53+
#
54+
# With --hstore-all all tags are added to the hstore column unless they appear
55+
# in the style file with a delete flag, causing duplication between the normal
56+
# columns and the hstore column.
57+
#
58+
# Special database columns
59+
# ========================
60+
#
61+
# There are some special database columns that if present in the .style file
62+
# will be populated by osm2pgsql.
63+
#
64+
# These are
65+
#
66+
# z_order - datatype int4
67+
#
68+
# way_area - datatype real. The area of the way, in the units of the projection
69+
# (e.g. square mercator meters). Only applies to areas
70+
#
71+
# osm_user, osm_uid, osm_version, osm_timestamp - datatype text. Used with the
72+
# --extra-attributes option to include metadata in the database. If importing
73+
# with both --hstore and --extra-attributes the meta-data will end up in the
74+
# tags hstore column regardless of the style file.
2575

2676
# OsmType Tag DataType Flags
2777
node,way note text delete # These tags can be long but are useless for rendering
28-
node,way source text delete # This indicates that we shouldn't store them
78+
node,way source text delete
2979
node,way created_by text delete
3080

3181
node,way access text linear
3282
node,way addr:housename text linear
3383
node,way addr:housenumber text linear
34-
node,way addr:interpolation text linear
84+
node,way addr:interpolation text linear
3585
node,way admin_level text linear
3686
node,way aerialway text linear
3787
node,way aeroway text polygon
38-
node,way amenity text nocache,polygon
88+
node,way amenity text polygon
3989
node,way area text # hard coded support for area=1/yes => polygon is in osm2pgsql
4090
node,way barrier text linear
41-
node,way bicycle text nocache
91+
node,way bicycle text
4292
node,way brand text linear
4393
node,way bridge text linear
4494
node,way boundary text linear
@@ -98,27 +148,3 @@ node,way width text linear
98148
node,way wood text linear
99149
node,way z_order int4 linear # This is calculated during import
100150
way way_area real # This is calculated during import
101-
102-
# If you're interested in bicycle routes, you may want the following fields
103-
# To make these work you need slim mode or the necessary data won't be remembered.
104-
#way lcn_ref text linear
105-
#way rcn_ref text linear
106-
#way ncn_ref text linear
107-
#way lcn text linear
108-
#way rcn text linear
109-
#way ncn text linear
110-
#way lwn_ref text linear
111-
#way rwn_ref text linear
112-
#way nwn_ref text linear
113-
#way lwn text linear
114-
#way rwn text linear
115-
#way nwn text linear
116-
#way route_pref_color text linear
117-
#way route_name text linear
118-
119-
# The following entries can be used with the --extra-attributes option
120-
# to include the username, userid, version & timstamp in the DB
121-
#node,way osm_user text
122-
#node,way osm_uid text
123-
#node,way osm_version text
124-
#node,way osm_timestamp text

0 commit comments

Comments
 (0)