Skip to content

Commit

Permalink
make sure groupByEntity is called before filters are set
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrasd committed Jan 22, 2021
1 parent c54cd1b commit aa84bb4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ public void extract() throws Exception {
String endTimestamp = IsoDateTimeParser.parseIsoDateTime(requestParameters.getTime()[1])
.format(DateTimeFormatter.ISO_DATE_TIME);
MapReducer<List<OSMContribution>> mapRedContributions = mapRedContribution.groupByEntity();
MapReducer<List<OSMEntitySnapshot>> mapRedSnapshots = mapRedSnapshot.groupByEntity();
Optional<FilterExpression> filter = processingData.getFilterExpression();
if (filter.isPresent()) {
mapRedSnapshot = mapRedSnapshot.filter(filter.get());
mapRedSnapshots = mapRedSnapshots.filter(filter.get());
mapRedContributions = mapRedContributions.filter(filter.get());
}
final boolean isContainingSimpleFeatureTypes = processingData.isContainingSimpleFeatureTypes();
Expand All @@ -124,8 +125,7 @@ public void extract() throws Exception {
MapReducer<Feature> snapshotPreResult = null;
if (!isContributionsEndpoint) {
// handles cases where valid_from = t_start, valid_to = t_end; i.e. non-modified data
snapshotPreResult = mapRedSnapshot
.groupByEntity()
snapshotPreResult = mapRedSnapshots
.filter(snapshots -> snapshots.size() == 2)
.filter(snapshots -> snapshots.get(0).getGeometry() == snapshots.get(1).getGeometry()
&& snapshots.get(0).getEntity().getVersion() == snapshots.get(1).getEntity()
Expand Down

0 comments on commit aa84bb4

Please sign in to comment.