-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multi-line from query #586
Comments
It is not possible to query lines onto a map. You can however add lines to a map that was points queried onto it, which I assume is what is Transit Wiki is doing. See https://www.semantic-mediawiki.org/wiki/Extension:Maps/Displaying_maps#Lines and https://www.semantic-mediawiki.org/wiki/Extension:Maps/GeoJSON Both the lines parameter and the geojson parameter work in #ask queries. Querying lines and other shapes is tracked by #239 |
Dear JeroenDeDauw, Thank you for your reply. I can get the marker query and line query to return the results I want separately, but not together. If I copy this and paste it into Dummy2 query, e.g.
Properties:
Can anyone see where I'm going wrong? |
I suspect the inner ask query is not parsed before it is given to the Maps extension. Once Maps gets the value for lines it will just try to interpret as a set of lines. It will not invoke the wikitext parser. Again I'm not sure about the first bit as I have not used much wikitext as of late. Would be good if someone can confirm. |
I just tried putting wikitext into the lines parameter and it seems to be working fine (not what I expected). Demo: https://sandbox.semantic-mediawiki.org/wiki/Utilisateur:Jeroen_De_Dauw/LinesParse So my first guess would be that your query is not creating valid input for the lines parameter. Though that can't be the issue if it works after copy and pasting. You could try asking on the MediaWiki mailing list. https://www.mediawiki.org/wiki/Mailing_lists |
Thanks for your sample. In case it was the inner as #ask not being evaluated, I tried another approach. I made a new template). The idea being that the marker location and line(route) queries are evaluated before being passed to the template, where the map is constructed. Template:Location
Main page
I can't seem to understand why the results are passed through to the template okay ('the route is' and 'the site location is' are displayed), but it is not displaying in the map. Any advice is welcome. Kind regards. |
It'd be helpful for me to know what the Maps extension is receiving as parameter value. Can you add the following line to your copy of Maps and give me the output you get when you save the page with the not-working dispay_map call? 145ffb2 Here is a screenshot of what I get when embedding lines from another page, as in the SMW sandbox example I linked before: My guess is that either for some reason Maps is getting something not fully parsed or that there is some added crap (like a HTML div tag) in the parsed result. |
Thanks for your reply. https://sandbox.semantic-mediawiki.org/wiki/Utilisateur:Fred/projectmap The page "project example" has three locations: London, Madrid and Antwerp; stored in In the project map page, I tried using #display_map, as in your example, to display the lines. I also tried it on my own wiki (sorry, it's not publicly available), and changed the code as you requested.
|
I now replicated the whole thing on my dev machine and this is the parameter maps is getting:
The output you posted is presumably from a page where the first display_map call has the Either way, the issue is what I suspected it was: Maps is getting a bunch of HTML tags from the ask query. I'm a bit fuzzy on what exactly the SMW syntax is to really only get the value itself. Ping @kghbln. |
You mean something like this change from "list" to "plainlist" whereas "plainlist" inherited the behaviour from the former "list" printer starting with SMW 3.0? |
That's interesting; and would make sense, I guess.
for a wikitext of. As you can see, it has query for lines, so i'm unsure of the difference.
Do you know of any examples where people have plotted lines from queries before? |
I just tried it on my own machine and it works fantastically! |
It is now possible to show some love via mini-donation https://github.com/sponsors/JeroenDeDauw ;) |
Great, I guess it was good that I was able to help. :) |
Setup
Issue
Hi,
Thanks for reading my question.
I would like to know how I can generate a make using a query, with multiple markers and lines.
markers and lines would come from pages representing power stations/power lines.
Each page could have 1 or more power station.
Each page could have 1 or more line segments.
I had a try, but I can't seem to get it to work.
I tried to copy some of this, but it didn't work for me (I couldn't get lines to show up with a query, only markers): https://www.transit.wiki/San_Francisco_Bay_Ferry
I also tried looking through the semantic wiki page, but couldn't find a much there.
Thanks in advance for your help
The text was updated successfully, but these errors were encountered: