Hi Brad,

ahhh - that makes sense! Many thanks for the tips, that's great!

Bjoern

On 2 May 2017 at 15:19, Brad Jorsch (Anomie) <bjorsch@wikimedia.org> wrote:
On Mon, May 1, 2017 at 7:14 PM, Bjoern Hassler <bjohas+mw@gmail.com> wrote:
not sure whether this is an API issue, or something to do with the way coordinates are stored.

Neither.
 
If you look at this query, you'll see that for some of the pages coordinates are listed, for others they are not:


That's because you're leaving colimit at its default of 10 and there are more than 10 pages with coordinates in the request, so you'll need to use query continuation to fetch the rest of the data and merge it in. See https://www.mediawiki.org/wiki/API:Query#Continuing_queries. You might also specify a larger limit, e.g. colimit=500 or colimit=max, to reduce the need for continuation.

Another thing to watch for is that there are two types of coordinates, "primary" and "secondary". By default, only primary coordinates are returned. If you need secondary coordinates as well, you'll need to specify coprimary=all in your request.


--
Brad Jorsch (Anomie)
Senior Software Engineer
Wikimedia Foundation

_______________________________________________
Mediawiki-api mailing list
Mediawiki-api@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api