Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix contributions extraction endpoints for non-final deletions #324

Merged
merged 6 commits into from
May 17, 2024

Conversation

tyrasd
Copy link
Member

@tyrasd tyrasd commented Feb 23, 2024

This is the case when a deletion happens which was reverted later on. These "deletion" contributions are currently missing in the output of /contributions extraction endpoints.

For example curl -X GET "https://api.ohsome.org/v1/contributions/geometry?bboxes=-180%2C-90%2C180%2C90&clipGeometry=true&filter=type%3Anode%20and%20id%3A1&properties=tags%2CcontributionTypes&time=2009-01-01%2C2012-01-01" -H "accept: application/json", for node/1 one gets:

  
  }, {
    "type" : "Feature",
    "geometry" : {
      "type" : "Point",
      "coordinates" : [
        2.0,
        2.0
      ]
    },
    "properties" : {
      "@contributionChangesetId" : 524633,
      "@geometryChange" : true,
      "@osmId" : "node/1",
      "@tagChange" : true,
      "@timestamp" : "2009-04-14T15:42:57Z"
    }
  }, {
    "type" : "Feature",
    "geometry" : {
      "type" : "Point",
      "coordinates" : [
        9.4317166,
        51.2492152
      ]
    },
    "properties" : {
      "@contributionChangesetId" : 9035746,
      "@geometryChange" : true,
      "@osmId" : "node/1",
      "@timestamp" : "2011-08-16T11:26:47Z"
    }
  }, {
  

Note that there is no contribution on 2009-07-07T22:44:41Z, corresponding to version 4 of the node. This would be the expected result:

  
  }, {
    "type" : "Feature",
    "geometry" : {
      "type" : "Point",
      "coordinates" : [
        2.0,
        2.0
      ]
    },
    "properties" : {
      "@contributionChangesetId" : 524633,
      "@geometryChange" : true,
      "@osmId" : "node/1",
      "@tagChange" : true,
      "@timestamp" : "2009-04-14T15:42:57Z"
    }
  }, {
    "type" : "Feature",
    "geometry" : null,
    "properties" : {
      "@contributionChangesetId" : 1767082,
      "@deletion" : true,
      "@osmId" : "node/1",
      "@timestamp" : "2009-07-07T22:44:41Z"
    }
  }, {
    "type" : "Feature",
    "geometry" : {
      "type" : "Point",
      "coordinates" : [
        9.4317166,
        51.2492152
      ]
    },
    "properties" : {
      "@contributionChangesetId" : 9035746,
      "@geometryChange" : true,
      "@osmId" : "node/1",
      "@timestamp" : "2011-08-16T11:26:47Z"
    }
  }, {
  

Checklist

@tyrasd tyrasd added the bug Something isn't working label Feb 23, 2024
@tyrasd tyrasd marked this pull request as draft February 23, 2024 15:32
i.e. when a deletion happens which was reverted later on. these "deletion" contributions are currently missing in the output
@tyrasd tyrasd force-pushed the fix-contribution-deletions branch from e225fe4 to f0a300d Compare April 18, 2024 17:21
@tyrasd tyrasd marked this pull request as ready for review April 19, 2024 07:47
Copy link
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.

❤️

@tyrasd tyrasd merged commit 4bc85d0 into main May 17, 2024
2 checks passed
@tyrasd tyrasd deleted the fix-contribution-deletions branch May 17, 2024 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants