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

Inconsistency in timestamps: some with, some without time zone #318

Closed
SlowMo24 opened this issue Nov 21, 2023 · 1 comment · Fixed by #319
Closed

Inconsistency in timestamps: some with, some without time zone #318

SlowMo24 opened this issue Nov 21, 2023 · 1 comment · Fixed by #319
Assignees
Labels
bug Something isn't working

Comments

@SlowMo24
Copy link
Contributor

Bug Description

The endpoint elements/count/groupBy/boundary returns timestamps with timezone

https://api.ohsome.org/v1/elements/count/groupBy/boundary?bboxes=8.67%2C49.39%2C8.71%2C49.42&filter=geometry%3Apoint%20and%20natural%3Dtree&time=2014-01-01

Response
{
  "attribution": {
    "url": "https://ohsome.org/copyrights",
    "text": "© OpenStreetMap contributors"
  },
  "apiVersion": "1.10.1",
  "groupByResult": [
    {
      "groupByObject": "boundary1",
      "result": [
        {
          "timestamp": "2014-01-01T00:00:00Z",
          "value": 850
        }
      ]
    }
  ]
}

while the endpoint elements/count/ratio/groupBy/boundary returns timestamps without timezone

https://api.ohsome.org/v1/elements/count/ratio/groupBy/boundary?bboxes=8.67%2C49.39%2C8.71%2C49.42&filter=geometry%3Apoint%20and%20natural%3Dtree&filter2=geometry%3Apoint%20and%20shop%3Dbakery&format=json&time=2014-01-01

Response
{
  "attribution": {
    "url": "https://ohsome.org/copyrights",
    "text": "© OpenStreetMap contributors"
  },
  "apiVersion": "1.10.1",
  "groupByBoundaryResult": [
    {
      "groupByObject": "boundary1",
      "ratioResult": [
        {
          "timestamp": "2014-01-01T00:00:00",
          "value": 850,
          "value2": 28,
          "ratio": 0.032941
        }
      ]
    }
  ]
}

General Information

  • Version of the ohsome API: 1.10.1
  • API instance https://api.ohsome.org/v1
  • Affected endpoint: I have only teste elements/count/ratio/groupBy/boundary
  • URL of your request (and request body if applicable): see above
  • Used HTTP method: GET but it should not matter
  • Utilized tool/library for the request: swagger or curl, should not matter

Expected Behaviour

Either always return a time zone, or never (which I would prefer).

Further Information

Error Messages, Logs, Screenshots

None

Additional Information

None

Notes

None

//cc @rp280

@SlowMo24 SlowMo24 added the bug Something isn't working label Nov 21, 2023
@tyrasd tyrasd changed the title Inconsistency in timestamps: wome with, some without time zone Inconsistency in timestamps: some with, some without time zone Nov 23, 2023
@tyrasd
Copy link
Member

tyrasd commented Nov 23, 2023

At first glance, it seems that the /elements/(aggregation)/ratio/groupBy/boundary is the only endpoint which does not return a timestamp with explicit Z timezone. The documentation has also always included the timezone in the examples. I agree that we should consistently always return the same format, but to limit the scope of the fix, let's stick to the format including the Z.

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 a pull request may close this issue.

2 participants