Nearby notable things from OpenStreetMap
Wikidata only has 2000 embassies, while OpenStreetMap has 8000. All embassies are notable enough to have their picture in Commons. OSM has gotten quite good at linking to Wikidata, so an OSM item without a Wikidata link probably is not in Wikidata yet. So, let's display them in Nearby, as soon as technically possible. An advantage of OSM is that the items are all current (all buildings still exist in the present day, if you go there you will have something to take a picture of). When the user uploads a picture,
- Create a Wikidata item with the correct type, such as embassy, name/description, image, lat/long from EXIF if available (not from OSM for license reasons)
- Link to it from the OSM item. This task is probably better left to a bot, and the Commons app would only send data to that bot (in order to avoid authentication issues and to be able to modify the code that talks to OSM without having to force all app users to update).
I believe OSM items with these tags are notable (every instance is worth having its picture in Commons):
- https://wiki.openstreetmap.org/wiki/Tag:amenity=embassy
- https://wiki.openstreetmap.org/wiki/Tag:diplomatic=consulate
- https://wiki.openstreetmap.org/wiki/Tag:diplomatic=embassy
- https://wiki.openstreetmap.org/wiki/Tag:amenity=hospital
- https://wiki.openstreetmap.org/wiki/Tag:building=hospital
- https://wiki.openstreetmap.org/wiki/Tag:man_made=bridge
- https://wiki.openstreetmap.org/wiki/Tag:building=bridge
- https://wiki.openstreetmap.org/wiki/Key:place
- https://wiki.openstreetmap.org/wiki/Tag:railway=station
- https://wiki.openstreetmap.org/wiki/Tag:tourism=zoo
- (please add more)
Does the scope of this issue entail: 1-Fetching a list of nearby places from OSM based on the current coordinates of the user which will be then shown on the map? 2-Creating a WikiData item every time an image is uploaded(based on whether we have an existing WikiData item) and linking it to an OSM item based on the coordinates of that item? 3-Both of the above
@Bluesir9 (3) Both of the above. Linking from OSM is important so that at the next Nearby search this point is not shown anymore.
Any thoughts on whether it would be feasible/useful to include this in 2019's PG application? I think it will be a fairly long and involved task, but the benefits look worth the while to me. @maskaravivek @neslihanturan @VojtechDostal
Woohoo! An interesting idea @nicolas-raoul . My worry is that we lose the cool connection to real items in Wikidata which we have just embraced using Nearby maps and lists. Images uploaded this way would have to be somehow properly tagged - but OSM identifiers are notoriously unstable, so it would be really complicated. Most OSM objects aren't still connected to existing Wikidata items, at least in our country (try this tool to see for yourself how many are still not connected).
My thought is that all these types of places belong to Wikidata and will actually be imported sooner or later. Within a few years there will probably be no need to read these kinds of objects from OSM because we'll have them in Wikidata. Also it might make the Nearby query take even longer than it does now which wouldn't be very user-friendly.
I've given several reasons why we shouldn't do this but there are of course many pros as well - obviously our dataset would be much richer than it is now.
This feature would be a really good addition to our app. I am in favor of having this task for 2019's PG application. Having worked with Wikidata APIs for P18 edits, we will have a better clarity of how Wikidata works and we should be able to manage this task well. :)
@VojtechDostal Many OSM objects are not connected to WIkidata objects because OSM has way more geographical objects than Wikidata. Looking at an OSM maps around me right now, I see dozens of notable places, and almost none of them has a Wikidata item. Even though I am in a country with a strong Wikipedia community writing many local articles. I am sure that Wikidata coverage is very low in countries with a weaker Wikipedia community, for instance the PRC of Guinea.
Conakry on OSM and Wikishootme:

While I could create a Wikidata item for every hospital on OSM, there are multiple problems:
- The OSM license does not allow exporting to CC0 WIkidata (but using OSM to go to each hospital, then take a picture and add the hospital on Wikidata is OK)
- Creating a hospital item on Wikidata requires a reference. OSM is not a good reference as mistakes are frequent (for instance people tagging while in a bus or taxi, or people using old maps). OSM + a picture is not a perfect reference either but still much better, as two persons have seen the hospital at that place.
I wrote this Overpass API query:
(
node(43.08,131.84,43.13,131.93)[amenity=hospital];
node(43.08,131.84,43.13,131.93)[building=hospital];
node(43.08,131.84,43.13,131.93)[amenity=embassy];
node(43.08,131.84,43.13,131.93)[diplomatic=embassy];
node(43.08,131.84,43.13,131.93)[diplomatic=consulate];
node(43.08,131.84,43.13,131.93)[man_made=bridge];
node(43.08,131.84,43.13,131.93)[building=bridge];
node(43.08,131.84,43.13,131.93)[Key=place];
node(43.08,131.84,43.13,131.93)[railway=station];
node(43.08,131.84,43.13,131.93)[tourism=zoo];
);
out;
Paste it into https://overpass-turbo.eu , press Run and Zoom to data to see the results on the map, then press Export to download as GeoJSON/GPX/KML.
It already provides results, but it could be improved further by catching:
- not only nodes but also ways (see https://stackoverflow.com/a/41395312/226958)
- filtering out items that have a
k="wikidata", since the Wikidata query is already showing them (and not showing those that have a picture, which is good).
The API can be called directly like this:
https://overpass-api.de/api/interpreter?data=%28%0A%20%20node%2843.08%2C131.84%2C43.13%2C131.93%29%5Bamenity%3Dhospital%5D%3B%0A%20%20node%2843.08%2C131.84%2C43.13%2C131.93%29%5Bbuilding%3Dhospital%5D%3B%0A%20%20node%2843.08%2C131.84%2C43.13%2C131.93%29%5Bamenity%3Dembassy%5D%3B%0A%20%20node%2843.08%2C131.84%2C43.13%2C131.93%29%5Bdiplomatic%3Dembassy%5D%3B%0A%20%20node%2843.08%2C131.84%2C43.13%2C131.93%29%5Bdiplomatic%3Dconsulate%5D%3B%0A%20%20node%2843.08%2C131.84%2C43.13%2C131.93%29%5Bman_made%3Dbridge%5D%3B%0A%20node%2843.08%2C131.84%2C43.13%2C131.93%29%5Bbuilding%3Dbridge%5D%3B%0A%20node%2843.08%2C131.84%2C43.13%2C131.93%29%5BKey%3Dplace%5D%3B%0A%20node%2843.08%2C131.84%2C43.13%2C131.93%29%5Brailway%3Dstation%5D%3B%0A%20node%2843.08%2C131.84%2C43.13%2C131.93%29%5Btourism%3Dzoo%5D%3B%0A%29%3B%0Aout%3B%0A
Which returns:
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="Overpass API 0.7.55.4 3079d8ea">
<note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>
<meta osm_base="2018-10-12T13:00:02Z"/>
<node id="292656979" lat="43.1046142" lon="131.9031830">
<tag k="esr:user" v="980802"/>
<tag k="name" v="Мыс Чуркин"/>
<tag k="name:en" v="Mys Churkin"/>
<tag k="name:ru" v="Мыс Чуркин"/>
<tag k="railway" v="station"/>
<tag k="wikidata" v="Q4309444"/>
<tag k="wikipedia" v="ru:Мыс-Чуркин"/>
</node>
<node id="653094788" lat="43.1154793" lon="131.9071069">
<tag k="amenity" v="hospital"/>
<tag k="name" v="Женская консультация"/>
<tag k="name:en" v="Female consultation"/>
<tag k="name:ru" v="Женская консультация"/>
<tag k="operator" v="МУЗ "Городской родильный дом""/>
<tag k="source" v="photograph"/>
</node>
<node id="748478673" lat="43.1269020" lon="131.9137695">
<tag k="amenity" v="hospital"/>
<tag k="name" v="Детская поликлиника №7"/>
</node>
<node id="748642606" lat="43.1280520" lon="131.9052518">
<tag k="amenity" v="hospital"/>
<tag k="name" v="Поликлиника №7"/>
</node>
<node id="1010183669" lat="43.1133205" lon="131.9149436">
<tag k="alt_name" v="Городской центр медицинской профилактики."/>
<tag k="amenity" v="hospital"/>
<tag k="name" v="Клинико-диагностический центр г. Владивостока."/>
</node>
<node id="1017861711" lat="43.1111356" lon="131.9259545">
<tag k="amenity" v="hospital"/>
<tag k="name" v="Отделение микробиологической лаборатории"/>
<tag k="source" v="image"/>
</node>
<node id="1143948753" lat="43.1215174" lon="131.9072099">
<tag k="amenity" v="hospital"/>
<tag k="name" v="Краевой психоневрологический диспансер"/>
<tag k="opening_hours" v="Mo-Fr 08:00-20:00; Sa 09:00-15:30"/>
</node>
<node id="1894124126" lat="43.0923586" lon="131.9169089">
<tag k="amenity" v="hospital"/>
</node>
<node id="3224648070" lat="43.1148451" lon="131.8946463">
<tag k="amenity" v="hospital"/>
<tag k="name" v="Приморское краевое бюро судебно-медицинской экспертизы, ГБУЗ"/>
</node>
<node id="3965162817" lat="43.1112094" lon="131.8819268">
<tag k="name" v="Владивосток"/>
<tag k="name:de" v="Wladiwostok"/>
<tag k="name:en" v="Vladivostok"/>
<tag k="name:ja" v="ウラジオストク"/>
<tag k="name:ko" v="블라디보스토크"/>
<tag k="name:ru" v="Владивосток"/>
<tag k="name:zh" v="海参崴站"/>
<tag k="railway" v="station"/>
<tag k="uic_name" v="Vladivostok"/>
<tag k="uic_ref" v="2000199"/>
<tag k="wikidata" v="Q567308"/>
<tag k="wikipedia" v="ru:Железнодорожный вокзал Владивостока"/>
</node>
<node id="4917891862" lat="43.1161852" lon="131.9078650">
<tag k="amenity" v="hospital"/>
<tag k="description" v="Отделение восстановительного лечения"/>
<tag k="name" v="Владивостокская поликлинника №2"/>
</node>
<node id="5049861926" lat="43.1226438" lon="131.8808284">
<tag k="amenity" v="embassy"/>
<tag k="country" v="KR"/>
<tag k="name" v="Генеральное Консульство Республики Корея"/>
</node>
<node id="5063330121" lat="43.1011919" lon="131.9153792">
<tag k="amenity" v="hospital"/>
<tag k="name" v="Краевая клиническая больница №2"/>
</node>
</osm>
Wow, nice! :+1:
The next steps could be:
Phase 1
- In Nearby's ... menu, add a "Show OpenStreetMap notable nodes"
- When enabled, run the over-pass query above in parallel, and show the nodes on the map in a different color.
- When uploading from an OSM node, add to the picture's description the URL to the FSM node.
Phase 2
- Modify the over-pass query to get whether the OSM node has a picture or not.
- Show the OSM node pin in green or red accordingly.
- Modify the query to get whether the OSM node's Wikidata QID, if any.
- Filter out OSM nodes that have a Wikidata QID, as they presumably are shown already. Or if easy, hide the pins with the same Wikidata QID as another pin already present on the map.
Phase 3
Edit OpenStreetMap to link from the OpenStreetMap node to the URL of the uploaded Commons picture.