-
Notifications
You must be signed in to change notification settings - Fork 8
Closed as not planned
Labels
questionFurther information is requestedFurther information is requested
Description
Bug Description
When running the area/density endpoint the result is way too high (in swagger its over 4000).
From swagger UI examples for area endpoint (both request the same data):
curl -X POST "https://api.ohsome.org/v1/elements/area" -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "bboxes=8.67%2C49.39%2C8.71%2C49.42&filter=type%3Away%20and%20natural%3D*&format=json&time=2014-01-01%2F2017-01-01%2FP1Y"
area/density endpoint:
curl -X POST "https://api.ohsome.org/v1/elements/area/density" -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "bboxes=8.67%2C49.39%2C8.71%2C49.42&filter=type%3Away%20and%20natural%3D*&format=json&time=2014-01-01%2F2017-01-01%2FP1Y"
General Information
Please include the following general information about the issue and list any additional steps needed to reproduce the bug.
- Version of the ohsome API [e.g.
1.10.4
] - Which API instance was requested [e.g. remote instance at
https://api.ohsome.org/v1
, local instance with an h2 file or connected to the cluster, etc.] - Affected endpoint(s) [e.g. /contributions/count]
- URL of your request (and request body if applicable)
- Used HTTP method [GET or POST]
- Utilized tool/library for the request [e.g. cURL, Postman, ohsome-py, etc.]
Expected Behaviour
Should return a value between 0 and 1.
Further Information
Currently, the data/density endpoint calculates the area of the input geometry in sqkm but the data of the OSHDB response is in sqm. The error is in this line:
ohsome-api/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/AggregateRequestExecutor.java
Line 317 in 2d62b62
df.format(entry.getValue().doubleValue() / (Geo.areaOf(geom) * 0.000001)))); |
Just remove the multiplication and everything should work.
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested