Difference between revisions of "Template:Autotable"

From geofiction
Jump to navigation Jump to search
(Created page with "<includeonly>{| class="wikitable sortable" style="text-align:left; width:{{{width|500}}}px;" |- ! class="unsortable" style="background:#{{{bgcolor|CCCCFF}}};" colspan="5" |...")
 
 
Line 20: Line 20:
 
,{{{column9tag}}}=/osm/{{{type}}}/tag[@k='{{{column9tag}}}']/@v }} }} }} }} }} }} }} }} }}
 
,{{{column9tag}}}=/osm/{{{type}}}/tag[@k='{{{column9tag}}}']/@v }} }} }} }} }} }} }} }} }}
 
|use xpath
 
|use xpath
}} }} |
+
}} }} | }} }}
{{ #If:{{{search1|}}} |
 
{{#clear_external_data:}}{{#get_web_data:url=https://osm3s.opengeofiction.net/api/interpreter?data={{#if:{{{area|}}} |
 
{{{type}}}{{#if:{{{area|}}} |
 
(area.bndarea) }}%5B%22{{lc: {{#replace:{{#titleparts:{{{search1}}}|1|1}}| |_}} }}%22{{#if: {{#titleparts:{{{search1}}}|2|2}} | %3D%22{{MER-opq-enablenames | {{{search1}}} }}%22 }}%5D
 
{{#if:{{{search2|}}} | %5B%22{{lc: {{#replace:{{#titleparts:{{{search2}}}|1|1}}| |_}} }}%22{{#if: {{#titleparts:{{{search2}}}|2|2}} | %3D%22{{MER-opq-enablenames | {{{search2}}} }}%22 }}%5D }}
 
{{#if:{{{search3|}}} | %5B%22{{lc: {{#replace:{{#titleparts:{{{search3}}}|1|1}}| |_}} }}%22{{#if: {{#titleparts:{{{search3}}}|2|2}} | %3D%22{{MER-opq-enablenames | {{{search3}}} }}%22 }}%5D }};out;
 
 
 
|format=xml
 
|data=
 
{{{type}}}_id=/osm/{{{type}}}/@id
 
{{ #If:{{{column1tag|}}} |
 
,{{{column1tag}}}=/osm/{{{type}}}/tag[@k='{{{column1tag}}}']/@v {{ #If:{{{column2tag|}}} |
 
,{{{column2tag}}}=/osm/{{{type}}}/tag[@k='{{{column2tag}}}']/@v {{ #If:{{{column3tag|}}} |
 
,{{{column3tag}}}=/osm/{{{type}}}/tag[@k='{{{column3tag}}}']/@v {{ #If:{{{column4tag|}}} |
 
,{{{column4tag}}}=/osm/{{{type}}}/tag[@k='{{{column4tag}}}']/@v {{ #If:{{{column5tag|}}} |
 
,{{{column5tag}}}=/osm/{{{type}}}/tag[@k='{{{column5tag}}}']/@v {{ #If:{{{column6tag|}}} |
 
,{{{column6tag}}}=/osm/{{{type}}}/tag[@k='{{{column6tag}}}']/@v {{ #If:{{{column7tag|}}} |
 
,{{{column7tag}}}=/osm/{{{type}}}/tag[@k='{{{column7tag}}}']/@v {{ #If:{{{column8tag|}}} |
 
,{{{column8tag}}}=/osm/{{{type}}}/tag[@k='{{{column8tag}}}']/@v {{ #If:{{{column9tag|}}} |
 
,{{{column9tag}}}=/osm/{{{type}}}/tag[@k='{{{column9tag}}}']/@v }} }} }} }} }} }} }} }} }}
 
|use xpath
 
}} }} }}
 
  
 
{{ #If:{{{collapsible|}}} |
 
{{ #If:{{{collapsible|}}} |

Latest revision as of 13:09, 3 July 2022


Usage

{{autotable
| relation    = ...relation number
| type        = {node,way} ...only ways OR nodes are possible
| topic       = ...topic of table
| width       = ...total width of table
| column1sort = {no, } ...if 1st column is unsortable
| column1name = ...name of 1st column
| column1tag  = ...name of 1st column tag to search for
| column2sort = {no, } ...if 2nd column is unsortable
| column2name = ...name of 2nd column
| column2tag  = ...name of 2nd column tag to search for
| column3sort = {no, } ...if 3rd column is unsortable
| column3name = ...name of 3rd column
| column3tag  = ...name of 3rd column tag to search for
| column4sort = {no, } ...if 4th column is unsortable
| column4name = ...name of 4th column
| column4tag  = ...name of 4th column tag to search for
| column5sort = {no, } ...if 5th column is unsortable
| column5name = ...name of 5th column
| column5tag  = ...name of 5th column tag to search for
| column6sort = {no, } ...if 6th column is unsortable
| column6name = ...name of 6th column
| column6tag  = ...name of 6th column tag to search for
| column7sort = {no, } ...if 7th column is unsortable
| column7name = ...name of 7th column
| column7tag  = ...name of 7th column tag to search for
| column8sort = {no, } ...if 8th column is unsortable
| column8name = ...name of 8th column
| column8tag  = ...name of 8th column tag to search for
| column9sort = {no, } ...if 9th column is unsortable
| column9name = ...name of 9th column
| column9tag  = ...name of 9th column tag to search for
}}

Example: List of Gobeletplain Cafés

{{autotable
| relation    = 48497
| type        = node
| topic       = List of Gobeletplain Cafés
| width       = 550
| column1name = Name
| column1tag  = name
| column2name = City
| column2tag  = is_in:city
| column3name = Country
| column3tag  = is_in:country
| column4sort = no
| column4name = Note
| column4tag  = ldata:note
}}
Error while fetching data from URL https://opengeofiction.net/api/0.6/relation/48497/full: $2.
There was a problem during the HTTP request: 410 Gone
Could not get URL https://opengeofiction.net/api/0.6/relation/48497/full after 3 tries.
}}
List of Gobeletplain Cafés
List of Gobeletplain Cafés MER-refresh.png
Name City Country Note Map