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

new Endpoint: calculate indicator with given data #233

Closed
joker234 opened this issue Jan 19, 2022 · 4 comments · Fixed by #245
Closed

new Endpoint: calculate indicator with given data #233

joker234 opened this issue Jan 19, 2022 · 4 comments · Fixed by #245
Assignees
Labels
api comments welcome Indicates that the creator of this PR is open for early review comments enhancement New feature or request
Milestone

Comments

@joker234
Copy link
Member

joker234 commented Jan 19, 2022

Implement a possibility/endpoint to request one indicator with given data. The data to calculate the indicator comes through the request and not from the ohsome API.

Data that needs to be given:

  • indicator name: {"name": "name"}
  • input data:
    • {"data": {"value": "1", "timestamp": "iso"}}
  • layer
    • {layer: {"name": "name", "description": "description}}
  • geometry
    • {"bpolys": GeojsonObject}
@joker234 joker234 added the enhancement New feature or request label Jan 19, 2022
@joker234 joker234 added this to the Release 0.9.0 milestone Jan 19, 2022
@joker234 joker234 changed the title new Endpoint integrating new Endpoint: calculate indicator with given data Jan 19, 2022
@matthiasschaub
Copy link
Collaborator

Each Indicator object needs as input a geometry (GeoJSON Feature) and a layer which defines the attributes and aggregations on which to compute.

At the moment the layer class (LayerDefinition) consists of attributes name and description AND the ohsome API endpoint and filter parameters with which to retrive the data.

  • Indicator Input
    • Layer
      • name AND description
      • ohsome API endpoint and filter -> data
    • Geom

This issue suggest to provide the data on which to compute directly. Should the data stand for itself as input or be part of the Layer object.

Either:

  • Indicator Input
    • Layer
      • name AND description
    • Geom
    • Data

Or:

  • Indicator Input
    • Layer
      • name AND description
      • Data
    • Geom

Is it conceptually wrong that a layer has data attached to it?

Regarding the implementation of those two options in code. The first one would mean additional logic in each indicator.py (checking if data is present or not). The second one would mean the logic could be outsourced to ohsome/client.py (checking if given layer object has data attached to it?)

@matthiasschaub matthiasschaub added the comments welcome Indicates that the creator of this PR is open for early review comments label Jan 25, 2022
@Hagellach37
Copy link
Contributor

Hagellach37 commented Jan 25, 2022

I think that I prefer option 1, where data is not part of the layer.

For each indicator data does not always come from ohsome, but can also come from our DB directly, e.g. population. So I would try to avoid having several data objects in different places.

From my understanding the new endpoint would allow us to replace the data attributes that would normally be generated. For mapping saturation I can provide the timestamps and the values. But for other indicators I could in theory provide the population count and building density.

For each indicator we then check which data attributes are provided in the request and would get the missing one e.g. from ohsome or from the DB. So from my side it sounds okay to add a logic to indicator.py.

@Hagellach37
Copy link
Contributor

sorry for the confusion I mean option 1. :)

@joker234
Copy link
Member Author

Discussion result:

  • output data has to be renamed, data.… is confusing
  • input data are following option 2, but only ohsome API / OSM data related to “layer” definitions are allowed as input data
  • other input data are still only available through other data sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api comments welcome Indicates that the creator of this PR is open for early review comments enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants