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
I'm confused. The screenshot just shows a tag applied to the selected object, right? It's not a filter of what's on the map at all, but rather just another, less formatted version of the tagged date above, where iD throws all tags attached to an object.
I think date filtering inside iD would be a new feature request, best filed over in the iD repo. I recall discussions of this with Seth and iD has its own methods of fetching and rendering data, so our current timeline filter for vector tiles isn't immediately relevant.
I think that's actually a filter for all the data shown in the editing window, which is why it's on the right-side panel, as opposed to somewhere else. All of the other elements on this panel relate to all data.
But now we only have the one checkbox for the "show all"
We don't have the fields for start_date and end_date -- which is probably easy to fix by rechanging this YAML file, but I don't think the values in those fields didn't ever work.
The goal in this issue would be that I can do the following:
enter a start_date and see only data that starts on or after that date
enter an end_date and see data that ends on or before that date
One or both dates could be present, and if both are absent, all data is returned. So we need to be able to both get those fields back and apply >= and =< logic to them. Since iD is D3, this must be possible, but we also want to do it in the most iD-friendly way that doesn't get us in trouble for future updates.
I had a bit of an unfortunate "aha" moment on this. Currently we are creating decimal_date values that are easy to sort and filter at the point of vector tile generation. We chose to do this because we thought these data are just for the timeslider and just for machine reading and rendering, and we shouldn't pollute the tags in OHM with math0based versions of user-entered content that also shouldn't be edited by users for us to be confident that the decimal_date values are consistently made by formula.
That is I think still the right approach overall, esp using machine processes to make sortable date versions, BUT it means that when we want to filter by date in iD (or JOSM) we still just have the text strings to work with. I am not sure what approach is best here
The harder part is figuring out where we could intervene in iD to apply the decimaldate.iso2dec function and then filter on it. I'm wondering now about doing this outside of iD if we could simply load our own script that targets the D3 that iD has loaded already and filters it, so that one simply can't select stuff to edit it. In that case, maybe we could apply our timeslider directly to the page and make it act on D3 data in some way. Lots of handwaving there, but feeling a bit more plausible than just "customize iD in some way to transform and filter data".
I think this is a case where we definitely want to allow users to disable timeslider and "show all", so for example they can fix date formatting.
🔴 Not sure why this one isn't working ✅ This is working fine, my brain was misfiring
Here's a railway in Europe with a full start date but no end date, similar to things we saw working in Seattle:
This doesn't seem to be working as expected. I would expect the railway that started in 1856 to disappear from the edit window is my start date is <1856.
Current algorithm is to take the first 4 characters, so "2000-03" or "2000-03-01" are still simply the integer 2000 Confirmed by altering the features' tags in memory, though in reality I don't see any features to "really" test.
Confirmed a malfunction here: the date filter is ineffective if no Map Features checkbox is unchecked. That is: date filter only works if any Map Features checkbox is unchecked. That's because of the first line here which simply returns "no, it's not hidden" unless a category is hidden.
features.isHiddenFeature = function(entity, resolver, geometry) {
if (!_hidden.length) return false;
if (!entity.version) return false;
if (_forceVisible[entity.id]) return false;
const matchesdatefilter = features.checkDateFilter(entity);
if (! matchesdatefilter) return true;
var matches = Object.keys(features.getMatches(entity, resolver, geometry));
return matches.length && matches.every(function(k) { return features.hidden(k); });
};
Checked and confirmed, that _hidden is redefined by features.hidden() when the checkboxes change.
So that's the first to-do:
removing if (!_hidden.length) return false; from here,
but also checking around to see what else could be broken by this.
URL params
The reason I never noticed this, is that when using standalone iD on localhost, there are some default behaviors that the "Boundaries" checkbox is always unchecked immediately after page load. Therefore, I have to contrive to check al of the Map Features and trigger this bug. So now I know...
But this does beg a question, why none of iD's URL param behaviors are effective when used on staging under the /edit URI. This would include saving the date range filter, for example. Then again, if people aren't accustomed to having these checkboxes saved into URL params and loaded, maybe this is a no-op.
But this does beg a question, why none of iD's URL param behaviors are effective when used on staging under the /edit URI. This would include saving the date range filter, for example. Then again, if people aren't accustomed to having these checkboxes saved into URL params and loaded, maybe this is a no-op.
I think in a standard OSM flow, the URL params other than map center and zoom are not relevant. In the context of OHM, ideally we would pass time settings from view into edit, though I wonder if we should treat that as a separate issue/enhancement. Since iD filter is a range and timeslider is a single date slice, it's not immediately obvious what we'd pass in. Maybe the timeslider min and max?
Activity
danrademacher commentedon Jun 12, 2020
I'm confused. The screenshot just shows a tag applied to the selected object, right? It's not a filter of what's on the map at all, but rather just another, less formatted version of the tagged date above, where iD throws all tags attached to an object.
I think date filtering inside iD would be a new feature request, best filed over in the iD repo. I recall discussions of this with Seth and iD has its own methods of fetching and rendering data, so our current timeline filter for vector tiles isn't immediately relevant.
jeffreyameyer commentedon Jun 18, 2020
I think that's actually a filter for all the data shown in the editing window, which is why it's on the right-side panel, as opposed to somewhere else. All of the other elements on this panel relate to all data.
danrademacher commentedon Jun 18, 2020
Oh I see! Sorry I missed that. And I see @jimmyrocks added it here:
OpenHistoricalMap/iD@f94febf
Hm, looking closer to see why that's not working
danrademacher commentedon Jan 20, 2021
Picking this up again and also noted the older issue at #177.
In this commit @jimmyrocks added the "Show all dates" and the date filter fields to
core.yaml:OpenHistoricalMap/iD@1b5899e#diff-91dcbb736588a1ec670550f0d0b71c5acff2bf2a9d233cf591b4f22e74d0bc42
But now we only have the one checkbox for the "show all"

We don't have the fields for
start_dateandend_date-- which is probably easy to fix by rechanging this YAML file, but I don't think the values in those fields didn't ever work.The goal in this issue would be that I can do the following:
start_dateand see only data that starts on or after that dateend_dateand see data that ends on or before that dateOne or both dates could be present, and if both are absent, all data is returned. So we need to be able to both get those fields back and apply
>=and=<logic to them. Since iD is D3, this must be possible, but we also want to do it in the most iD-friendly way that doesn't get us in trouble for future updates.danrademacher commentedon Jan 22, 2021
I had a bit of an unfortunate "aha" moment on this. Currently we are creating
decimal_datevalues that are easy to sort and filter at the point of vector tile generation. We chose to do this because we thought these data are just for the timeslider and just for machine reading and rendering, and we shouldn't pollute the tags in OHM with math0based versions of user-entered content that also shouldn't be edited by users for us to be confident that thedecimal_datevalues are consistently made by formula.That is I think still the right approach overall, esp using machine processes to make sortable date versions, BUT it means that when we want to filter by date in iD (or JOSM) we still just have the text strings to work with. I am not sure what approach is best here
danrademacher commentedon Feb 16, 2021
We were just discussing on checkin and approach that seems best:
danrademacher commentedon Feb 17, 2021
Noting we're pretty far behind the upstream at https://github.com/OpenHistoricalMap/iD:
4127 commits behind openstreetmap:developSo another case where we need to catch up, retain our measly 27 commits, before we start making new mods.
Reading this bit: https://github.com/OpenHistoricalMap/iD/blob/staging/API.md#customized-deployments, not sure I'm getting anything there about how one does this without making future updates difficult.
danrademacher commentedon Feb 17, 2021
I totally forgot about this: https://github.com/OpenHistoricalMap/decimaldate-javascript Is this what we need to apply this in JS within iD? Needs further study but seems promising on item 1 in #93 (comment).
We later created the pad-date functions, https://github.com/OpenHistoricalMap/paddate-python, so I think we'd also need to re-implement those, but I suspect that's a light lift.
The harder part is figuring out where we could intervene in iD to apply the
decimaldate.iso2decfunction and then filter on it. I'm wondering now about doing this outside of iD if we could simply load our own script that targets the D3 that iD has loaded already and filters it, so that one simply can't select stuff to edit it. In that case, maybe we could apply our timeslider directly to the page and make it act on D3 data in some way. Lots of handwaving there, but feeling a bit more plausible than just "customize iD in some way to transform and filter data".I think this is a case where we definitely want to allow users to disable timeslider and "show all", so for example they can fix date formatting.
16 remaining items
OpenHistoricalMap/issues#93 Date Range panel URL 'daterange' param
danrademacher commentedon Mar 16, 2021
Testing locally and looking good!
For the screenshots below, I disabled the underlying map layer to focus attention on what is or is not on the map.
Here's Seattle 1800-1850:

Compared to everything:

So overall, seems to be working.
Looking for some test cases so we can look at edge issues:
✅ Has Start Date, no End date
Working as expected. Here
✅ Has End Date, no Start Date
Here's one with Start Date and no End:
http://localhost:8080/#background=none&daterange=-4000,2000&disable_features=boundaries&id=w198285108&map=16.00/47.5912/-122.3164
✅ Has neither start nor end, should always appear
This works as expected:

❔ Has Year only in Start or End
Need to find item like this to test
❔Has Year-Month in Start or End
Need to find item like this to test
🔴 Not sure why this one isn't working✅ This is working fine, my brain was misfiringHere's a railway in Europe with a full start date but no end date, similar to things we saw working in Seattle:This doesn't seem to be working as expected. I would expect the railway that started in 1856 to disappear from the edit window is my start date is <1856.Working just fine here:
http://localhost:8080/#background=none&daterange=1850,1855&map=16.00/47.4730/9.4682
gregallensworth commentedon Mar 16, 2021
This is already thoroughly tested, e.g. Occidental Hotel has "1861" and "1880" for the start & end, and is known to work.
http://localhost:8080/#background=Bing&daterange=1850,1860&disable_features=boundaries&map=18.94/47.60207/-122.33359
http://localhost:8080/#background=Bing&daterange=1861,1865&disable_features=boundaries&map=18.94/47.60207/-122.33359
gregallensworth commentedon Mar 16, 2021
Current algorithm is to take the first 4 characters, so "2000-03" or "2000-03-01" are still simply the integer 2000 Confirmed by altering the features' tags in memory, though in reality I don't see any features to "really" test.
gregallensworth commentedon Mar 16, 2021
I have an improvement for this, to properly extract the year from any string as well as to supply Infinity/-Infinity for empty dates.
OpenHistoricalMap/issues#93 (comment) Date Range filter improvement r…
gregallensworth commentedon Mar 16, 2021
The behavior is correct: 1858 - 1900, does overlap with 1856 - Infinity So the railroad should show, and does.
The railroad should vanish when the End Date is < 1856, so we're looking at a slice of time before the railway was created. And this does appear to work: http://localhost:8080/#background=none&daterange=-4000,1855&map=16.00/47.4730/9.4682
gregallensworth commentedon Mar 30, 2021
Only when a Map Features category is a unchecked
Confirmed a malfunction here: the date filter is ineffective if no Map Features checkbox is unchecked. That is: date filter only works if any Map Features checkbox is unchecked. That's because of the first line here which simply returns "no, it's not hidden" unless a category is hidden.
Checked and confirmed, that
_hiddenis redefined byfeatures.hidden()when the checkboxes change.So that's the first to-do:
if (!_hidden.length) return false;from here,URL params
The reason I never noticed this, is that when using standalone iD on localhost, there are some default behaviors that the "Boundaries" checkbox is always unchecked immediately after page load. Therefore, I have to contrive to check al of the Map Features and trigger this bug. So now I know...
But this does beg a question, why none of iD's URL param behaviors are effective when used on staging under the /edit URI. This would include saving the date range filter, for example. Then again, if people aren't accustomed to having these checkboxes saved into URL params and loaded, maybe this is a no-op.
danrademacher commentedon Mar 30, 2021
Regarding this question:
I think in a standard OSM flow, the URL params other than map center and zoom are not relevant. In the context of OHM, ideally we would pass time settings from view into edit, though I wonder if we should treat that as a separate issue/enhancement. Since iD filter is a range and timeslider is a single date slice, it's not immediately obvious what we'd pass in. Maybe the timeslider min and max?
OpenHistoricalMap/issues#93 (comment) iD Date Ranger now works with n…
danrademacher commentedon Apr 6, 2021
This is deployed and running on ohm-website. Will have a separate issue for iD in Tasking Maanger