Skip to content

[Feat] 코스 polyline 경사 등급 segments 응답 추가#175

Merged
JangInho merged 3 commits into
developfrom
feat/#114-course-slope-segments
Jun 2, 2026
Merged

[Feat] 코스 polyline 경사 등급 segments 응답 추가#175
JangInho merged 3 commits into
developfrom
feat/#114-course-slope-segments

Conversation

@JangInho

@JangInho JangInho commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

🧾 요약

  • GET /api/courses/{courseId} 응답에 polyline 의 연속된 같은 경사 등급 구간(segments) 을 함께 반환한다.

🔗 이슈

✨ 변경 내용

  • 클라이언트는 각 segment 의 startIdx~endIdx(둘 다 inclusive) 범위의 좌표를 등급별 색(5단계: STEEP_DOWN/MILD_DOWN/FLAT/MILD_UP/STEEP_UP) 으로 그릴 수 있다.
  • altitudes 이동평균(window=5) 으로 GPS 노이즈 완화
  • 인접 점 수평거리(Haversine) + 고도차로 경사도(%) 계산
  • ±5% / ±15% 임계로 5단계 분류
  • 같은 등급 연속 구간 묶기
  • Swagger 문서(@operation description / @Schema) 도 보강

✅ 확인

  • 빌드 OK
  • 테스트 OK

GET /api/courses/{courseId} 응답에 polyline 의 연속된 같은 경사 등급 구간(segments) 을 함께 반환한다.
클라이언트는 각 segment 의 startIdx~endIdx(둘 다 inclusive) 범위의 좌표를
등급별 색(5단계: STEEP_DOWN/MILD_DOWN/FLAT/MILD_UP/STEEP_UP) 으로 그릴 수 있다.

처리:
- altitudes 이동평균(window=5) 으로 GPS 노이즈 완화
- 인접 점 수평거리(Haversine) + 고도차로 경사도(%) 계산
- ±5% / ±15% 임계로 5단계 분류
- 같은 등급 연속 구간 묶기

Swagger 문서(@operation description / @Schema) 도 함께 보강.
@JangInho JangInho self-assigned this Jun 2, 2026
@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 76bbd07c-ddb4-4171-b5ce-1d9cca3b041f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#114-course-slope-segments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 코스 상세 조회 API 응답에 경사 등급 정보를 포함하는 기능을 추가합니다. 기존의 polyline과 고도 데이터를 활용하여 코스의 경사도를 분석하고, 이를 연속된 구간(segments)으로 묶어 반환함으로써 클라이언트 측에서 코스의 난이도를 시각적으로 표현할 수 있도록 지원합니다.

Highlights

  • 경사 등급 세그먼트 계산 로직 추가: 코스 상세 조회 시 polyline의 각 구간별 경사도를 계산하여 5단계(STEEP_DOWN, MILD_DOWN, FLAT, MILD_UP, STEEP_UP)로 분류하는 기능을 구현했습니다.
  • 데이터 품질 개선: GPS 노이즈 완화를 위해 고도 데이터에 이동평균(window=5) 필터를 적용하고, Haversine 공식을 사용하여 인접 점 간의 수평 거리를 정확하게 산출합니다.
  • API 응답 및 문서화 보강: CourseDetailResponse에 segments 배열을 추가하고, 클라이언트가 등급별로 시각화할 수 있도록 startIdx~endIdx 범위를 제공하며 Swagger 문서를 업데이트했습니다.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces slope grade segments to the course detail response, allowing clients to render course polylines with color-coded slope classifications. It adds SlopeGrade and SlopeSegmentResponse DTOs, and implements CourseSlopeSegmentCalculator to compute these segments using GPS smoothing and Haversine distance. Feedback highlights two key issues: a missing mock for the new calculator in CourseServiceTest which will cause test failures, and a potential NullPointerException in CourseSlopeSegmentCalculator if altitudesJson parses to null.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@pooreumjung pooreumjung added the enhancement New feature or request label Jun 2, 2026
@pooreumjung pooreumjung changed the title feat: 코스 polyline 경사 등급 segments 응답 추가 [Feat] 코스 polyline 경사 등급 segments 응답 추가 Jun 2, 2026
@JangInho
JangInho merged commit cf0ae1a into develop Jun 2, 2026
1 check passed
@howooyeon
howooyeon deleted the feat/#114-course-slope-segments branch June 5, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] 트래킹 경로 고도기반 히트맵

2 participants