Extension talk:GeoData


Filing a possible bug?

Where would you like bugs to be mentioned at this early stage? I notice, for example, that distance is greater than radius for some entries here. (While that might be intentional, it seems counter-intuitive at the very least.) Thanks, Jarry1250 13:50, 11 February 2012 (UTC)

Extra parameters

What is to do if a name contains spaces or underscores? RolandUnger (talk) 08:04, 28 June 2013 (UTC)

I have the same question as Roland. What if the name has spaces or underscores? Jnatividad (talk) 21:36, 30 July 2013 (UTC)
Max, the author of the extension, set me right after I submitted an ugly urlencode hack :)
To use spaces and underscores for name, do something like this:
 {{#coordinates:40.7820|-73.9660|type:landmark_region:US|name=Central Park Boathouse}}
Jnatividad (talk) 17:59, 31 July 2013 (UTC)

Greater distances?

Any chance of increasing the maximum search radius? 10km isn't much use in places like Scotland because there just isn't the density of population/articles. I'd happily trade half the maximum number of articles in return for the search radius going up to 30km or even 50km. Le Deluge (talk) 14:29, 18 February 2014 (UTC)

You can customize the maximum search radius in your own wiki with
$wgMaxGeoSearchRadius = 30000;
But if you want that to be changed across all Wikimedia projects, then you should file a bug in Bugzilla. Ricordisamoa 02:02, 19 February 2014 (UTC)

Lua ?

Is there any way to use this extension through Lua other than "frame:callParserFunction" and co ? Zolo (talk) 14:31, 2 April 2014 (UTC)

Database error

Hi, when I save a page, I get this error:

A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: (SQL query hidden) from within function "GeoDataHooks::doSmartUpdate". Database returned error "1054: Unknown column 'gt_lat_int' in 'field list'

Any fix for this? 37.77.117.146 03:04, 15 May 2014 (UTC)

Did you really run the update script after installing? Any errors when you did? rotsee (talk) 11:54, 19 May 2014 (UTC)
Yes, I run the update script without any error... seems not to create gt_spatial index. I found a solution to the bug here Bug 62127, but it is not explained how to set up the tables... 37.77.117.146 01:18, 21 May 2014 (UTC)

Filter results server-side?

Hi, I'm using the "geosearch" end-point to find cities at certain coordinates. However due to the limit on the number of search results it happens quite often that no cities are returned in favour of landmarks and other results. It would be great if at least filtering for one/many types of coordinates could be done on the server instead of sending lots of data around.

So, are there already plans for this and would you consider patches for this functionality? NyirNyir (talk) 11:56, 17 November 2014 (UTC)

questions about "Running GeoData with Solr"

i have downloaded Solr-3.6.0,then extracted to d:\solr; here is the file structure of solr : fileStructureOfSolr

my questions:

1:i follow this instruction ==>"Copy solr/schema.xml to desired Solr core's configuration directory (if you have only one core and you don't want to use it for anything else, just use collection1, its config dir with Debian-packaged Solr is /etc/solr/conf)." where can i get solr/schema.xml ? i didn't see it.but i see a schema.xml in "D:\solr\example\solr\conf". if i use the schema.xml in conf ,then where is "/etc/solr/conf" ? where should i put the D:\solr\example\solr\conf\schema.xml in ?

2:"Set $wgGeoDataSolrHosts and $wgGeoDataSolrMaster in LocalSettings.php to your server hostname(s)/IP(s)" i set like this $wgGeoDataSolrHosts ='192.168.137.1';$wgGeoDataSolrMaster = '192.168.137.1'; is it right ?

3:"Run php solrupdate.php from cronjob." but where is the solrupdate.php? i did not find it in my computer Cxyshine (talk) 07:01, 14 March 2015 (UTC)

Getting Page Url in list=geosearch

Hi,

I am using following query to get pages near a coordinate. Is it possible i can get URL of [ages in return info as well.

https://en.wikipedia.org/w/api.php?action=query&list=geosearch&gsradius=10000&gslimit=100&gscoord=31.4290691%7C74.2649841&gsprop=country&continue=

I tried using prop=info&inprop=url but it doesn't works with this "list".

Can u please help.

Azeem 182.191.181.116 11:36, 17 March 2015 (UTC)

Map center on user position

I have Extension:Maps, Extension:MobileFrontend, etc. etc. installed. Is it possible to center a map on the user position showing pages around it? Thank you. Gborgonovo (talk) 13:30, 25 May 2015 (UTC)

Confusion on Database, dimension, precision

The page contains the passage "This extension adds a new parser function, {{#coordinates:}}, that saves coordinates to the database. Function's input format is made as compatible as possible with GeoHack"

I don't understand what database is being referred to. Does it mean WikiData? Does adding coordinates to a Wikipedia article add the coordinates to WikiData? (That seems unlikely.)

Also, there is a conflict between WIkiData and this page. WikiData Wikibase/DataModel has a precision field. It is not defined exactly what this represents, but the normal interpretation by a person with a technical background would be the uncertainty in the measurement process that produced the latitude and longitude. The DataModel used to have a dimension field, but that was deleted in March. This page has a dimension parameter.

The problem is that depending on the object and measurement method, we could have a large object with a point within it that has been precisely determined (e.g. the Washington Monument) or we could have a tiny object who's position has not been precisely determined (e.g. the Airy transit circle at the Royal Observatory, Greenwich). Jc3s5h (talk) 12:46, 13 July 2015 (UTC)

MobileFrontend Nearby + GeoData does not work with unverified websites in Chrome 50+

SSL is required in order for Chrome to allow a website to ask for a user's location. RFlan (talk) 20:02, 19 February 2017 (UTC)

I have similar problem.
From MW 1.29, Nearby did not worked. there was a parsing error at #coordinates.
  • current version of my private wiki : 1.30.0
  • I'm using SSL
I think semanticmediawiki Maps have something to do with parsing error. After I remove SMW maps, a parsing error was not happened and Nearby worked.
Any one who have idea to fix this, let me know.
Thanks Naramoksu (talk) 09:28, 24 December 2017 (UTC)
I can confirm that GeoData conflicts with Maps extension - both define `cooridnates` parser-function and it seems like the one from Maps overrides the one from GeoData Vedmaka 14:08, 22 March 2018 (UTC)

Does gsglobe= work for any value other than "earth"?

https://en.wikipedia.org/w/api.php?action=query&list=geosearch&gspage=Gale%20(crater)&gsglobe=mars&gsradius=10000&gslimit=10 returns "Unrecognized value for parameter "gsglobe": mars." - does gsglobe actually recognise any parameters other than "earth" at the moment? Gapfall (talk) 09:48, 13 July 2017 (UTC)

1.29.0 version GeoData.php file missing

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


I downloaded and installed GeoData 1.29.0 version but it make problem. I found the source file does not have GeoData.php file in GeoData folder. Naramoksu (talk) 00:33, 26 July 2017 (UTC)

I do not found GeoData.php file at the 1.29.1 version also. Naramoksu (talk) 09:40, 30 August 2017 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

coordinates

Is prop=coordinates function disabled in wikipedia?

The example links return only piageid, ns and title! 89.183.111.96 (talk) 06:05, 20 September 2017 (UTC)

How to convert from MySQL to ElasticSearch

If you install it without elasticsearch to use the MySQL backend is there a way to convert it to use ElasticSearch if you later install ElasticSearch? Clarkcj12 (talk) 04:57, 1 January 2018 (UTC)

Magic Words?

If "#coordinates:" gives us an easy way to write primary coordinates into the database from a template on a page, then what's the corresponding way for page templates to read the information out again elsewhere on the page?

Presumably there's some way to do this, perhaps some "Magic Words", like LAT and LONG that would let us access this info from elsewhere in the page in a standardised format, but I'm having trouble finding any info on how to do this.

Can someone confirm that this data can be accessed from within the page? ErkDemon (talk) 11:34, 20 July 2018 (UTC)

From the documentation, I assume that the data can be accessed through the API only.
I think that being able to access it by using a parser function would be great, and would eliminate the need for the double storage of the data in another retrieval system, such as SMW.
Of course integration between the two would be magnificent, but let's hope for little. Ahmad Gharbeia أحمد غربية (talk) 21:40, 13 February 2020 (UTC)

Altitude data?

Is there no support for height data? I work in a museum and tourist information point that's ''underneath'' a major railway station terminus forecourt. People walk out of the station building into the outdoor cab rank, and latitude/longitude would tell them that they were inside the museum. Location data should be able to tell them that the "invisible" museum is twenty feet straight down, below their feet, and they they need to scout about for a way down.

Similarly, the station is built into the side of a steep hill, and we get a steady stream of lost people coming in from the road outside looking for it, who don't realise that the station is a couple of storeys up the the air, above the brickwork in front of them.

I appreciate that altitude isn't as important as lat/long, but it seems odd to have no way of entering the data for the cases where it matters. ErkDemon (talk) 17:44, 24 July 2018 (UTC)

GeoData does not work

This is my site installation

Product Version
MediaWiki 1.32.0
PHP 7.2.17-0ubuntu0.18.04.1 (apache2handler)
MariaDB 10.1.38-MariaDB-0ubuntu0.18.04.1
ICU 60.2
Elasticsearch 5.6.16

this is the LocalSettings.php configuration

wfLoadExtension( 'GeoData' );

$wgGeoDataBackend = 'elastic';

and this is the (partial) output of update.php script

...geo_tags table already exists.

...geo_killlist doesn't exist.

...coordinates are already DECIMAL in geo_tags.


When I try the new GeoData parser function (taken from Extension Page example):{{#coordinates:primary|26|04|N|178|46|E|}}

I get this Fatal error

Fatal error: The format of the coordinate could not be determined. Parsing failed.


What am I missed?

Any help is greatly appreciated
Silkwood (talk) 15:25, 13 June 2019 (UTC)

Do you have the 'Maps' extension installed? If so, this will cause the error. Tibloc (talk) 12:42, 11 September 2019 (UTC)

Yeah, they both provide the #coordinates parser function:

  • Extension:GeoData ...adds a new parser function, {{#coordinates:}}, that saves coordinates to the database.
  • Extension:Maps ...provides the #coordinates parser function which allows conversion between all supported coordinate formats.

If you don't care about the GeoData part of this, you can edit Module:Coordinates on your own wiki, find the part that says this:

local function coord_wrapper(in_args)
	-- Calls the parser function {{#coordinates:}}.
	return mw.getCurrentFrame():callParserFunction('#coordinates', in_args) or ''
end

and replace it with this:

local function coord_wrapper(in_args)
	-- Calls the parser function {{#coordinates:}}.
	local result = mw.getCurrentFrame():callParserFunction('#coordinates', in_args)
	if string.find(result, "The format of the coordinate could not be determined") ~= nil then
		-- We wanted the #coordinates parser function from Extension:GeoData, 
		-- but we got the one from Extension:Maps instead :(
		result = nil
	end
	return result or ''
end

8aee338606f2cbabecae7cc046897290 (talk) 12:12, 25 October 2019 (UTC)

Thanks so much.
I'll give it a try.

Silkwood (talk) 13:02, 7 November 2019 (UTC)
I think Extension:Maps should opt to change the name of its function to something more relevant to its function, and clear the way for using both extensions simultanously. Ahmad Gharbeia أحمد غربية (talk) 21:41, 13 February 2020 (UTC)
That would be handy! 46.69.103.27 (talk) 22:26, 23 February 2020 (UTC)

Labelling secondary coordinates

Hi guys. I've been playing around with the API on en.wiki. and have a question. By default any secondary coordinates in the API output get labelled with the name of the article, which isn't necessarily very helpful. However WIWOSM is managing to extract the HTML anchor names for secondary coordinates on eg a list article of listed buildings in a county or the junctions on a motorway. I can't see how to do that via the API, am I missing something or is WIWOSM doing something clever that isn't available to mere mortals (short of parsing the list article directly)? TIA Le Deluge (talk) 14:58, 24 March 2020 (UTC)

Wiwosm uses screenscraping, it doesnt use this extension. Ive been looking into this a bit to see how to bring everything together, increase consistency and reliability, but its a big set of work that needs to happen in all prts of map support. —TheDJ (Not WMF) (talkcontribs) 18:25, 24 March 2020 (UTC)
OK, no worries. Looking at the UK, the biggest one seems to be the lists of listed buildings which use a template which presumably has scope to be helpful, also the lists of place names and to a lesser extent eg junctions on motorway articles. In principle I guess you could templatify those and it would cover the vast majority of secondary coords in the UK, even if you'd need something cleverer to do absolutely every point. As an aside, congrats and thanks to everyone who's worked on these APIs, they've come a long way since I last looked at them years ago. Le Deluge (talk) 10:51, 25 March 2020 (UTC)

Special:Nearby not working

Now I have the following problem: I have the Near Near feature, i.e. GeoData. I have written Geodata nearby and true position LocalSettings.php together and came to my wiki nearby function. But now when the king "show nearby articles," it says, "There's a problem with Nearby. Try updating the location." What to do? Antonkarpp (talk) 11:50, 28 July 2020 (UTC)

Using Template:GeoGroup to map multiple points

I've included several places with GPS coordinates in my page using Template:Coord. I've installed the extension GeoData.


When I include {{GeoGroup|mapframe=yes}} in my page, all I get is the output code of the template, not an actual map.


"<mapframe height="200" frameless="1" align="center" width="290">[

{"type":"Feature","geometry":{"coordinates":[-1.777979999999999893844915277441032230854034423828125,55.56616999999999961801222525537014007568359375],"type":"Point"},"properties":{"description":"55.56617°N 1.77798°W","title":"Adderstone Hall","marker-color":"5E74F3"}}," etc. appears on the screen.


I'm not getting any notification that I'm missing any templates or modules. When I put the same code into my sandbox on Wikipedia, it works fine.


I feel like the missing piece is that my install of mediawiki needs access to data in Wikibase, but I'm not sure if I need it locally or if I can query from wikidata. I have Wikibase installed, but I'm not sure what exactly to do with it.


Can someone just give me a next step so I know what I need to research. Thanks. Redheadkelly (talk) 20:55, 28 August 2021 (UTC)

I understand now that I need the Kartographer extension. I've installed that along with the JsonConfig extension, but there doesn't seem to be any way to get them working on my own Mediawiki install. Redheadkelly (talk) 17:36, 31 August 2021 (UTC)

Max Radius Not Changing

At the very bottom of LocalSettings.php, I've set $wgMaxGeoSearchRadius = 30000; however, the effective search radius is still the 10km default.

I've manually passed coordinates to the Special:Nearby page, and listings will show if 9.9km away, but disappear once I specify a coordinate slightly further away.

I've kept all other defaults and I only have two georeferenced locations, so the $wgMaxCoordinatesPerPage setting shouldn't impact anything.

Are there any known bugs, additional settings I should change, or a hard codded max that I can't exceed? Ideally I would like no max radius if this is possible, but I'll be happy with a larger max radius if I can get one. 168.245.155.48 (talk) 12:39, 4 August 2022 (UTC)

GeoData error on update to PHP 8.1

After patching up to the latest version of Mediawiki (1.38.4) I tried updating my PHP from 7.4 to 8.1 and everything seems to work great... except for one error:

Deprecated: Return type of GeoData\CoordinatesOutput::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/my.wiki/public_html/mediawiki-1.38.2/extensions/GeoData/includes/CoordinatesOutput.php on line 141

Does anyone know what's causing this and how to correct it? (Or do I just need to wait a while longer to go up to PHP 8.1?) Huwmanbeing (talk) 00:38, 30 September 2022 (UTC)

1.38 does not support PHP 8.1 yet. Though if you want to manually apply the patch, the 1.39 patch for this issue is in phab:T311919TheDJ (Not WMF) (talkcontribs) 08:14, 30 September 2022 (UTC)

How to show coordinates on page?

i see that in Wikipedia's page the coordinates are automatically showed in the upper right of the screen.

i couldn't understand how to do that on my site www.wikimilano.it Brunodapei (talk) 14:22, 4 December 2022 (UTC)

I would recommend to refrain from this idea.
It has been a dirty hack about 2004, and it is causing problems over problems.
There is no gap left in the interface for such coordinates. Therefore the hack is hoping that it does not cover any other element nor text. But the hack has no eyes and does not know whether there is a gap or not. It is a nightmare. Skins are changing, and for every skin version and amount of text a small place needs to be found. This does not work with mobile nor App. PerfektesChaos (talk) 16:02, 10 December 2022 (UTC)
Category:Talk pages using deprecated source tags