Commit graph

11 commits

Author SHA1 Message Date
cd9d8779d3 Add needs_commons=false option and redesign detail and index pages
Add a needs_commons parameter (default true) to both the API endpoint and
the detail page. When needs_commons=false, look up Wikidata items by OSM
relation ID (P402) via WDQS to return the most specific matching item even
if it has no Wikimedia Commons category. Only activate this path when the
matched item has no Commons category, so that locations with a Commons cat
always get the same result regardless of the parameter.

Remove the nearest-polygon fallback that was returning incorrect results for
inland points in broad admin areas (e.g. returning Falmer for a point in
Brighton). That fallback found the nearest polygon by boundary distance
without requiring containment, so the pin would appear outside the polygon.
The geosearch handles these cases correctly.

Redesign the detail page: place name as heading, result card, collapsible
API response and SPARQL query, improved OSM element cards with left-border
highlight on the matched element, and a toggle button between modes.

Redesign the index page: two-column layout with numbered steps and API
documentation including the needs_commons parameter, Bootstrap form, and
examples as a table.

Closes #28 (Add support for returning Wikidata item instead of commons category)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 20:22:54 +01:00
b631476844 Add some more item types to ignore in geosearch 2024-01-10 09:15:27 +00:00
bd165e87e6 Add some more item types to ignore in geosearch 2024-01-09 11:54:56 +00:00
001468d267 Add some more item types to ignore in geosearch 2024-01-05 20:41:52 +00:00
474d9c6a66 Name match on aliases 2023-10-13 16:49:18 +01:00
2519ea74b8 Match on boundary=political 2023-10-13 16:48:56 +01:00
41a34856b8 Exclude some more item types from geosearch 2023-10-12 22:16:30 +01:00
faa0b3cb4e Bug fixes and improvements. 2023-10-10 07:27:25 +00:00
5fde13608f Tidy 2022-05-18 14:12:50 +01:00
fbcf3d102b bug fixes 2021-04-16 22:35:11 +02:00
dc24e3f7e7 split out more code 2021-04-16 22:24:59 +02:00