Page MenuHomePhabricator

GeoData wikivoyage queries return some results without coordinates
Closed, DeclinedPublic3 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

When I run the following query on WikiVoyage:

https://en.wikivoyage.org/w/api.php?action=query&format=json&generator=geosearch&ggscoord=41.8967068%7C12.4822025&ggsradius=20000&ggslimit=50&ggsprimary=all&prop=coordinates%7Cpageimages%7Cextracts%7Cpageprops&coprimary=all&piprop=thumbnail&pithumbsize=400&exintro=1&explaintext=1&origin=*

What happens?:

I get 16 results, but some of them do not have coordinates, and I'm not sure why or why not. An example is North Rome and South Rome. I do not see any discernible difference in the data in their page, but the former shows up with coordinates, and the other does not. Is it something to do with Primary? Is South Rome somehow considered secondary?

What should have happened instead?:

All results show show the data that appears in their {{geo}} tag

Event Timeline

Aklapper renamed this task from Coorinates returned on some GeoData wikivoyage queries to Coordinates returned on some GeoData wikivoyage queries.Nov 24 2025, 1:35 PM
Aklapper added a project: MediaWiki-Action-API.
Pppery renamed this task from Coordinates returned on some GeoData wikivoyage queries to GeoData wikivoyage queries return some results without coordinates.Nov 24 2025, 5:54 PM

It looks like only the first 10 have coordinates. I tried to strip the query down to demonstrate the effect better.
https://en.wikivoyage.org/w/api.php?action=query&generator=geosearch&ggscoord=41.8967068%7C12.4822025&ggsradius=20000&ggslimit=11&prop=coordinates

Here is another example that demonstrates the same effect, this time with 2 search results, but only 1 with coordinates.
https://en.wikivoyage.org/wiki/Special:ApiSandbox#action=query&prop=coordinates&pageids=30010%7C30011&colimit=1

The solution is to add &colimit=50 to your query.

I can see how this is confusing. But as far as I'm aware of this is an old behavior of how the generator syntax works. It's as if you are running two queries in the same HTTP request. You need to tell both API modules what limit you expect.

pfischer set the point value for this task to 3.Dec 1 2025, 4:50 PM
EBernhardson subscribed.

I think thiemo has got it pinned down, this is "working as intended". It would be convenient if the mediawiki api had a more intuitive method to align limits across the api call, but that's not currently a thing.

The fix of using colimt=50 does work for me, so happy to use that. I must test it for cases where there might be more than 50 articles within 20km just in case I need to increase that limit (I've no idea if that would solve it, but I can test!).

Yeah, so I tested it with New York, where there are ~55 articles nearby. I had ggslimit set to 50 (where it always was, so a few were always not returned) and colimit set to 50, as suggested recently above. I increased ggslimit to 70, but left colimit. 55 articles were loaded, and the last 5 had no coordinates. So I simply increased climit to 70, and all was fine again.

For now, I've set both to 100. I con't imagine there being many places on earth with a lot more wikivoyage articles than NYC within 20km.