https://de.wikipedia.org/w/index.php?action=history&feed=atom&title=Modul%3AOSM Modul:OSM - Versionsgeschichte 2025-05-24T19:20:52Z Versionsgeschichte dieser Seite in Wikipedia MediaWiki 1.45.0-wmf.2 https://de.wikipedia.org/w/index.php?title=Modul:OSM&diff=145957326&oldid=prev Polyglot: mehrere Werte in die Daten sind möglich 2015-09-12T05:27:55Z <p>mehrere Werte in die Daten sind möglich</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 12. September 2015, 07:27 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 12:</td> <td colspan="2" class="diff-lineno">Zeile 12:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> timeout = '[timeout:' .. args.timeout .. '][out:json];\n'</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> timeout = '[timeout:' .. args.timeout .. '][out:json];\n'</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> timeout = '[timeout:<del style="font-weight: bold; text-decoration: none;">15</del>][out:json];\n'</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> timeout = '[timeout:<ins style="font-weight: bold; text-decoration: none;">20</ins>][out:json];\n'</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if args.link and args.link == 'no' then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if args.link and args.link == 'no' then</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Zeile 41:</td> <td colspan="2" class="diff-lineno">Zeile 41:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> itemID = itemObject.id</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> itemID = itemObject.id</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker"><a class="mw-diff-movedpara-right" title="Der Absatz wurde verschoben. Klicken, um zur alten Stelle zu springen." href="#movedpara_10_0_lhs">&#x26AB;</a></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_3_0_rhs"></a><ins style="font-weight: bold; text-decoration: none;"> </ins>-- <ins style="font-weight: bold; text-decoration: none;">Always</ins> perform a regular expression based search</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> if itemID:find(";") == nil then</div></td> <td colspan="2" class="diff-empty diff-side-added"></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> -- It happens that multiple values are in the data</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> -- If there are no ; in the itemID, we only need to search for 1 value</div></td> <td colspan="2" class="diff-empty diff-side-added"></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"> </del>itemID = '"<del style="font-weight: bold; text-decoration: none;">=</del>"' .. itemID</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> </ins>itemID = '"<ins style="font-weight: bold; text-decoration: none;">~</ins>"<ins style="font-weight: bold; text-decoration: none;">(^|;)(</ins>' .. itemID<ins style="font-weight: bold; text-decoration: none;">:gsub(";", "\|") .. ')(;|$)'</ins></div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> else</div></td> <td colspan="2" class="diff-empty diff-side-added"></td> </tr> <tr> <td class="diff-marker"><a class="mw-diff-movedpara-left" title="Der Absatz wurde verschoben. Klicken, um zur neuen Stelle zu springen." href="#movedpara_3_0_rhs">&#x26AB;</a></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_10_0_lhs"></a><del style="font-weight: bold; text-decoration: none;"> </del>-- <del style="font-weight: bold; text-decoration: none;">If more than 1 Q-number is provided,</del> perform a regular expression based search<del style="font-weight: bold; text-decoration: none;"> instead</del></div></td> <td colspan="2" class="diff-empty diff-side-added"></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> itemID = '"~"^(' .. itemID:gsub(";", "\|") .. ')$'</div></td> <td colspan="2" class="diff-empty diff-side-added"></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td colspan="2" class="diff-empty diff-side-added"></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if args.query then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if args.query then</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> -- user can add their own tags to filter on</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> -- user can add their own tags to filter on</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Zeile 105:</td> <td colspan="2" class="diff-lineno">Zeile 102:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if logo then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if logo then</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> <del style="font-weight: bold; text-decoration: none;"> </del> style = "node [".. target .."]{\n text: name;\n".. logo .. " icon-width: 32;}"</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> style = "node [".. target .."]{\n text: name;\n".. logo .. " icon-width: 32;}"</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> <del style="font-weight: bold; text-decoration: none;"> </del> end</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if style then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if style then</div></td> </tr> <!-- diff cache key dewiki:diff:1.41:old-145177928:rev-145957326:wikidiff2=table:1.14.1:ff290eae --> </table> Polyglot https://de.wikipedia.org/w/index.php?title=Modul:OSM&diff=145177928&oldid=prev Polyglot: Entwickelt auf nl WP und en WP 2015-08-19T05:38:00Z <p>Entwickelt auf nl WP und en WP</p> <p><b>Neue Seite</b></p><div>local function buildquery(frame, target)<br /> local textToDisplay, leftLink, rightLink, runQueryRightAway, itemObject, itemID, query, coord, bbox, remark, overpassUrl, primitives, timeout, style, logo<br /> local args = frame.args<br /> <br /> if args.display then<br /> -- text to display on link<br /> textToDisplay = &#039; &#039; .. args.display<br /> else<br /> textToDisplay = &#039;&#039;<br /> end<br /> if args.timeout then<br /> timeout = &#039;[timeout:&#039; .. args.timeout .. &#039;][out:json];\n&#039;<br /> else<br /> timeout = &#039;[timeout:15][out:json];\n&#039;<br /> end<br /> if args.link and args.link == &#039;no&#039; then<br /> -- just return the url<br /> leftLink = &#039;&#039;<br /> rightLink = &#039;&#039;<br /> textToDisplay = &#039;&#039;<br /> else<br /> leftLink = &#039;[&#039;<br /> rightLink = &#039;]&#039;<br /> end<br /> if args.run and args.run == &#039;no&#039; then<br /> -- don&#039;t run immediately<br /> runQueryRightAway = &#039;&#039;<br /> else<br /> runQueryRightAway = &#039;&amp;R&#039;<br /> end<br /> if args.id then<br /> -- build query for specific Q-item(s) <br /> itemID = args.id<br /> pcall(function () itemObject = mw.wikibase.getEntityObject(mw.text.split(itemID,&quot;;&quot;)[1]) end)<br /> else<br /> itemObject = mw.wikibase.getEntityObject()<br /> if itemObject == nil then<br /> return &quot;This page doesn&#039;t have a wikidata entry&quot;<br /> end<br /> -- build query for current page<br /> itemID = itemObject.id<br /> end<br /> if itemID:find(&quot;;&quot;) == nil then<br /> -- If there are no ; in the itemID, we only need to search for 1 value<br /> itemID = &#039;&quot;=&quot;&#039; .. itemID<br /> else<br /> -- If more than 1 Q-number is provided, perform a regular expression based search instead<br /> itemID = &#039;&quot;~&quot;^(&#039; .. itemID:gsub(&quot;;&quot;, &quot;\|&quot;) .. &#039;)$&#039;<br /> end<br /> if args.query then<br /> -- user can add their own tags to filter on<br /> query = args.query<br /> else<br /> query = &#039;&#039;<br /> end<br /> if args.coord and not(args.limitToBBOX==&#039;no&#039;) then<br /> -- The user can provide coordinates and a zoom factor<br /> coord = &#039;&amp;C=&#039; .. args.coord<br /> -- In that case we can limit the search to the area in view<br /> bbox = &#039;({{bbox}})&#039;<br /> -- and tell them how to search wider.<br /> remark = &#039; // remove the &#039; .. bbox .. &#039;if you want the query to be executed globally&#039;<br /> else<br /> coord = &#039;&#039;<br /> bbox = &#039;&#039;<br /> remark = &#039;&#039;<br /> end<br /> overpassUrl = timeout .. &#039;(\n&#039;<br /> -- if the user specifies prim(itives), but then leaves the string empty, abort<br /> if args.prim then<br /> if args.prim == &#039;&#039; then<br /> return &quot;Please indicate which primitives you want to query for&quot;<br /> end<br /> primitives = args.prim<br /> else<br /> primitives = &#039;nwr&#039;<br /> end<br /> <br /> if primitives:find(&quot;n&quot;) then<br /> -- Include nodes<br /> overpassUrl = overpassUrl .. &#039;node[&quot;&#039; .. target .. itemID ..&#039;&quot;]&#039; .. query .. bbox .. &#039;;&#039; .. remark .. &#039;\n&#039;<br /> end<br /> if primitives:find(&quot;w&quot;) then<br /> -- Include ways<br /> overpassUrl = overpassUrl .. &#039;way[&quot;&#039; .. target .. itemID .. &#039;&quot;]&#039; .. query .. bbox .. &#039;;\n&#039;<br /> end<br /> if primitives:find(&quot;r&quot;) then<br /> -- Include relations<br /> overpassUrl = overpassUrl .. &#039;relation[&quot;&#039; .. target .. itemID .. &#039;&quot;]&#039; .. query .. bbox .. &#039;;\n&gt;&gt;;\n&#039;<br /> end <br /> overpassUrl = overpassUrl .. &#039;);\n&#039;<br /> overpassUrl = overpassUrl .. &#039;out geom;\n&#039;<br /> if args.style then<br /> style = args.style<br /> else<br /> if args.logo then<br /> logo = &quot; icon-image: url(&quot; .. args.logo .. &#039;);\n&#039;<br /> else<br /> if itemObject then<br /> logo = tostring(itemObject:formatPropertyValues(&#039;P154&#039;)[&#039;value&#039;]):gsub(&quot;&amp;#39;&quot;, &quot;&#039;&quot;)<br /> end<br /> if logo and not(logo == &#039;&#039;) then<br /> logo = &#039; icon-image: url(&quot;https://commons.wikimedia.org/wiki/Special:Redirect/file/&#039;.. logo .. &#039;&quot;);\n&#039;<br /> end<br /> end<br /> if logo then<br /> style = &quot;node [&quot;.. target ..&quot;]{\n text: name;\n&quot;.. logo .. &quot; icon-width: 32;}&quot;<br /> end<br /> end<br /> if style then<br /> overpassUrl = overpassUrl .. &#039;{{style:\n&#039; .. style .. &#039;\n}}\n&#039;<br /> end<br /> <br /> return leftLink .. &#039;http://overpass-turbo.eu/?Q=&#039; .. mw.uri.encode(overpassUrl, &quot;PATH&quot; ) .. coord .. runQueryRightAway .. textToDisplay .. rightLink<br /> end<br /> <br /> local p = {}<br /> <br /> function p.overpass( frame )<br /> return buildquery(frame, &#039;&#039;)<br /> end<br /> <br /> function p.wd( frame )<br /> return buildquery(frame, &#039;wikidata&#039;)<br /> end<br /> <br /> function p.pt( frame )<br /> frame.args.style = &quot;node {\n opacity: 0;\n fill-opacity: 0;}\nnode[highway=bus_stop], way[highway=bus_stop]{\n text: name;\n icon-image: url(&#039;icons/maki/bus-18.png&#039;);\n icon-width: 18;}&quot;<br /> frame.args.prim = &quot;r&quot;<br /> frame.args.timeout = 50<br /> return buildquery(frame, &#039;wikidata&#039;)<br /> end<br /> <br /> function p.etym( frame )<br /> return buildquery(frame, &#039;name:etymology:wikidata&#039;)<br /> end<br /> <br /> function p.subject( frame )<br /> return buildquery(frame, &#039;subject:wikidata&#039;)<br /> end<br /> <br /> function p.artist( frame )<br /> return buildquery(frame, &#039;artist:wikidata&#039;)<br /> end<br /> <br /> function p.architect( frame )<br /> return buildquery(frame, &#039;architect:wikidata&#039;)<br /> end<br /> <br /> function p.operator( frame )<br /> return buildquery(frame, &#039;operator:wikidata&#039;)<br /> end<br /> <br /> function p.brand( frame )<br /> return buildquery(frame, &#039;brand:wikidata&#039;)<br /> end<br /> <br /> return p</div> Polyglot