Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Increase character limit for shields #937

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 9 comments
Closed

Increase character limit for shields #937

openstreetmap-trac opened this issue Jul 23, 2021 · 9 comments

Comments

@openstreetmap-trac
Copy link

Reporter: craigermcgreger[at]yahoo.com
[Submitted to the original trac issue database at 6.38am, Thursday, 29th May 2008]

For a number of months, I have been trying to figure out why, for seemingly no reason, shields are not rendered in Mapnik for certain highways, even though they render correctly for surrounding highways.

I have been playing around to see if it was a tag or a combination of tag values that was causing this behavior, to no avail.

At one point, I thought it might be that a shield would not render if the "ref" tag was more than five characters long, but I no longer believe this.

The following are just several examples that I have found of highways that I think should be getting shields but are not:

  • [http://www.openstreetmap.org/?lat=39.27428&lon=-76.81548&zoom=15 Columbia Pike] should have a "US 29" shield.
  • [http://www.openstreetmap.org/?lat=39.34302&lon=-76.84157&zoom=15 Old Court Road] should have an "MD 125" shield.
  • [http://www.openstreetmap.org/?lat=39.19803&lon=-76.92384&zoom=15 Patuxent Parkway] should have an "MD 32" shield. (Note that a shield does render for the adjacent "primary" (red) section of MD 32 to the NW of this section.)
  • [http://www.openstreetmap.org/?lat=39.24175&lon=-76.81114&zoom=15 State Highway 100] should have an "MD 100" shield.
  • [http://www.openstreetmap.org/?lat=39.21805&lon=-76.69939&zoom=15 Interstate 895] should have an "I-895" shield, and, on the same screen, Interstate 195 should have an "I-195" shield.
  • [http://www.openstreetmap.org/?lat=39.23723&lon=-76.67733&zoom=15 Washington Boulevard] should have an "ALT US 1" shield.
@openstreetmap-trac
Copy link
Author

Author: tom[at]compton.nu
[Added to the original trac issue at 10.44pm, Thursday, 29th May 2008]

There is certainly a length limit as I have only rendered the shield images up to a certain width. I'd have to check the source to see what that limt is though.

@openstreetmap-trac
Copy link
Author

Author: tom[at]compton.nu
[Added to the original trac issue at 10.54pm, Thursday, 29th May 2008]

The current limit is 4 for motorways and 5 for everything else. The worst case in your examples seems to be a trunk with an 8 character reference?

My only concern (other than all the duplication in the stylesheet) is that the shields are going to start getting pretty big if we allow that many characters...

@openstreetmap-trac
Copy link
Author

Author: craigermcgreger[at]yahoo.com
[Added to the original trac issue at 4.54pm, Friday, 30th May 2008]

Replying to [comment:2 tom[at]compton.nu]:

The current limit is 4 for motorways and 5 for everything else.

Ahh, that explains a lot. This has been driving me crazy for a long time...I should have come here sooner. :)

My only concern (other than all the duplication in the stylesheet) is that the shields are going to start getting pretty big if we allow that many characters...

Sorry, I am not familiar with the stylesheet.

As for the limit: in cases like this, I am not a fan of arbitrary limits. Who is to say what is too long? One person's legitimate need for a, say, 14-character shield may be another person's "too long". I would prefer that there were no limits, and shields that are perceived as being too long be addressed on a case-by-case basis.

If there has to be a limit, however, 16 characters seems to be a good place to start. As you can see from the above, I have a legitimate need for 8-character shields; there is a possibility of longer shields, as we have some four-digit routes that must fit on to shields, spaces and all.

@openstreetmap-trac
Copy link
Author

Author: tom[at]compton.nu
[Added to the original trac issue at 5.47pm, Friday, 30th May 2008]

Because the shields are fixed bitmaps we have to pregenerate each one in varying widths to allow for the different sizes of reference that we may need to fit on them. That then means that we need to duplicate the logic for rendering shields for each length so that it can choose the right bitmap to render under the text.

That's why I'm not keen on adding more widths than are strictly needed...

Hopefully at some point mapnik will support the use of vector images that can be resized as required to fit the text.

@openstreetmap-trac
Copy link
Author

Author: craigermcgreger[at]yahoo.com
[Added to the original trac issue at 8.29pm, Friday, 30th May 2008]

Replying to [comment:4 tom[at]compton.nu]:

Because the shields are fixed bitmaps we have to pregenerate each one in varying widths to allow for the different sizes of reference that we may need to fit on them. That then means that we need to duplicate the logic for rendering shields for each length so that it can choose the right bitmap to render under the text. That's why I'm not keen on adding more widths than are strictly needed...

Ahh, I was not aware that the shields were generated in this manner. That definitely precludes unlimited shield length!

However, while I understand and sympathize with the current situation, four and five characters is just too few for most of my shields. While I suggested 16 characters earlier, six would be a good start, and eight would make my day. For that matter, simply removing the four-character limit for motorways and letting them use five would go a long way.

Thanks for your help.

@openstreetmap-trac
Copy link
Author

Author: tomhughes
[Added to the original trac issue at 9.07pm, Friday, 30th May 2008]

(In [8007]) Support shields up to 6 characters for motorways and 8 characters for
other road types. Closes #937.

@openstreetmap-trac
Copy link
Author

Author: chriscf
[Added to the original trac issue at 1.32pm, Friday, 10th October 2008]

Re-opening. We have some strays in the UK for which this isn't rendering. They include little things such as "A404(M)", and more major entities such as "M6 Toll" (which properly includes a space". I believe that the only eight-character refs we have had were "A6127(M)" and "A6144(M)", of which the former has been renumbered and the latter downgraded, however, it remains possible that another four-digit A-road is upgraded in future, or a two-digit motorway by-passed with a toll road, so eight characters needs to be supported on motorways too.

@openstreetmap-trac
Copy link
Author

Author: chriscf
[Added to the original trac issue at 2.42pm, Friday, 17th October 2008]

Examples: [http://www.openstreetmap.org/?lat=52.6489&lon=-1.8497&zoom=12&layers=B000FTF M6 Toll] [http://www.openstreetmap.org/?lat=51.4317&lon=-0.8589&zoom=12&layers=B000FTF A329(M)] [http://www.openstreetmap.org/?lat=51.4987&lon=-0.7404&zoom=13&layers=B000FTF A308(M) A404(M)] [http://www.openstreetmap.org/?lat=54.9289&lon=-1.5275&zoom=13&layers=B000FTF A194(M)] [http://www.openstreetmap.org/?lat=54.97767&lon=-1.60822&zoom=15&layers=B000FTF A167(M)] [http://www.openstreetmap.org/?lat=54.13364&lon=-2.75239&zoom=15&layers=B000FTF A601(M)] [http://www.openstreetmap.org/?lat=56.0428&lon=-3.4138&zoom=14&layers=B000FTF A823(M)].

@openstreetmap-trac
Copy link
Author

Author: steve8[at]mdx.ac.uk
[Added to the original trac issue at 7.53pm, Sunday, 21st June 2009]

Now all resolved

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant