Skip to content

[oshdb-filter] allow filtering by changeset id and (optionally) contributor id#380

Merged
tyrasd merged 34 commits into
masterfrom
filter-contributions
Jun 12, 2021
Merged

[oshdb-filter] allow filtering by changeset id and (optionally) contributor id#380
tyrasd merged 34 commits into
masterfrom
filter-contributions

Conversation

@tyrasd
Copy link
Copy Markdown
Member

@tyrasd tyrasd commented May 14, 2021

Description

This enhances the oshdb-filter module to be able to filter by osm contributions or osm entity snapshots.

This can be used to implement further filters, like these two new ones:

  • changeset: <id> to filter contributions by changeset id
  • contributor: <id> to filter contributions by user id (disabled by default, can be activated by creating a filter parser with the respective optional boolean flag enabled)

Corresponding issue

Closes #358

todo

  • integrate into map reducer
  • update documentation/changelog/upgrading instructions.

Checklist

@tyrasd tyrasd added the enhancement New feature or request label May 14, 2021
@tyrasd tyrasd force-pushed the filter-contributions branch 6 times, most recently from fd3c79d to df7615e Compare May 18, 2021 16:21
@tyrasd tyrasd changed the title 🚧 [oshdb-filter] allow filtering by changeset id and (optionally) contributor id [oshdb-filter] allow filtering by changeset id and (optionally) contributor id May 19, 2021
@tyrasd tyrasd added the waiting for review This pull request needs a code review label May 19, 2021
@rtroilo rtroilo self-requested a review May 20, 2021 09:32
Copy link
Copy Markdown
Member

@rtroilo rtroilo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A very nice PR. I think we should also include

  • ChangesetIdFilterEqualsAnyOf
  • ContributorUserIdFilterEqualsAnyOf

as well. They should be very quick to implemented as far as I see the code.
In my opinion it could be a quite common use-case that you got a list of changeset ids and/or contributor ids which you want to use in a filter as well.

Comment thread oshdb-api/src/main/java/org/heigit/ohsome/oshdb/api/mapreducer/MapReducer.java Outdated
Comment thread oshdb-api/src/main/java/org/heigit/ohsome/oshdb/api/mapreducer/MapReducer.java Outdated
Comment thread oshdb-api/src/main/java/org/heigit/ohsome/oshdb/api/mapreducer/MapReducer.java Outdated
Comment thread oshdb-api/src/main/java/org/heigit/ohsome/oshdb/api/object/package-info.java Outdated
Comment thread oshdb-api/src/main/java/org/heigit/ohsome/oshdb/api/mapreducer/MapAggregator.java Outdated
Comment thread oshdb-api/src/main/java/org/heigit/ohsome/oshdb/api/mapreducer/MapAggregator.java Outdated
Comment thread oshdb-filter/src/main/java/org/heigit/ohsome/oshdb/filter/FilterExpression.java Outdated
@tyrasd tyrasd force-pushed the filter-contributions branch 2 times, most recently from e8da0c9 to 3fa0cc1 Compare May 20, 2021 14:46
@tyrasd tyrasd force-pushed the filter-contributions branch from 3fa0cc1 to 19aef10 Compare May 20, 2021 16:53
@tyrasd tyrasd force-pushed the filter-contributions branch from 3c5bec7 to 23067fb Compare May 25, 2021 15:08
Copy link
Copy Markdown
Member

@rtroilo rtroilo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • There are some code refactorings, changing interfaces to abstract classes, etc. Which we could discuss in PR #385.
  • The NegatableFilter wrapping for ContributionType could be potentially wrong, see comment.

tyrasd and others added 5 commits May 27, 2021 15:43
Co-authored-by: Rafael Troilo <rafael.troilo@heigit.org>
Reason: They did not really fulfil a specific purpose because one can already "and" combine OSH+OSM filters by calling `.filter` twice, and the geometry callback filter basically just replicates the `.filter(Predicate)` anyway.
Also the given documentation and examples were not in line with the actual behaviour when one would have negated the filter, so it in the end just confusing to use.
@tyrasd tyrasd force-pushed the filter-contributions branch from c8af432 to 9f8fecf Compare June 2, 2021 10:06
@tyrasd tyrasd force-pushed the filter-contributions branch from 5e51a5c to d130193 Compare June 4, 2021 13:51
@tyrasd tyrasd requested a review from rtroilo June 4, 2021 15:53
rtroilo
rtroilo previously approved these changes Jun 11, 2021
Copy link
Copy Markdown
Member

@rtroilo rtroilo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for this pr!
I added a minor suggested change.

Co-authored-by: Rafael Troilo <rafael.troilo@heigit.org>
@tyrasd tyrasd merged commit 3e5119a into master Jun 12, 2021
@tyrasd tyrasd deleted the filter-contributions branch June 12, 2021 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[oshdb-filter] filter by changeset id or list of change set ids

2 participants