-
-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add documentation and improve legibility style.lua #345
Conversation
fb3257e
to
b205d90
Compare
b205d90
to
535755c
Compare
This allows the decision whether an object is treated as polygon or linestring to be set in the style.lua file. In particular, it treats man_made=embankment and natural=cliff as linestring, and highway=services as polygon. Including this in the default style.lua file has the following advantages: * It serves as an easy-to-extend example of how the polygon/linestring decision can be made based on key. * It provides sane defaults - it can be expeced that most users of the style want to treat man_made=embankment and natural=cliff as linestring, and highway=services as polygon. This resolves the following downstream bugs in openstreetmap-carto: * gravitystorm/openstreetmap-carto#892 * gravitystorm/openstreetmap-carto#268 * gravitystorm/openstreetmap-carto#137 This builds on osm2pgsql-dev#345, and thus assumes osm2pgsql-dev#345 is merged first.
This allows the decision whether an object is treated as polygon or linestring to be set in the style.lua file. In particular, it treats man_made=embankment and natural=cliff as linestring, and highway=services as polygon. Including this in the default style.lua file has the following advantages: * It serves as an easy-to-extend example of how the polygon/linestring decision can be made based on key. * It provides sane defaults - it can be expected that most users of the style want to treat man_made=embankment and natural=cliff as linestring, and highway=services as polygon. This resolves the following downstream bugs in openstreetmap-carto: * gravitystorm/openstreetmap-carto#892 * gravitystorm/openstreetmap-carto#268 * gravitystorm/openstreetmap-carto#137 This builds on osm2pgsql-dev#345, and thus assumes osm2pgsql-dev#345 is merged first.
keyvalues, roads = add_z_order(keyvalues) | ||
|
||
return filter, keyvalues, membersuperseeded, boundary, polygon, roads | ||
return filter, keyvalues, membersuperseded, boundary, polygon, roads |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boundary needs changing here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed.
This variable name was overlooked when changing variable names in 535755c.
This allows the decision whether an object is treated as polygon or linestring to be set in the style.lua file. In particular, it treats man_made=embankment and natural=cliff as linestring, and highway=services as polygon. Including this in the default style.lua file has the following advantages: * It serves as an easy-to-extend example of how the polygon/linestring decision can be made based on key. * It provides sane defaults - it can be expected that most users of the style want to treat man_made=embankment and natural=cliff as linestring, and highway=services as polygon. This resolves the following downstream bugs in openstreetmap-carto: * gravitystorm/openstreetmap-carto#892 * gravitystorm/openstreetmap-carto#268 * gravitystorm/openstreetmap-carto#137 This builds on osm2pgsql-dev#345, and thus assumes osm2pgsql-dev#345 is merged first.
polygon_keys = { 'building', 'landuse', 'amenity', 'harbour', 'historic', 'leisure', | ||
'man_made', 'military', 'natural', 'office', 'place', 'power', | ||
'public_transport', 'shop', 'sport', 'tourism', 'waterway', | ||
'wetland', 'water', 'aeroway' } | ||
|
||
-- Objects without any of the following keys will be deleted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with --hstore-all
is this true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is true. Objects without any key in this list will be skipped, even if there is a column name for that key.
Moreover, objects that do have a key in the list, but no column name (for example an object tagged with capital=yes and hstore_tag=test) will be skipped too.
Add documentation and improve legibility style.lua
This allows the decision whether an object is treated as polygon or linestring to be set in the style.lua file. In particular, it treats man_made=embankment and natural=cliff as linestring, and highway=services as polygon. Including this in the default style.lua file has the following advantages: * It serves as an easy-to-extend example of how the polygon/linestring decision can be made based on key. * It provides sane defaults - it can be expected that most users of the style want to treat man_made=embankment and natural=cliff as linestring, and highway=services as polygon. This resolves the following downstream bugs in openstreetmap-carto: * gravitystorm/openstreetmap-carto#892 * gravitystorm/openstreetmap-carto#268 * gravitystorm/openstreetmap-carto#137 This builds on osm2pgsql-dev#345, and thus assumes osm2pgsql-dev#345 is merged first.
This allows the decision whether an object is treated as polygon or linestring to be set in the style.lua file. In particular, it treats man_made=embankment and natural=cliff as linestring, and highway=services as polygon. Including this in the default style.lua file has the following advantages: * It serves as an easy-to-extend example of how the polygon/linestring decision can be made based on key. * It provides sane defaults - it can be expected that most users of the style want to treat man_made=embankment and natural=cliff as linestring, and highway=services as polygon. This resolves the following downstream bugs in openstreetmap-carto: * gravitystorm/openstreetmap-carto#892 * gravitystorm/openstreetmap-carto#268 * gravitystorm/openstreetmap-carto#137 This builds on osm2pgsql-dev#345, and thus assumes osm2pgsql-dev#345 is merged first.
This adds documentation to style.lua.
It also has some small changes to improve the legibility: it moves the configurable arrays to the top, and it changes some variable names.