You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Query Features should only show features in date range #1163
Bug description
When you right click on the map and select Query Features it returns all enclosing features that exist at that point.
I believe it should only show features that exist in the selected date.
Currently when I want to see surrounding features there are 300 British Empire and Spanish Empire relations clogging up the list, that I have to look through. (Totally my fault)
Alternate Solution
We could have a separate button to show all surrounding features, though I don't really see a reason for that.
We could have a separate button to show all surrounding features, though I don't really see a reason for that.
Sometimes I do need to find a feature by location without knowing its exact dates, especially if it was shortlived. But I think we could get this option for free by making date filtering optional overall: #930.
This feature could work with the current date on the slider and show only the objects whose start_date is greater than or equal to the current date. If you want to see all objects, you could set the year to 0 and filter from there.
// Example with currentDate = 1952:
// - Object 1952-2000: 1952 >= 1952 ✓ (matches)
// - Object 1960-2000: 1960 >= 1952 ✓ (matches)
// - Object 1900-1950: 1900 >= 1952 ✗ (starts before current date, excluded)
// - Object start_date=1600: 1600 >= 1952 ✗ (starts before current date, excluded)
// - Object (no start_date): no start_date ✓ (included - unknown creation date)
This is a start to see that it is possible to filter by dates in Overpass. Is it necessary to include end_date? I could modify the script in case we need to set a specific range.
That looks promising. It’ll be a big usability improvement (as well as a performance improvement).
The query on staging is returning four boundaries that didn’t exist in 1950. From the branch so far, it looks like you might’ve taken my suggestion to base it off this example, but I forgot to mention two caveats:
The example is only granular down to the year.
The example only considers start_date=* and assumes the results still exist.
This query considers both start_date=* and end_date=* down to the day. With a few modifications, I think your changes will yield the correct results.
The query on staging is returning four boundaries that didn’t exist in 1950
We are using the production Overpass endpoint in staging because we don't have a specific Overpass stack for staging. that maybe the reason some object does not exist in staging, it comes from production DB , On the other hand, I have modified the script according to the example and it now returns better results according to the current date
Activity
1ec5 commentedon Oct 16, 2025
Related to filtering Nominatim results by date (#196), but far more straightforward. Here’s where we construct the Overpass queries:
https://github.com/OpenHistoricalMap/ohm-website/blob/c0ac066115115e8e8c17d475ce8d796d6f1f5bfc/app/assets/javascripts/index/query.js#L315-L318
Here’s an example Overpass query that filters by a given point in time.
1ec5 commentedon Oct 16, 2025
Sometimes I do need to find a feature by location without knowing its exact dates, especially if it was shortlived. But I think we could get this option for free by making date filtering optional overall: #930.
Rub21 commentedon Nov 28, 2025
This feature could work with the current date on the slider and show only the objects whose start_date is greater than or equal to the current date. If you want to see all objects, you could set the year to 0 and filter from there.
This is a start to see that it is possible to filter by dates in Overpass. Is it necessary to include end_date? I could modify the script in case we need to set a specific range.
Changes: https://github.com/OpenHistoricalMap/ohm-website/blob/ffbfa72982ab3a29b6094fc18701c654eb4e5d10/app/assets/javascripts/index/query.js#L307-L358
Current filter in production
Staging filters
https://staging.openhistoricalmap.org/query?lat=-12.05321&lon=-77.11226#map=15/-12.05796/-77.10218&layers=O&date=1950-10-14&daterange=1825-01-01,2025-12-31
1ec5 commentedon Nov 29, 2025
That looks promising. It’ll be a big usability improvement (as well as a performance improvement).
The query on staging is returning four boundaries that didn’t exist in 1950. From the branch so far, it looks like you might’ve taken my suggestion to base it off this example, but I forgot to mention two caveats:
start_date=*and assumes the results still exist.This query considers both
start_date=*andend_date=*down to the day. With a few modifications, I think your changes will yield the correct results.Rub21 commentedon Dec 2, 2025
We are using the production Overpass endpoint in staging because we don't have a specific Overpass stack for staging. that maybe the reason some object does not exist in staging, it comes from production DB , On the other hand, I have modified the script according to the example and it now returns better results according to the current date
PR: OpenHistoricalMap/ohm-website#356
Rub21 commentedon Dec 5, 2025
I made some other changes to the script so that it can filter the data below 1000 with JavaScript; it works fine now.
Rub21 commentedon Dec 19, 2025
This feature has been deployed in production. The features now return according to the current slider date.