Help talk:Extension:Kartographer/Archive 1

From mediawiki.org

Link title

The page says:

The link text can be set with the text attribute. Without the text attribute, the word "map" will be shown.

Will this word be shown in all languages?

Or can it be translated?

As far as I can see, there is not relevant translatable message in translatewiki.net, but I might be wrong.

Tagging User:CKoerner (WMF), user:MaxSem, User:Yurik.

Thanks. --Amir E. Aharoni (talk) 10:02, 22 May 2016 (UTC)Reply

Yup, that's not true, I've fixed it. Thanks! Max Semenik (talk) 19:58, 23 May 2016 (UTC)Reply

Localization

Hello! Is there a function to specify the map language (e.g. "name:de") or are just common "name"-tags to be used? --J budissin (talk) 07:54, 17 June 2016 (UTC)Reply

Hello, J budissin. At the moment the map shows location names in the language of the particular location. There is a task (task T112948) that looks to address allowing the language to be the user's preference. Is that what you're looking for? CKoerner (WMF) (talk) 20:42, 20 June 2016 (UTC)Reply

Decimals vs. DMS

Despite being created using decimals (<maplink zoom="13" longitude="-122.3995" latitude="37.8103" />) the map displays with a DMS caption. Is the latter configurable, please? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 18:59, 9 September 2016 (UTC)Reply

Not 'alt'

I'm very concerned at the suggestion:

Use alt for the link hint text.

This is likely to cause confusion with the "alt" attribute on images, which is for a text alternative to an image, for people who cannot see the image (blind people, people using text-only or audio interfaces, etc). In the example given here, the appropriate alt attribute might be something like "the Exploratorium is on 21st and 8th street".

It's hard enough as it is to get people to use appropriate alt attributes on images; encouraging them to think in terms of "hint text" will not help. Could the attribute in this case please be renamed? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 19:50, 9 September 2016 (UTC)Reply

Resolved at phabricator:T145236. In the future, please don't post the same concern in several places, Phabricator is enough. Max Semenik (talk) 22:32, 9 September 2016 (UTC)Reply
Please keep your misguided opinions of where posting is appropriate to yourself. For any issue that may not necessarily be resolved at Phabricator - and there are enough of those - the talk page of the relevant topic is a perfectly reasonable place to air the issue. Whoever was responsible for the suggestion to misuse the alt tag needs to be made aware of the problem and there's no guarantee that they will be tracking a particular Phabricator ticket. --RexxS (talk) 01:12, 10 September 2016 (UTC)Reply
As a developer of the very thingie we're discussing, I can actually state where I prefer to see reports. And if you continue in the same tone, you will lose your access to technical spaces, including this wiki. Max Semenik (talk) 17:46, 14 September 2016 (UTC)Reply

GeoShapes

How to get an inverted filling in case of GeoShapes for masking outside areas? --RolandUnger (talk) 05:04, 11 October 2016 (UTC)Reply

Pinging Yuri to see if he has an answer. CKoerner (WMF) (talk) 16:34, 12 October 2016 (UTC)Reply
We are already working on it in T146582. --Yurik (talk) 22:04, 12 October 2016 (UTC)Reply
Thanks. --RolandUnger (talk) 04:52, 19 October 2016 (UTC)Reply

Maplink and queries

Hi, does Maplink support queries the same way Mapframe does? Thanks for help, --Vojtěch Dostál (talk) 18:17, 1 November 2016 (UTC)Reply

Topographical details

Is it possible to show more details like mountain peaks with names, names of alpine club huts and names of mountain lakes and other features (e.g. for locator maps in mountain infoboxes). If i zoom in my example i only see small mountain paths (with names and numbers) leading to the summit but no peak (funny) and only the shape of a mountain lake and the shapes of buildings. I know there is a "more details" button, but i think we should also show this details in the Wikimedia map.

Also some Maki Icons ar not shown (Opera and Firefox) e. g. mountain or castle. The name of the marker symbol is accepted by Karthographer but not shown.

CKoerner (WMF) would like to have some input from german wikipedia...--Kogo (talk) 22:12, 13 December 2016 (UTC)Reply

Thank you Kogo, I'm pinging Yuri who might be able to shed some light on the choices for which details appear on the map. For the second issue, I do know we have a task related to some icons not being available. I'll mention your request there as well. CKoerner (WMF) (talk) 15:09, 15 December 2016 (UTC)Reply
I think hillshading would be a good start in that direction, but we should do much more to decorate natural features. Paul Norman will hopefully be working on this project as part of the Maps restyling. --Yurik (talk) 05:05, 16 December 2016 (UTC)Reply
I've kept the '395 ticket about hillshading and have another about another about topographic features in general. Hillshading is much harder than topographic features in general (e.g. mountain peaks) because it's both more technical work (another data source, hillshading in vector tiles, etc) as well as more trouble to get right cartographically. Pnorman (talk) 01:01, 26 January 2017 (UTC)Reply

For the missing maki icons see phabricator --Herzi Pinki (talk) 11:02, 16 December 2016 (UTC)Reply

Other GeoJSON types

Map
  • I would think that MultiPoint, MultiPolygon, bbox, MultiLineString and GeometryCollection types which are available to use within a mapframe as well could be noted in Help... (just have to understand how they work differently from Point, Polygon, LineString and Feature Collection). In addition a limited number of geometric shapes can be drawn and placed on a map such as circles, stars, squares etc. Matroc (talk) 05:26, 19 December 2016 (UTC)Reply

Query syntax with geojson properties

On the french Wikipedia, I have used a maplink with WD query in a similar way to US states & governors example, see here if interested, but I have a last problem: I would like to return a stroke-width property (like the fill for the states colors) , but the hyphen is not allowed in Sparql syntax, and the underscore does not match. Pinging Yuri ; is there a solution yet? GAllegre (talk) 22:22, 10 January 2017 (UTC)Reply

GAllegre, it seems to work for me:
<maplink text="Localisation des forts autour de Grenoble" width="250" height="250" zoom="12" longitude="5.726945" latitude="45.187778">

{

 "type": "ExternalData", 
 "service": "geoshape", 
 "query": "

SELECT ?id ('#ff0000' as ?stroke) ('#ff0000' as ?fill)

 (concat('[[', substr(str(?link),31,500),  '{{!}}', ?idLabel, ']]') as ?title)
 (concat(substr(str(?an),0,4), ' - ', ?locLabel, '\\n', '[[File:', substr(str(?image), 52, 500), '{{!}}200px]]') as ?description)
 (10 as ?stroke_width)

WHERE {

   ?id wdt:P361 wd:Q2943846 .
   OPTIONAL {?id wdt:P18 ?image . }
   OPTIONAL {?id wdt:P729 ?an . }
   OPTIONAL {?id wdt:P131 ?loc . }
   SERVICE wikibase:label { 
       bd:serviceParam wikibase:language 'fr' . 
       ?id rdfs:label ?idLabel .
       ?loc rdfs:label ?locLabel .        
   }
   ?link schema:about ?id .
   ?link schema:isPartOf <https://fr.wikipedia.org/> .  

} "} </maplink>

--Yurik (talk) 07:13, 11 January 2017 (UTC)Reply

Yurik, thanks, it works indeed. I don't know what was wrong at may first try. Many thanks again for your quick reply. GAllegre (talk) 09:01, 11 January 2017 (UTC)Reply

Wikipedia links in the mapframe

Using interwiki links in the mapframe doesn't seem to work, is this a known bug? Jc86035 (talk) 04:57, 21 January 2017 (UTC)Reply

Not to my knowledge, please file a phab: ticket. --Yurik (talk) 05:12, 21 January 2017 (UTC)Reply
I've added phab:T185431. Jeblad (talk) 21:18, 21 January 2018 (UTC)Reply

Template/module calls

It seems that I cannot call a template parameter or invoke a module from inside a <maplink>? --Geraki (talk) 11:24, 23 January 2017 (UTC)Reply

Geoline from Wikidata

This example doesn't work:

Map
Derwent Aqueduct
<nowiki><mapframe text="Derwent Aqueduct" width=300 height=300 zoom=9 longitude="-1.521" latitude="53.0563">
{
  "type": "ExternalData",
  "service": "geoline",
  "ids": "Q28522472"
}
</mapframe></nowiki>

The OSM relation also has the Wikidata attribute.--Fleischameista (talk) 13:42, 25 January 2017 (UTC)Reply

Fleischameista, sorry, got sidetracked with a lot of other stuff happening. I looked at the relation 2734272 (type=pipeline). I am really not sure if it gets imported/parsed properly by osm2pgsql, CCing Paul, who might have an answer for this. --Yurik (talk) 05:20, 30 January 2017 (UTC)Reply
Not by default. Pnorman (talk) 05:21, 30 January 2017 (UTC)Reply
Pnorman, what change to the OSM data would you suggest to make the pipeline appear? I feel that adding wikidata tag to each way is an overkill, but would work. --Yurik (talk) 05:30, 30 January 2017 (UTC)Reply
@Pnorman: And which relation types get parsed? I could simply change the relation at OSM. BTW the relation already has a wikidata tag.--Fleischameista (talk) 11:02, 1 February 2017 (UTC)Reply
Fleischameista, i added wikidata tag to each way of that relation and made a few more cleanup fixes there - changeset 45729426. I think it will help, until the geoshapes service can handle it correctly. --Yurik (talk) 22:53, 1 February 2017 (UTC)Reply

Wikidata coordinates

<mapframe zoom="7" width="200" height="200" text="The sculptures...">
{
"type":"ExternalData",
"service":"geoshape",
"query": "SELECT ?id ?coord ?idLabel
(SAMPLE(?img) as ?img) 
(concat('[[File:', substr(str(?img), 52, 100), '|200px]]') as ?description)
WHERE {
  ?id wdt:P361 wd:Q2094828 .
  ?id wdt:P625 ?coord .
  OPTIONAL {
    ?id wdt:P18 ?img .
  }
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language 'sv,en' .
  }
} GROUP BY ?id ?coord ?idLabel"
}
</mapframe>

Is it possible to plot the coordinates (with markers) of items that I get through a Wikidata query (and that has coordinates on Wikidata)? How would I do that? I tried this, but it does not work:

<mapframe zoom="7" width="200" height="200" text="The sculptures...">
{
"type":"ExternalData",
"service":"geoshape",
"query": "SELECT ?id ?coord ?idLabel
(SAMPLE(?img) as ?img) 
(concat('[[File:', substr(str(?img), 52, 100), '|200px]]') as ?description)
WHERE {
  ?id wdt:P361 wd:Q2094828 .
  ?id wdt:P625 ?coord .
  OPTIONAL {
    ?id wdt:P18 ?img .
  }
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language 'sv,en' .
  }
} GROUP BY ?id ?coord ?idLabel"
}
</mapframe>

Ainali (talk) 10:27, 31 March 2017 (UTC)Reply

I guess it has something to do with "service":"geoshape" since "service":"geolines" works for roads and rivers. Is there something like "service":"geopoint" that could get enabled? Ainali (talk) 08:06, 12 December 2017 (UTC)Reply
I'm also looking for a way to display Wikidata items on a map. If someone know how to do that, I'm interested. Ayack (talk) 16:52, 26 February 2018 (UTC)Reply
dito --Renek78 (talk) 11:05, 17 June 2018 (UTC)Reply

Problem with coordinates calculation

From text: "(example: 12°18′0″N 45°36′0″E)". Clicking on coordinates will send you to "9.861, 52.646" not "12.3, 45.6". --Igel B TyMaHe (talk) 19:40, 9 May 2017 (UTC)Reply

<mapframe> in template

Is it an example how to wrap <mapframe> in template? I would like to protect the map code from accedent errors and give users a friendly template interface in a native langueage. I've tried several methods, none of them works. So I would like to call template with some options and get back a map. Pavel Malakhov (talk) 09:33, 16 May 2017 (UTC)Reply

Pavel Malakhov, there is a template in wikivoyage that does that, but it might be slightly more than what you need. Also, WV can combine multiple mapframe and maplink tag's data into one map, which is not possible in any other wikis. --Yurik (talk) 17:36, 18 May 2017 (UTC)Reply
Yurik, this template uses Lua which I can not use in my wiki. Is it more simple example? Pavel Malakhov (talk) 09:12, 31 May 2017 (UTC)Reply
I'll give an example. When I create a template with tag: <mapframe text="Map title" latitude="55.74459" zoom="11" longitude="37.60428" width="{{{1}}}" height="{{{2}}}" align="center"> generator returns an error:
Проблемы с <mapframe>:

 * Атрибут «width» имеет недопустимое значение
 * Атрибут «height» имеет недопустимое значение

which is Russian for:

Problems with <mapframe>:

 * Attribute «width» has wrong value
 * Attribute «height» has wrong value

Pavel Malakhov (talk) 09:10, 1 June 2017 (UTC)Reply

Pavel Malakhov, Did you find an answer to this? The solution is to use a {{#tag:...}} magic word, (some not very understandable help is available at Help:Magic_words#Miscellaneous).
It allows you to include an extension tag within a template. I used this on en:wikipedia with <maplink> as we don't have <mapframe>, but I have had a go at adapting it to do what you want. The following code, or something customised to suit your wiki, might do it. Note that all the 'content' has to go first, followed by the parameters, ie the other way round from calling <mapframe> directly. This version allows an optional single marker in your map frame.
{{#tag:mapframe|
{
  "type": "FeatureCollection",
  "features": [
    {{#if:{{{pointlat|}}}| 
      {
      "type": "Feature",
      "properties": {
          "title": "{{{title|}}}",
          "description": "{{{description|}}}",
          "marker-symbol": "-number",
          "marker-size": "medium",
          "marker-color": "#B80000"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [{{{pointlon|-0.162}}}, {{{pointlat|51.485}}} ]
      }
    }
  }}
 ]
}|zoom={{{zoom|12}}}| latitude={{{lat|51.48}}}| longitude={{{lon|-0.16}}}| text={{{text|}}}| width={{{width|300}}}| height={{{height|300}}}| align={{{align|right}}} }}
This template, if it was created as Template:mapframe, for example, needs only lat and lon as essential, with all the others optional using standard wiki syntax, eg:
{{mapframe| lat=51.48| lon=-0.16| zoom=11| width=350| height=250| align=center| text=Your frame text| pointlat=51.485| pointlon=-0.162| title=Interesting point}}
This has only had a quick run on a sandbox, so you will need to test it properly as a template on your wiki. You can then translate the parameters, and could embellish the options as much as you like by adding multiple points or other features - but they may not be that relevant - it depends how you imagine using it. Good luck. RobinLeicester (talk) 00:13, 23 July 2017 (UTC)Reply

Other external sources (Gpsies)

Hi there

Would it be possible to use other ExternalSources than explained in the documentation. E.g. I got http://www.gpsies.com/files/geojson/w/v/l/wvlbpblefmwwkkap.js (gpsies ID: wvlbpblefmwwkkap), which would perfectly fit into the Kartographer concept.

Cheers, Ceever (talk) 13:33, 20 May 2017 (UTC)Reply

Ceever no, only sources that are part of the wikimedia ecosystem can be included, and each requires development integration. —TheDJ (Not WMF) (talkcontribs) 08:34, 22 July 2017 (UTC)Reply

How to purge map images from the cache?

Hi, currently if i am using the map files from commons (like example Map data from Commons) and the source map page in commons is changed then the map in the wikipedia uses the old version of the map. Is there some way todo the forced refresh of the map image? --Zache (talk) 04:46, 22 June 2017 (UTC)Reply

Where does the GeoShape come from?

Hello! Where does the Geoshape info come from? I'm looking to East New Britain Province (Q753702) and can't find an OSM info for that. The Geonames shape is not exactly the same. So... where the heck? -Theklan (talk) 16:54, 2 August 2017 (UTC)Reply

Theklan, Since no-one with better OSM understanding has answered, I will throw in the little I understand - which may be at best a half truth, but is at least giving you a direction. (Apologies if this is basic and you are hoping for something more insightful). On the OSM site, the various objects have a list of tags, and some, such as an Administrative boundary, might have been matched up to the wikidata Q number. So in your example, at www.openstreetmap.org/edit#map=16/-4.9799/151.5596, if you click on the boundary line, and find the East New Britain Administrative boundary feature, and have a look at its tags, one is the wikidata tag. Somehow - and this is where my knowledge ends - Kartographer can find that tag and then extract the geoshape data that it connects to. Does that help? RobinLeicester (talk) 17:22, 13 August 2017 (UTC)Reply
It helps a lot! I was trying to figure out how Wikidata knew that, and it was OSM who knew! Thanks RobinLeicester!

latitude/longitude or longitude/latitude

Throughout the examples longitude seems to precede latitude contradicting the usual convention- is there a reason?--ClemRutter (talk) 22:41, 16 October 2017 (UTC)Reply

@ClemRutter: I've swapped them. Jc86035 (talk) 08:36, 29 November 2017 (UTC)Reply
Jc86035 We still have the longitude/latitude thing on "geometry": { "type": "Point", "coordinates": [-122.3988, 37.8013] },, but I think is kind of problematic swap them, am I right? I confess that is a irritating plus 1 step work swap them when using it. Ederporto (talk) 01:41, 6 December 2017 (UTC)Reply

How can I change the position of latitude and longitude?

I want to replace the positions of longitude and latitude.
Because In general (also OpenStreetMap) the first is latitude, then longitude.

mapframe is

"geometry": { "type": "Point", "coordinates": [-122.3988, 37.8013] },

longitude is -122.3988
latitude is 37.8013

"coordinates": [-122.3988, 37.8013]

change to

"coordinates": [37.8013, -122.3988]

Please tell me because I do not know how to change....

The implementation of mapframe uses the coordinates in the order you describe (lat, long) and does not accept an alternate order. CKoerner (WMF) (talk) 16:57, 28 March 2018 (UTC)Reply

An option to render lines and polygons with beziers

I wonder if it would not be nice if there was an option to show smoothed lines under some circumstances - species distribution range for instance look nicer with the polygons smoothed (while saving data with just a few points) - I think this demo seems to do this Shyamal (talk) 05:18, 2 May 2018 (UTC)Reply