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

editoast: TrackSectionModel & crate geos #3836

Merged
merged 1 commit into from
Apr 7, 2023
Merged

Conversation

leovalais
Copy link
Contributor

As part of the work to migrate /pathfinding endpoints to editoast.

  • Adds a naive TrackSectionModel to retrieve track sections from the DB using the Model API. There is probably a smarter/more generic way to do this but that is subject for another PR.
  • Replaces the basic LineString implementation with the crate geos::geojson which is a reexport of the crate geojson.
  • Introduces the crate geos that can perform some operations on geometries defined using geojson objects (among other things) that will prove useful when migrating the endpoint POST and PUT /pathfinding. It uses the same underlying GEOS C lib than Django's Postgis extension.

@leovalais leovalais requested a review from a team as a code owner April 6, 2023 10:47
@leovalais leovalais force-pushed the lva/track-section-model branch from 1f8f5bc to 9779ca9 Compare April 6, 2023 13:45
@codecov
Copy link

codecov bot commented Apr 6, 2023

Codecov Report

Merging #3836 (a6f1f9c) into dev (6bac1bf) will decrease coverage by 0.05%.
The diff coverage is 73.17%.

❗ Current head a6f1f9c differs from pull request most recent head ec17d7a. Consider uploading reports for the commit ec17d7a to get more accurate results

@@             Coverage Diff              @@
##                dev    #3836      +/-   ##
============================================
- Coverage     69.81%   69.77%   -0.05%     
  Complexity     2016     2016              
============================================
  Files           439      439              
  Lines         22001    22018      +17     
  Branches       1662     1662              
============================================
+ Hits          15361    15362       +1     
- Misses         5845     5861      +16     
  Partials        795      795              
Flag Coverage Δ
editoast 74.65% <73.17%> (-0.31%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
editoast/src/models/mod.rs 37.03% <ø> (ø)
editoast/src/schema/mod.rs 94.64% <ø> (ø)
editoast/src/tables.rs 0.00% <ø> (ø)
editoast/src/views/pathfinding.rs 12.90% <0.00%> (-1.39%) ⬇️
editoast/src/map/bounding_box.rs 38.01% <75.00%> (+9.30%) ⬆️
editoast/src/infra_cache/mod.rs 71.84% <100.00%> (ø)
editoast/src/schema/track_section.rs 100.00% <100.00%> (+5.55%) ⬆️

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@leovalais leovalais force-pushed the lva/track-section-model branch from 9779ca9 to 28ec5e7 Compare April 6, 2023 13:48
@leovalais leovalais requested a review from Castavo April 6, 2023 13:49
Copy link
Contributor

@flomonster flomonster left a comment

Choose a reason for hiding this comment

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

Thanks for this PR! I found an error using the get_pf endpoint.

Copy link
Contributor

@Castavo Castavo left a comment

Choose a reason for hiding this comment

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

The replacement of the LineString Enum is nice !
I have yet to test this

@leovalais leovalais force-pushed the lva/track-section-model branch 2 times, most recently from ab7ed11 to a6f1f9c Compare April 6, 2023 17:02
@leovalais leovalais force-pushed the lva/track-section-model branch from a6f1f9c to ec17d7a Compare April 6, 2023 17:03
@leovalais leovalais requested review from flomonster and Castavo April 6, 2023 17:18
Copy link
Contributor

@flomonster flomonster left a comment

Choose a reason for hiding this comment

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

LGTM! Well done!

I've tested to retrieve and delete a path.

Copy link
Contributor

@Castavo Castavo left a comment

Choose a reason for hiding this comment

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

I checked both GET and DELETE (while running with cargo), it works 👌

@leovalais leovalais merged commit 605d756 into dev Apr 7, 2023
@leovalais leovalais deleted the lva/track-section-model branch April 7, 2023 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants