2023-10-13 16:50:27 +01:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
|
|
|
{% block title %}Geocode to Commons{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<div class="m-3">
|
2021-04-15 12:26:49 +01:00
|
|
|
<h1>Geocode coordinates to Commons Category</h1>
|
|
|
|
|
|
|
|
<ol>
|
|
|
|
<li>Overpass query to find OSM polygon that contain given lat/lon.</li>
|
|
|
|
<li>Sort list of OSM polygons by admin_level descending.</li>
|
|
|
|
<li>Check each polygon for wikidata tag, starting with highest admin_level first.</li>
|
|
|
|
<li>If the wikidata tag isn't found try looking for a 'ref:gss' tag and look for matching Wikidata item using the
|
|
|
|
Wikidata Query service (WDQS)</li>
|
|
|
|
<li>Finally try match by name. Look for nearby items with the same name using WDQS.</li>
|
|
|
|
<li>Return the most specific Wikidata QID and Commons Category.</li>
|
|
|
|
</ol>
|
|
|
|
|
|
|
|
<form>
|
|
|
|
Latitude/Longitude: <input name="q"/> (e.g. 54.375, -2.999) <input type="submit" value="go"/>
|
|
|
|
</form>
|
2019-08-18 15:56:53 +01:00
|
|
|
|
|
|
|
<p>Examples</p>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
{% for lat, lon, name in samples %}
|
2021-04-15 12:26:49 +01:00
|
|
|
<li><a href="detail?lat={{ lat }}&lon={{ lon }}">{{ name }}</a> ({{ lat }}, {{ lon }})
|
|
|
|
—
|
|
|
|
<a href="?lat={{ lat }}&lon={{ lon }}">API call</a></li>
|
2019-08-18 15:56:53 +01:00
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
|
2024-01-06 11:41:48 +00:00
|
|
|
{% set repo = "https://git.4angle.com/edward/geocode" %}
|
|
|
|
|
|
|
|
<p>source code: <a href="{{ repo }}">{{ repo }}</a></p>
|
2023-10-13 16:50:27 +01:00
|
|
|
</div>
|
2021-04-15 12:26:49 +01:00
|
|
|
|
2023-10-13 16:50:27 +01:00
|
|
|
{% endblock %}
|