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

Pydantic input feature collection #704

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

ElJocho
Copy link
Contributor

@ElJocho ElJocho commented Aug 23, 2023

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

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

@matthiasschaub
Copy link
Collaborator

matthiasschaub commented Aug 31, 2023

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

  • Why does the area calculation differ?
  • Write a custom mapper or loop for reproject coordinates (raster/client.py)
  • 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.

@ElJocho
Copy link
Contributor Author

ElJocho commented Sep 5, 2023

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 ElJocho added enhancement New feature or request api labels Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants