Commit graph

33 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
7235df4cad Fix coordinate parsing to handle DMS format and prevent stack traces
- Add parse_coordinate() function to handle both decimal degrees and DMS format
- Replace direct float() conversion with robust coordinate parsing
- Add proper validation for latitude/longitude ranges
- Create user-friendly error page instead of showing stack traces
- Support formats like "56°5'58.56"N" and "3°22'33.71"W"
- Update both /detail and / routes with improved error handling

Fixes #29: Don't return stack trace when lat/lon are not integers
2025-07-15 09:05:31 +00:00
e9193be3cc Add missing templates 2024-01-10 16:26:24 +00:00
e1f6b09ec1 Web interface with map where user can place pin for testing
Closes: #21
2024-01-10 16:25:22 +00:00
1625f3d5d1 Show SPARQL query on details page with link to WDQS
Closes: #23
2024-01-10 16:24:54 +00: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
12598ac098 New location for git repo 2024-01-06 11:41:48 +00:00
001468d267 Add some more item types to ignore in geosearch 2024-01-05 20:41:52 +00:00
a8c4cc51f6 Reorder page to show tables in columns 2023-12-22 12:18:28 +00:00
223cdc4728 Report 100 most recent results where missing=true
Closes: #16
2023-12-15 11:16:35 +00:00
96e3bac55c Show average response time on reports page
Closes: #13
2023-12-10 17:31:31 +00:00
8bfe86ee82 Add reports page
Closes: #7
2023-12-10 10:32:15 +00:00
b671843aea Show error page
Closes: #10
2023-11-25 14:29:34 +00:00
65d1fbf6fa Update query error template to extend base.html 2023-11-25 13:58:39 +00:00
b785bdb495 Add link from detail page to home 2023-11-25 13:58:13 +00:00
d425133423 Catch database connection error and show error page
Closes: #5
2023-11-17 12:21:07 -03:00
a6286cb05f Show map on details page
Includes pin and polygon

Closes: #4
2023-11-03 10:32:18 +00:00
d24744bc29 Various improvements 2023-10-13 19:11:02 +01: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
89549b750f Add missing template 2022-05-18 14:13:29 +01:00
5fde13608f Tidy 2022-05-18 14:12:50 +01:00
a5f7ba917d Bug fixes 2022-05-18 14:12:34 +01:00
44241751b2 Query database instead of overpass 2021-04-17 18:31:58 +02:00
fbcf3d102b bug fixes 2021-04-16 22:35:11 +02:00
59611dd077 reorder functions and rename template 2021-04-16 22:30:25 +02:00
dc24e3f7e7 split out more code 2021-04-16 22:24:59 +02:00
c3094355d7 More detail 2021-04-15 12:27:28 +01:00
656b0bbbc1 Add brief documentation 2021-04-15 12:26:49 +01:00
2235675418 initial commit 2019-08-18 15:56:53 +01:00