Re: [OSM-dev] Retrieving nodes with a "wikipedia=" OSM tag in a certain area via an OSM API?

2016-01-04 Thread Oleksiy Muzalyev

On 03/01/16 17:47, mmd wrote:

...like in the following example:

http://overpass-turbo.eu/s/dwC


Hi mmd,

This type of query, which you suggested, retrieves geolocations of all 
/the wikipedia/, /wikimedia_commons/, and /wikidata/ OSM tags assigned 
to either nodes, areas, or ways. The Overpass API works practically in 
real time, a tag appears in search results after a minute or so.


I implemented it already on the page: http://ausleuchtung.ch/geo_wiki/ 
with marker's direct click-able link to a Wikimedia category, file, 
wikidata and wikipedia page, and a changeable radius of a search down 
from 10 km. In densely populated areas with a lot of Wikipedia articles 
and Wikimedia categories like say London City it makes sense to reduce 
radius of a search.


So now it is possible to see on the map geolocations of the WIkipedia 
articles by coordinates from WIkipedia, and then see geolocations of OSM 
tags /wikipedia/=*, /wikimedia_commons/=*, and /wikidata=* /for the same 
area./


/Some Wikimedia categories have got the coordinates too, for example, 
https://commons.wikimedia.org/wiki/Category:Chapelle_Notre-Dame-de-Lourdes_de_Chermont 
. I am trying to research now if it is possible to retrieve via the 
Media Wiki API also the geolocations of Wikimedia categories with 
coordinates in order to display them on the map too together with 
Wikipedia articles, but with a marker of a different colour.


Thank you and best regards,
Oleksiy
___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Retrieving nodes with a "wikipedia=" OSM tag in a certain area via an OSM API?

2016-01-03 Thread mmd
Hi,


Am 03.01.2016 um 01:29 schrieb Oleksiy Muzalyev:


> It is a bit more complicated to display a geolocation when the wikipedia
> tag is assigned to an area or a way. It will try to implement it later.
> 

If you're happy with the center point of a way/relation, you can also
leverage "out center;", like in the following example:

http://overpass-turbo.eu/s/dwC

Center points for ways/relations are returned in the following format:

  

-- 





___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Retrieving nodes with a "wikipedia=" OSM tag in a certain area via an OSM API?

2016-01-02 Thread mmd

Hi,

Am 02.01.2016 um 10:03 schrieb Oleksiy Muzalyev:

> I repeat for clarity - I need to retrieve coordinates of nodes which
> have the OSM "wikipeida=", "wikimedia_commons=", "wikidata=" tag in the
> radius of 10 kilometres. I started to explore the Osmosis, the MapQuest
> Geocoding API, etc., but it seems to be an uncommon request. Is it
> possible at all?
> 

I would recommend to use Overpass API for this task. Here's a sample
query which will return those nodes with a wikipedia, wikimedia_commons
or wikidata tag in 10km distance of a map's center point.

http://overpass-turbo.eu/s/dvp

Just move to the area you're interested in and hit "Run".

For more details, please refer to [1] and [2]

hth
mmd



[1]
http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Relative_to_other_elements_.28around.29
[2]
http://wiki.openstreetmap.org/wiki/Overpass_turbo/Extended_Overpass_Queries


___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


[OSM-dev] Retrieving nodes with a "wikipedia=" OSM tag in a certain area via an OSM API?

2016-01-02 Thread Oleksiy Muzalyev

Hi,

I wrote a web-application for planning Wikipedia photography 
expeditions: http://ausleuchtung.ch.local/geo_wiki/


Click on the map and it shows all Wikipedia articles geo-locations in 
the radius of 10 km around the click. Wikipedia language is changed by 
replacing "en" for English on "fr" for French, "de" for German, etc. 
Web-application memorizes the map position, zoom level, and language of 
the last request.


This web-application is based on Media Wiki API [1]. All the heavy 
lifting is done by the Media Wiki API, the web-application is just about 
20 lines of code. But it works surprisingly robustly all over the world, 
for all Wikipedia languages.


Now I want to find in a similar way the geo-locations of Wikipedia 
articles, however not via Wikipedia articles coordinates, but via the 
OSM nodes (or areas) which have "wikipeida=", "wikimedia_commons=", 
"wikidata=" tag. Is there a way to do it via an OSM API? Without parsing 
big dump files?


I repeat for clarity - I need to retrieve coordinates of nodes which 
have the OSM "wikipeida=", "wikimedia_commons=", "wikidata=" tag in the 
radius of 10 kilometres. I started to explore the Osmosis, the MapQuest 
Geocoding API, etc., but it seems to be an uncommon request. Is it 
possible at all?


With best regards,
Oleksiy

[1] https://en.wikipedia.org/w/api.php

___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Retrieving nodes with a "wikipedia=" OSM tag in a certain area via an OSM API?

2016-01-02 Thread Jo
Overpass API is your friend. you can discover how it works using Turbo
Overpass. This may also be of interest to you:

https://en.wikipedia.org/wiki/Module:OSM

Try it from one of these pages:

https://en.wikipedia.org/wiki/Special:WhatLinksHere/Module:OSM

And you can hit the ground running, as it creates working queries to
experiment with.

Polyglot

2016-01-02 10:03 GMT+01:00 Oleksiy Muzalyev :

> Hi,
>
> I wrote a web-application for planning Wikipedia photography expeditions:
> http://ausleuchtung.ch.local/geo_wiki/
>
> Click on the map and it shows all Wikipedia articles geo-locations in the
> radius of 10 km around the click. Wikipedia language is changed by
> replacing "en" for English on "fr" for French, "de" for German, etc.
> Web-application memorizes the map position, zoom level, and language of the
> last request.
>
> This web-application is based on Media Wiki API [1]. All the heavy lifting
> is done by the Media Wiki API, the web-application is just about 20 lines
> of code. But it works surprisingly robustly all over the world, for all
> Wikipedia languages.
>
> Now I want to find in a similar way the geo-locations of Wikipedia
> articles, however not via Wikipedia articles coordinates, but via the OSM
> nodes (or areas) which have "wikipeida=", "wikimedia_commons=", "wikidata="
> tag. Is there a way to do it via an OSM API? Without parsing big dump files?
>
> I repeat for clarity - I need to retrieve coordinates of nodes which have
> the OSM "wikipeida=", "wikimedia_commons=", "wikidata=" tag in the radius
> of 10 kilometres. I started to explore the Osmosis, the MapQuest Geocoding
> API, etc., but it seems to be an uncommon request. Is it possible at all?
>
> With best regards,
> Oleksiy
>
> [1] https://en.wikipedia.org/w/api.php
>
> ___
> dev mailing list
> dev@openstreetmap.org
> https://lists.openstreetmap.org/listinfo/dev
>
___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Retrieving nodes with a "wikipedia=" OSM tag in a certain area via an OSM API?

2016-01-02 Thread Oleksiy Muzalyev

Hello Polyglot and mmd,

Thank you for the information and for the sample query. Now it is 
possible to display geolocatios of Wikipedia articles either by 
coordinates in the articles themselves, or by OSM tags assigned to nodes 
(red circle marker for wikipeda tag, violet circle marker for 
wikimedia_commons tag): http://ausleuchtung.ch/geo_wiki/


It is a bit more complicated to display a geolocation when the wikipedia 
tag is assigned to an area or a way. It will try to implement it later.


Thank you again for pointing me 
in the right direction.


With best regards,
Oleksiy
___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Retrieving nodes with a "wikipedia=" OSM tag in a certain area via an OSM API?

2016-01-02 Thread Jo
You're welcome. Maybe it's a good idea to use a regular expression on

image=

tags that point to commons.

Jo

2016-01-03 1:29 GMT+01:00 Oleksiy Muzalyev :

> Hello Polyglot and mmd,
>
> Thank you for the information and for the sample query. Now it is possible
> to display geolocatios of Wikipedia articles either by coordinates in the
> articles themselves, or by OSM tags assigned to nodes (red circle marker
> for wikipeda tag, violet circle marker for wikimedia_commons tag):
> http://ausleuchtung.ch/geo_wiki/
>
> It is a bit more complicated to display a geolocation when the wikipedia
> tag is assigned to an area or a way. It will try to implement it later.
>
> Thank you again for pointing me
> in the right direction.
>
> With best regards,
> Oleksiy
>
___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev