Jump to content

Wikipedia talk:Creating route maps from OpenStreetMap data

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Slippy?[edit]

Is there a reason the examples on this page are slippy when previewed but static once published? --Dave F63 (talk) 22:29, 18 August 2020 (UTC)[reply]

This is a longstanding bug of maplink across Wikipedia, but I kinda view it as a feature (lets me test the ideal zoom level and shape/size of map before I save). Ideally, they would be 'slippy' even when published, but I think people complain that takes more data usage... ɱ (talk) 23:30, 18 August 2020 (UTC)[reply]

Explanation For Step 4[edit]

Hi, please could someone explain to me what to do in step 4, with the replacement if the “data” instruction. TapticInfo (talk) 19:33, 18 May 2021 (UTC)[reply]

No problem. So say with a new page like Commons:Data:COTA220.map - you can see there's a data parameter. It reads:
"data": { ... GeoJSON ... }
All you have to do is highlight the brackets and what's between them and paste in the GeoJSON you copied. ɱ (talk) 19:36, 18 May 2021 (UTC)[reply]

Why is Bronx River not working?[edit]

In Special:Diff/1080824854, I attempted to add a {{maplink}} to Bronx River, but I get <maplink>: The JSON content is not valid GeoJSON+simplestyle. The first validation error is on the element "/0/service": "The property service is required". What did I do wrong? -- RoySmith (talk) 17:53, 3 April 2022 (UTC)[reply]

You're lucky that the route already exists in OSM, and is linked with Wikidata! Your only error was in formatting {{Maplink}}, which would have needed "|frame=yes|plain=yes|type=line". I instead used {{Infobox mapframe}}, which is a little simpler. ɱ (talk) 19:18, 3 April 2022 (UTC)[reply]
Thanks. I gotta say, this whole map generation thing seems excessively complicated. I was basing my attempt on the last one of these I did, Southern Boulevard (Bronx), which uses image_map = {{maplink-road}}. It seems like every time I do one of these it's a different recipe. -- RoySmith (talk) 19:28, 3 April 2022 (UTC)[reply]
As a more specific suggestion, could you update the "Method 1: Using Wikidata" example to show just the parameters are required, and perhaps another one with the optional ones? Things like stroke-width and zoom are obviously not required, and since id was the only one called out in the preceding paragraph, I assume that was the only one that was actually required. -- RoySmith (talk) 20:10, 3 April 2022 (UTC)[reply]
@ If I could bother you with another problem, I changed the stroke-width to 3. It worked fine in the preview, but when I saved the page, I just get a blank map. Any idea what's wrong now? -- RoySmith (talk) 20:30, 3 April 2022 (UTC)[reply]

@RoySmith: - I don't make the code, I just have experience using it to make cool maps. I have made some suggestions at times, and it does appear that you could use {{maplink-road}} for the Bronx River article, perhaps it should be renamed {{maplink-line}}. I will work to clarify in Method 1. And I fixed the river article, I believe when infobox mapframe gets a custom height, it also needs a custom width. Maplink doesn't need that, not sure why there's a difference. ɱ (talk) 20:35, 3 April 2022 (UTC)[reply]

Thanks again for your help. My apologies if I sound frustrated about this, but it really is fragile. This version worked fine with a custom height but no custom width. And then adding a width fixed the breakage from changing the stroke-width? That's just bizarre. -- RoySmith (talk) 20:45, 3 April 2022 (UTC)[reply]
I think the error was in the height, that version you linked doesn't work for me. Stroke width didn't matter in this. ɱ (talk) 21:00, 3 April 2022 (UTC)[reply]
Wow, that's weird. It worked for me just a moment ago. but now it's not working any more. There's got to be some kind of cache issue going on. -- RoySmith (talk) 21:27, 3 April 2022 (UTC)[reply]

route_master and multiple OSM relations[edit]

Is there a way to account for routes which are defined by a route_master relation and have a route within it for each direction? In linking the wikidata, I have been linking the data item for a route to the route_master and the directions are linked in separate statements. Is it possible to select directions on a route or display them all? --Middle river exports (talk) 21:16, 7 May 2022 (UTC)[reply]

Plotting a disused bus route[edit]

I'm totally lost by Wikipedia language and coding but I was looking into diagrams and mapping for disused bus routes.

Is there any easy way of generating these please? I was hoping to maybe use something similar to maps used to show locations where canals and motorways go through.

Thanks Indieben (talk) 23:46, 31 August 2023 (UTC)[reply]