Topic on Extension talk:GeoData

Silkwood (talkcontribs)

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

Tibloc (talkcontribs)

Do you have the 'Maps' extension installed? If so, this will cause the error.

8aee338606f2cbabecae7cc046897290 (talkcontribs)

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
Silkwood (talkcontribs)

Thanks so much.

I'll give it a try.


أحمد (talkcontribs)

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.

46.69.103.27 (talkcontribs)

That would be handy!

Reply to "GeoData does not work"