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

Closed
wants to merge 17 commits into 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
@matthiasschaub matthiasschaub self-assigned this Aug 28, 2024
matthiasschaub added a commit that referenced this pull request Sep 26, 2024
use Pydantic model from the `geojson-pydantic` library as request model
for `bpolys`.

Closes #704
(Closes #704)
matthiasschaub added a commit that referenced this pull request Sep 26, 2024
use Pydantic model from the `geojson-pydantic` library as request model
for `bpolys`.

Closes #704
(Closes #704)
@matthiasschaub matthiasschaub added the waiting for review This pull request urgently needs a code review label Sep 26, 2024
@matthiasschaub matthiasschaub marked this pull request as draft September 26, 2024 03:35
Copy link
Collaborator

@matthiasschaub matthiasschaub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

succeeded by #824

@matthiasschaub matthiasschaub removed the waiting for review This pull request urgently needs a code review label Sep 26, 2024
@mmerdes mmerdes closed this in #824 Sep 27, 2024
mmerdes pushed a commit that referenced this pull request Sep 27, 2024
use Pydantic model from the `geojson-pydantic` library as request model
for `bpolys`.

Closes #704
(Closes #704)
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.

2 participants