Skip to content
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

Merged
merged 2 commits into from
May 24, 2015

Conversation

matthijsmelissen
Copy link
Contributor

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.

matthijsmelissen added a commit to matthijsmelissen/osm2pgsql that referenced this pull request Apr 28, 2015
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.
matthijsmelissen added a commit to matthijsmelissen/osm2pgsql that referenced this pull request Apr 28, 2015
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
Copy link
Collaborator

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

Copy link
Contributor Author

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.
matthijsmelissen added a commit to matthijsmelissen/osm2pgsql that referenced this pull request Apr 28, 2015
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
Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will check.

Copy link
Contributor Author

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.

pnorman added a commit that referenced this pull request May 24, 2015
Add documentation and improve legibility style.lua
@pnorman pnorman merged commit 97a48f9 into osm2pgsql-dev:master May 24, 2015
matthijsmelissen added a commit to matthijsmelissen/osm2pgsql that referenced this pull request Feb 21, 2016
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.
matthijsmelissen added a commit to matthijsmelissen/osm2pgsql that referenced this pull request Apr 3, 2016
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants