Help talk:Extension:Kartographer

Jump to navigation Jump to search

About this board

Welcome to the Maps discussion. This is a place to provide overall maps feedback.

Previous discussion was archived at Help talk:Extension:Kartographer/Archive 0 and Help talk:Extension:Kartographer/Archive 1.

WikedKentaur (talkcontribs)
YjM (talkcontribs)

@JMatazzoni (WMF): Ping, because it is a very desired thing, to draw rivers in the map. We this thoroughly in the Czech Wikipedia. It seems like Kartographer can render only a limited subset of relations, is that true? Apart from rivers, we had a hard time add e.g. relations of type=site into the mapframe. Thanks for your reply!

JMatazzoni (WMF) (talkcontribs)

There is another question about rivers here, which may shed light on your problem.

Meanwhile I'll email our map styles expert, @Pnorman, who doesn't appear to have a user page on Mediawiki. Stand by.

Pnorman (talkcontribs)

Currently geoline and geoshapes only supports multipolygon, route, and boundary relations. The new style work will bring along a change to the database schema which will add support for other relation types. task T156433 is tracking this.

YjM (talkcontribs)

@JMatazzoni (WMF) Great! Thanks for your quick answer, I have informed our local community about it.

79.183.35.124 (talkcontribs)

@Pnorman I see the task has been declined. Is there still some hope for rivers to be rendered?

Reply to "River doesn't render correctly"

How often tiles are getting refreshed for zoom level 7,8,9 ?

1
Naveenpf (talkcontribs)
Reply to "How often tiles are getting refreshed for zoom level 7,8,9 ?"

simpler mapframe syntax (as a special namespace/interwiki prefix)

2
Summary by Trizek (WMF)
Verdy p (talkcontribs)

Is it possible to support mapframes using a syntax similar to images. Compare:

[[File:Example en.svg|frame|right|200x200px]]

and

<mapframe width="200" height="200" zoom="13" longitude="-122.3995399" latitude="37.8103264" align="right">{optional SPARQL query}</mapframe>

Why not just:

[[Mapframe:-122.3995399/37.8103264/13|{optional SPARQL query}|frame|right|200x200px]]

This allows reusing the syntax of images, and easy replacement, without the overlong XML-like syntax, just need to replace "File:name" by "Mapframe:x/y/z". This uses the common notation "x/y/z" used with OSM rendering tools or in URLs, without needing to name paramters, as these 3 values are always required (or possibly the missing "/z" can also take a default value such as "/13", suitable for frequent use to locate cities in their district and basic roads).

(we could still add other options with "*=*" parameters, like in images, such as a capotion, or alt-text, or parameters for adding/removing optional navigation buttons, or specifying a lang=* parameter if we want a precise language or its fallbacks). That wiki extension would also support fallback rendering as a single image thumbnail (e.g. using preferences, or browser capabilities if they can't use javascript), by adding a new media type plugin to the thumbail generator.

Like images, there should be coherent default sizes also matching user preferences. This would make replacing static images by mapframes more easily (warning! we should have the same kind of decorations with identical same metrics for the framing). Text-only rendering would render the caption, the map could then be made partly accessible with the description.

As well:

[[:Mapframe:-122.3995399/37.8103264/13|{optional SPARQL query}|inline text]]

Would only render a link, going to a new page with a full screen map browser, optionally with additional sidebar or metadata and info (this uses the common notation "x/y/z" used with OSM rendering tools or in URLs, without needing to name parameters, as these 3 values are always required, so it's easy to copy-paste the URL part from any OSM renderer webpage).

With a prefered language on the map, we can also use the common language code prefix just after "mapframe:" and before coordinates.

[[Mapframe:fr:-122.3995399/37.8103264/13|{optional SPARQL query}|frame|right|200x200px|alt=alt text|caption]]
[[:Mapframe:fr:-122.3995399/37.8103264/13|{optional SPARQL query}|inline text]]

With several alternate renderings (e.g. with a "gray" style, each tile having its own TMS/WMS server identified by a symbolic short name name, can be acting like an interwiki selects a foreign wiki server, and may support alternate languages; the default style would be configured on the wiki according to its own needs, this configuration including internally a possible "referer access key" when needed, when it generates the URL and GET POST parameters for HTTP(S) requests, or other user session cookies):

[[Mapframe:gray:-122.3995399/37.8103264/13|{optional SPARQL query}|frame|right|200x200px|alt=alt text|caption]]
[[Mapframe:gray:fr:-122.3995399/37.8103264/13|{optional SPARQL query}|frame|right|200x200px|alt=alt text|caption]]

We could also add some markers using some "parameter=value" after "Mapframe:x/y/z".

It should be also compatible with the "FULLURL:" syntax to create links with custom inline content (not just the basic plain-text description): we could use the generated link (that goes to the same separate page) as the target of the rendering of a static [[Image:]] (in its "|link=*" parameter)

Trizek (WMF) (talkcontribs)
Reply to "simpler mapframe syntax (as a special namespace/interwiki prefix)"

Incorporate "group" and "show" parameters

2
Matroc (talkcontribs)
  1. Wikivoyage has group and show parameters which I believer should be incorporated in mapframe and maplink for all. If group is added avoid somehow group names such as: Group: {"type":"ExternalData","service":"geoline","url":"https://maps.wikimedia.org/geoline?getgeojson=1&ids=Q55","properties":{"fill":"#555555","fill-opacity":0.5,"stroke":"#000000","stroke-width":1,"stroke-opacity":1,"title":""}}? Upon examination it appears to me that Kartographer extension has been changed in early May and Wikivoyage maps are now displaying the ugly group name as shown above in the info box for lack of a better name. In addition, these 2 parameters allow some extra flexibility as well when creating maplinks and markers. At one point, Wikidata ID(s) were also shown in legend of a map.
  2. The small information box found on Wikivoyage maps (top left) should be also be included on maps - lists groups etc. This allowed users to select or deselect elements for display. Hopefully this feature will not disappear.
  3. Maplink does not appear to work correctly if used as a marker. -- Can see subtle differences is you look at my user page -- and user page on meta. Select link and pop up map does not show External data or drawn shape whereas user page on meta does.
Matroc (talkcontribs)

---- Add comment

Wikivoyage uses the group and show parameters... This allows for multiple mapframes on an article page. Using these parameters allows to display selections (or all groups) on different mapframes. When used in a maplink - these can be displayed on a mapframe using group and show. If the maplink is used as a marker one just doesn't go to a position on a blank popup map but rather a popup map with other points etc. being displayed as well. Maplinks can be placed on a page but hidden from actual page display by using text="" class="no-icon". This type of maplink could be a point or polygon etc. belonging to a particular group and displayed in either a mapframe or then popup map is displayed.

This would provide for some diversity in maps. Just a thought! -- ~~~~

Reply to "Incorporate "group" and "show" parameters"

polygon reaching over meridian 180° gets cut off on large map

2
WikedKentaur (talkcontribs)
Matroc (talkcontribs)

One answer I noted reading some time ago was to divide the polygon into 2 parts down the meridian 180 -- ~~~~

Reply to "polygon reaching over meridian 180° gets cut off on large map"

Coordinates from Wikidata items (Property:P625)

8
Summary by Evad37

Not currently possible, see phab:T188291 for requested functionality.

Geraki (talkcontribs)

Can anyone understand why I do not get a map here?

<mapframe width=500 height=500 zoom=6 longitude=23.6 latitude=38>
{
  "type": "ExternalData",
  "service": "geoshape",
  "query": "
SELECT ?item ?coord ?Natura_2000_site_ID WHERE {
  ?item wdt:P3425 ?Natura_2000_site_ID.
  ?item wdt:P17 wd:Q41.
  ?item wdt:P625 ?coord.
}
"}
</mapframe>

In fact, not only the map fails, but also the interface! (no links to external maps etc.)

Geraki (talkcontribs)

I now understand this is a similar question to Help_talk:Extension:Kartographer/Archive_1#Wikidata_coordinates. Is there any way to include points where the coordinates are stored straight in Property:P625 in Wikidata? I find it strange that we can display maps with polygons called from OSM (through Wikidata), but not with points called straight from Wikidata items (at least there are no instructions on this).

Evad37 (talkcontribs)
Ayack (talkcontribs)
Evad37 (talkcontribs)
Ayack (talkcontribs)

@Evad37 Yes, please, I'm really interrested by an example !

Evad37 (talkcontribs)

Actually, reading over this discussion again, this may not be quite what you're looking for. In terms of queries, {{maplink}} can't do anything more than a plain <maplink> tag, other than make some of the syntax a bit easier to use, and allowing transclusion of JSON from another page. What the template can do is fetch the coordinates of items from Wikidata, if you know the Wikidata ids in advance -- as in {{maplink|type=point|id=Q...|type2=point|id2=Q...|...}} Anyway, I added some |raw= examples to the documentation for w:en:Template:Maplink; you could try experimenting further in your userspace or a sandbox on enwiki.

Ayack (talkcontribs)

Thanks, but unfortunately what @Geraki and I were trying to do was to display the results of a SPARQL query. Basically we want to display this map in Wikipedia.

I understand this is not possible which is a shame. Kartographer allows to do really complicated maps with lines or geoshapes for example but is not able to display some geopoints on a map without having to manually enter wikidata ids...

Reply to "Coordinates from Wikidata items (Property:P625)"
AWossink (talkcontribs)

Would it be possible to display rectified maps from c:Commons:Wikimaps on top of a basemap drawn from OSM?

Abbe98 (talkcontribs)
AWossink (talkcontribs)

Ok. I knew about the extensions you're showing, but I was really hoping that this feature would also be enabled on Wikipedia. Being able to show map layers in an article would be an incredible way to add information. But who knows, maybe it gets implemented at some later point in time?

RobinLeicester (talkcontribs)

It can be done using the template OSM Location Map, which is on en and now various other wikipedias. As well as text and dots and shapes, suitable transparent map overlays can be added from a commons file. There is an example at https://en.wikipedia.org/wiki/East_Northamptonshire which overlays the county boundary as a semi-transparent overlay. The tricky bit is getting the overlay at the same scale and position as the OSM map.

Abbe98 (talkcontribs)

@AWossink it would require quite a lot of work to make Kartographer work with rectified maps at this point. I think when Structured data on Commons might help one day.

Reply to "Rectified maps from Wikimaps Warper"
Doc James (talkcontribs)

Is it possible to add contours?

TheDJ (talkcontribs)

You mean contour (altitude) lines ? As a separate map style to use, or just additionally mixed in with the current style? Or as an overlay ? And where would this be used exactly, are there examples ?

lots of things are possible in theory, but i think the team is almost winding down again on maps work, so...

maybe @Pnorman can point us to the documentation how to create layer style etc, so that maybe a volunteer would be able to create one.

Doc James (talkcontribs)
Abbe98 (talkcontribs)

Because OpenStreetMap does not include topography we would need to add a new data source. Usually when one needs world wide topography data one needs to merge many sources therefor I guess it's would require quite a lot of work.

Doc James (talkcontribs)

Openstreet maps have a topography layer. It is called "Cycle map"

James

Pnorman (talkcontribs)

task T153395 is about adding hillshading, which would cover contour lines. It's unlikely to be taken up in the near or medium term, as it's outside the scope of the collaboration work going on right now. It's also unlikely to be done after that because there won't be the resources to add it.

OpenStreetMap doesn't have contour lines. The map layers on osm.org are example renderings, and OpenCycleMap includes height data from other sources.

Doc James (talkcontribs)

Okay the contours are much more useful than the hill shading. This was just an idea. Yes height data is what is needed. Not sure the license or were OpenCycleMap gets their data.

James

Reply to "Topography"
HueMan1 (talkcontribs)

Is it possible to use this in a infobox?

Geraki (talkcontribs)
HueMan1 (talkcontribs)

How about in infobox road?

Evad37 (talkcontribs)
HueMan1 (talkcontribs)

Look:

{{Infobox road |name=Calabarzon road network |TAG HERE</nowiki>=<mapframe frameless text="Map of the Calabazon Region" width=500 height=500 zoom=8 latitude=14.1 longitude=121.5></mapframe> |country=PHL }}

Evad37 (talkcontribs)
HueMan1 (talkcontribs)

Thanks fellow Wikipedian

Trizek (WMF) (talkcontribs)

Thank you all for sharing your knowledge. :)

Reply to "Infobox friendly?"
37.251.228.163 (talkcontribs)

How do i disable the automatic category "Pages with maps"?

37.251.228.163 (talkcontribs)

Found it. Clear [[Mediawiki:kartographer-tracking-category]]

Reply to "Disable automatic category"