OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

#1 2018-07-30 09:32:15

Wynndale
Member
Registered: 2009-04-26
Posts: 38

Rewriting {{relation}}

The template https://wiki.openstreetmap.org/wiki/Template:Relation is used in large quantities on some wiki pages and sometimes exceeds expanded page limits. We can now rewrite it in Lua; this may be good for performance but does not itself resolve the very large expanded text exceeding limits. The easy thing to do is to make URLs as short as possible (osm.org intead of openstreetmap.org, // instead of https://) but we probably need to drop low-value links as well.

Offline

#2 2018-08-02 20:40:13

Tordanik
Moderator
From: Germany
Registered: 2008-06-17
Posts: 2,296
Website

Re: Rewriting {{relation}}

I agree with both making the template more performant and reconsidering the list of tools.

However, if we're already considering changing to the list of tools, perhaps this would be a good opportunity to reconsider the template's behavior at a more basic level? Personally, I've always found it odd that {{relation|42}} produces anything except a single link. That not including the various tool links requires additional parameters seems the wrong way around. Especially considering that some of the tools (such as gpx) don't even make sense for the majority of relation types.

And yeah, I already made that point all the way back in 2013 on the talk page. I still feel the same way, though.

Offline

#3 2018-08-05 12:31:44

Wynndale
Member
Registered: 2009-04-26
Posts: 38

Re: Rewriting {{relation}}

That makes sense, have a type= parameter when tools are useful (I suppose you could read the type from the API using Lua but there is enough unneeded overengineering in the wiki as it is)

Offline

#4 2018-09-02 12:52:00

Tigerfell
Member
Registered: 2018-09-01
Posts: 18

Re: Rewriting {{relation}}

Has there been any progress so far?

I agree with Tordanik. The links "analyse" and "GPX" do not work for my anyway.

Offline

#5 2018-09-03 08:04:21

Wynndale
Member
Registered: 2009-04-26
Posts: 38

Re: Rewriting {{relation}}

Most of the pages in Category:Pages_where_node_count_is_exceeded make repeated use of this template or the now-similar {{node}} and {{way}} templates. This means that not only is the template output too big but the templates themselves are too complicated. The solutions are to remove some of the options in the template altogether or to rewrite in Lua.

Offline

#6 2018-09-03 17:41:24

Tigerfell
Member
Registered: 2018-09-01
Posts: 18

Re: Rewriting {{relation}}

Apparently {{BrowseRelation}} is used quite often as well. It redirects to {{relation}}. Does that make a difference?

Offline

#7 2018-09-03 19:25:18

Tigerfell
Member
Registered: 2018-09-01
Posts: 18

Re: Rewriting {{relation}}

Well, I created https://wiki.openstreetmap.org/wiki/Mod … erfell/doc now. This demonstrates the changes I suggest. Please comment!

Offline

Board footer

Powered by FluxBB