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

Merge areaSymbol and symbol, areaText and Text (patch included) #1446

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

Comments

@openstreetmap-trac
Copy link

Reporter: R2D2_C3PO
[Submitted to the original trac issue database at 7.45pm, Wednesday, 7th January 2009]

Osmarender currently has a lot of dupplicate rules, because one is needed for nodes and one for ways. This patch changes the or/p behaviour:

works for both ways and nodes.
is no longer needed but kept for compatibility with old stylefiles.
keeps its old meaning (labeling streets, etc).
now works on nodes too.
works on both nodes and ways.

A bug in orp-select.pm is fixed, so it does not fail on e="node|way".

The current z17 stylesheet is converted to the new syntax. Also some improvements in rendering are done as a result (same rendering of amenity=theatre for ways and nodes).

xslt still needs changes.

@openstreetmap-trac
Copy link
Author

Author: R2D2_C3PO
[Added to the original trac issue at 10.35pm, Wednesday, 7th January 2009]

updated to work with xslt

@openstreetmap-trac
Copy link
Author

Author: bob[at]cakebox.net
[Added to the original trac issue at 6.43pm, Sunday, 11th January 2009]

Just a small thing: If there should be one instruction to draw text for points and areas I'd rather call it something like pointText instead of areaText.

Or maybe the text instruction should be renamed pathText and the other one could be text, that would probably be the most logical, although it would require changes to all osmarender stylesheets simultaneously, which we shouldn't count on being possible.

@openstreetmap-trac
Copy link
Author

Author: bob[at]cakebox.net
[Added to the original trac issue at 11.28am, Monday, 12th January 2009]

Replying to [comment:2 bob[at]cakebox.net]:

Just a small thing: If there should be one instruction to draw text for points and areas I'd rather call it something like pointText instead of areaText.

Or maybe the text instruction should be renamed pathText and the other one could be text, that would probably be the most logical, although it would require changes to all osmarender stylesheets simultaneously, which we shouldn't count on being possible.

One way to change these without breaking backwards compatibility would be to call the methods pointText and pathText, add a wrapper called text that calls pathText and one called areaText that calls pointText.

That way old stylesheets keep working, and the proper function names get suitable names that better explain what they do.

@openstreetmap-trac
Copy link
Author

Author: R2D2_C3PO
[Added to the original trac issue at 3.46pm, Monday, 12th January 2009]

Replying to [comment:3 bob[at]cakebox.net]:

One way to change these without breaking backwards compatibility would be to call the methods pointText and pathText, add a wrapper called text that calls pathText and one called areaText that calls pointText.

Calling it point text is as bad as calling it areaText, as it works on both points and areas.

Here's summary what works where:

Before:[[BR]]
text: ways (places label along path, e.g. for labeling streets), nodes (places text at node's position)[[BR]]
areaText: ways (places label at the center of the way)

After:[[BR]]
text: ways, nodes (unchanged)[[BR]]
areaText:'' ways (center of area), nodes (just like ''text)

So it would be best to rename text'' to ''pathText'' (because it's no longer needed for nodes) and rename ''areaText'' to ''text. However this will lead to confusion and all styles have to be updated at the same time.

@openstreetmap-trac
Copy link
Author

Author: bob[at]cakebox.net
[Added to the original trac issue at 3.49pm, Monday, 12th January 2009]

Replying to [comment:4 R2D2_C3PO]:

Replying to [comment:3 bob[at]cakebox.net]:

One way to change these without breaking backwards compatibility would be to call the methods pointText and pathText, add a wrapper called text that calls pathText and one called areaText that calls pointText.

Calling it point text is as bad as calling it areaText, as it works on both points and areas.

No, because areaText just computes a point and puts text there, so it's not too wrong to call that pointText.

@openstreetmap-trac
Copy link
Author

Author: R2D2_C3PO
[Added to the original trac issue at 3.43pm, Tuesday, 13th January 2009]

How about this: areaText'' is called ''label because you usually use it to put a label somewhere. And we keep the old name as an alias for some time to maintain compatibility?

@openstreetmap-trac
Copy link
Author

Author: R2D2_C3PO
[Added to the original trac issue at 6.28pm, Friday, 16th January 2009]

Added a patch that uses pathText' and 'caption (because most styles are already named caption-...).

@openstreetmap-trac
Copy link
Author

Author: osm[at]petschge.de
[Added to the original trac issue at 4.49pm, Friday, 23rd January 2009]

I'll apply this patch this weekend. If you could regenerate the patch against the current state in svn I would be glad, otherwise I'll have to handle the conflicts myself.

@openstreetmap-trac
Copy link
Author

Author: osm[at]petschge.de
[Added to the original trac issue at 12.32pm, Saturday, 24th January 2009]

The changes to the code and the changes to the z17 stylesheet are in along with some whitespace cleanup. Further cleanups of the stylesheets are of course welcome.

@openstreetmap-trac
Copy link
Author

Author: R2D2_C3PO
[Added to the original trac issue at 12.16am, Sunday, 25th January 2009]

You missed an important part of my patch. The drawCircle function in XSLT needs 2 more parameters now, as otherwise the output will be like this:
<circle cx="NaN" cy="NaN" r="0.9px" ...
which is wrong SVG and crashes Inkscape. A diff with only the relevant patch is attached.

@openstreetmap-trac
Copy link
Author

Author: R2D2_C3PO
[Added to the original trac issue at 1.12am, Sunday, 25th January 2009]

There are also a few errors in the stylesheet:

amenity=parking was present twice.
Housenumbers were rendered incorrectly (circle moved far to the right for areas)

Patch is attached.

And some things I'm unsure about:

Is it really intended, that for historic=museum an icon is displayed when it is a node but only an area without an icon is displayed when it is an area? (lines 2486-2496)

I think all place names should be rendered the same no matter if it is a node or a way (line 2860ff.)

I'll add an patch with these changes later and you can decide if you want to apply it.

@openstreetmap-trac
Copy link
Author

Author: osm[at]petschge.de
[Added to the original trac issue at 9.59am, Sunday, 25th January 2009]

Ups. Sorry. The problem was that there were conflicts all over the place and I had to apply the patch by hand. I guess I missed the change to the circles. Now I applied circle.diff and everything sould be fine again. I also applied z17-extended.diff and z12-16.diff.

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