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

Method for separating highways with multiple shields #21

Open
PetersonGIS opened this issue Feb 28, 2018 · 6 comments
Open

Method for separating highways with multiple shields #21

PetersonGIS opened this issue Feb 28, 2018 · 6 comments
Assignees

Comments

@PetersonGIS
Copy link
Collaborator

When a highway has multiple names/numbers they are separated with a semicolon in the name field. This renders as a single highway shield with many numbers whereas it should render separate shields for each name along the line.

@PetersonGIS PetersonGIS self-assigned this Feb 28, 2018
@PetersonGIS
Copy link
Collaborator Author

Options:

  • Leave highways unlabeled (e.g., OpenStreetMap Humanitarian style)
  • Label with first ref only (e.g., OSM Liberty style)
  • Replace semicolons with carriage returns and display all refs in expandable shield boxes, expanding vertically (e.g., OpenStreetMap Standard style)
  • Split multiple refs into separate columns and style each such that multiple shields are present on, for example, I 70 in Colorado (e.g., Google Maps). Potentially use PostgreSQL split_part.

Read more about the semicolon separator in OpenStreetMap here: https://wiki.openstreetmap.org/wiki/Semi-colon_value_separator

@PetersonGIS
Copy link
Collaborator Author

Using the split_part function in the config.toml we can do something like this:

[[providers.layers]] name = "transport_lines_11-12" geometry_fieldname = "geometry" id_fieldname = "osm_id" sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, ref, class, type, tunnel, bridge, access, service, split_part(ref,';',1) ref1, split_part(ref, ';',2) ref2, split_part(ref, ';',3) ref3, split_part(ref, ';',4) ref4 FROM osm_transport_lines WHERE type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'rail', 'taxiway', 'runway', 'apron') AND geometry && !BBOX!"

The style.json can then reference the 4 different ref fields to place individual shields.

Shields in existing camo style that need to be fixed:
roadshields_camo_before

Shields after the ref field is parsed out and the style is modified:

roadshields_camo_after

@ARolek
Copy link
Member

ARolek commented Mar 23, 2018

@PetersonGIS did you have a PR you want to send in for this one? Looks like a great way to clean up some of the highway carto.

@PetersonGIS
Copy link
Collaborator Author

Yes indeed. See above link to #45. The PR is just in the tegola-osm repo for now. Will PR for the style change once that's done I guess.

@ARolek
Copy link
Member

ARolek commented Mar 24, 2018

@PetersonGIS I see. I will review that PR early next week.

@PetersonGIS
Copy link
Collaborator Author

Just waiting on tiles to be re-run, then I'll test out the style changes. @ARolek if you can just ping me when the ref1, ref2, etc. is live in https://osm.tegola.io

@ARolek ARolek removed their assignment Sep 6, 2023
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

No branches or pull requests

2 participants