ohsome-quality-api icon indicating copy to clipboard operation
ohsome-quality-api copied to clipboard

Pydantic input feature collection

Open ElJocho opened this issue 1 year ago • 2 comments

Description

We now use geojson_pydantic in our request_models which allows the users to have full information of the type of geojson that is required to query oqapi.

New or changed dependencies

  • removed the package geojson

Checklist

  • [x] I have updated my branch to main (e.g. through git rebase main)
  • [x] My code follows the style guide and was checked with pre-commit before committing
  • [x] I have added sufficient unit and integration tests
  • [ ] I have updated the CHANGELOG.md

ElJocho avatar Aug 23 '23 12:08 ElJocho

Looks good. Thanks for the tedious effort. A couple of things I would like to tackle before merging:

  • [x] Why does the area calculation differ?
  • [x] Write a custom mapper or loop for reproject coordinates (raster/client.py)
  • [x] Make properties optional. Often times properties are empty and not inlcuded in a GeoJSON. We should not be to strict on our side.
  • [x] Add CRS validator function as part of the custom request pydantic model
  • [ ] Review /tests @matthiasschaub
  • [ ] Add example to request model. Users should be able to fire up an example request using Swagger UI without changing anything.

matthiasschaub avatar Aug 31 '23 08:08 matthiasschaub

Looks good. Thanks for the tedious effort. A couple of things I would like to tackle before merging:

* [x]  Why does the area calculation differ?

* [x]  Write a custom mapper or loop for reproject coordinates (raster/client.py)

* [x]  Make properties optional. Often times properties are empty and not inlcuded in a GeoJSON. We should not be to strict on our side.

* [ ]  Add CRS validator function as part of the custom request pydantic model

* [ ]  Review /tests @matthiasschaub

* [ ]  Add example to request model. Users should be able to fire up an example request using Swagger UI without changing anything.

-> area calculation differs since geojson library rounds or cuts coordinate precision to 6 decimal spaces, pydantic_geojson does not

ElJocho avatar Sep 05 '23 11:09 ElJocho