Skip to content

[FEAT] 공덕 지역 웨이블 마커 데이터 추가#149

Merged
zyovn merged 2 commits into
developfrom
feature/jeongbin
Aug 15, 2025
Merged

[FEAT] 공덕 지역 웨이블 마커 데이터 추가#149
zyovn merged 2 commits into
developfrom
feature/jeongbin

Conversation

@zyovn

@zyovn zyovn commented Aug 15, 2025

Copy link
Copy Markdown
Member

✔️ 연관 이슈

📝 작업 내용

공덕 지역 노드 및 웨이블 마커 데이터 추가

스크린샷 (선택)

스크린샷 2025-08-15 204502

Summary by CodeRabbit

  • 신기능
    • 보행 경로 그래프 데이터셋을 최신 버전으로 교체하여 서초–공덕 구간을 포함한 네트워크 반영.
    • 휠체어 충전기·경사로·리프트 등 접근성 마커를 대폭 추가해 지도 표시가 풍부해짐.
  • 작업
    • 일부 기존 마커의 분류를 실제 시설 유형에 맞게 조정(예: 경사로 → 리프트/충전기/없음 등).
  • 테스트
    • 테스트 코드의 불필요한 공백을 정리하여 가독성 개선.

@zyovn zyovn self-assigned this Aug 15, 2025
@zyovn zyovn added the 💡 feature 기능 구현 및 개발 label Aug 15, 2025
@coderabbitai

coderabbitai Bot commented Aug 15, 2025

Copy link
Copy Markdown

Walkthrough

그래프 초기화에서 로드하는 JSON 리소스 경로를 "/seocho_pedestrian.json"에서 "/seocho_gongdeok_pedestrian.json"으로 변경했다. wayble_markers.json에 공덕 지역 중심의 대량 마커가 추가되고 일부 기존 마커 타입이 재분류되었다. 테스트 코드에는 공백 라인 제거만 반영되었다.

Changes

Cohort / File(s) Summary
Graph initialization config
src/main/java/com/wayble/server/direction/init/GraphInit.java
초기화 시 참조하는 그래프 JSON 리소스 경로를 "/seocho_gongdeok_pedestrian.json"으로 변경. 로직(파싱, 노드/엣지/마커 세팅, 인접 맵 구성, 예외 처리)은 동일.
Marker dataset updates
src/main/resources/wayble_markers.json
공덕 지역 마커 대량 추가. 일부 기존 항목 타입 재분류: 1740825183→WHEELCHAIR_LIFT, 1012654209→WHEELCHAIR_CHARGER, 6875654572→NONE, 2747865798→NONE. 코드 로직 변경 없음(데이터만 변경).
Test cleanup
src/test/java/com/wayble/server/direction/service/WalkingServiceTest.java
불필요한 빈 줄 제거(동작 변화 없음).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Assessment against linked issues

Objective Addressed Explanation
공덕 지역 웨이블 마커 더미 데이터 추가 (#148)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
그래프 리소스 경로를 "/seocho_gongdeok_pedestrian.json"으로 변경 (src/main/java/com/wayble/server/direction/init/GraphInit.java, resource 로딩 부분) 이슈 #148은 마커 데이터 추가에 한정되어 있으며, 그래프 데이터셋 교체는 명시된 목표에 포함되지 않음.

Possibly related PRs

Suggested reviewers

  • seung-in-Yoo
  • wonjun-lee-fcwj245

Poem

오늘도 깡총, 지도 위에 점을 콕콕!
공덕의 길, 램프와 리프트를 톡톡!
바퀴 달린 꿈이 쉬어갈 충전소도 쏙—
데이터 풀풀, 그래프는 척척.
웨이블 토끼, 길찾기 준비 완료! 🐇🗺️

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/jeongbin

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🔭 Outside diff range comments (1)
src/main/java/com/wayble/server/direction/init/GraphInit.java (1)

89-105: 원거리(Out-of-region) 마커가 임의 노드에 매핑되는 부작용 가능성

findWaybleMarkers()가 “가까운 노드”를 거리 임계값 없이 항상 선택합니다. 그래프 범위 밖(혹은 매우 먼 거리)의 마커도 가장 가까운 노드에 강제로 붙으면서, 해당 노드 인접 간선에 할인(MARKER_DISCOUNT)이 적용될 수 있습니다. 공덕 외 지역(서초 등) 대량 마커가 파일에 공존하므로 그래프에 포함되지 않은 범위의 마커가 광범위하게 잘못 반영될 위험이 있습니다.

  • 해결책 1: “최소 거리 ≤ 임계값”일 때만 매핑하도록 거리 임계값(예: 100~200m)을 두세요.
  • 해결책 2: 그래프 리소스가 다지역 통합이라면 괜찮지만, 그럼에도 여전히 임계값을 두는 것이 안전합니다.
  • 부가 개선: rampMarkers를 실제로 채워 RAMP_PENALTY가 반영되도록 하세요.

임계값 적용 및 rampMarkers 채움 예시는 아래와 같습니다.

@@
     private Map<Long, Type> findWaybleMarkers() {
         Map<Long, Type> waybleMarkers = new HashMap<>();
 
-        for (WaybleMarker marker : markers) {
-            long nearNode = nodes.stream()
-                    .min(Comparator.comparingDouble(
-                            n -> HaversineUtil.haversine(marker.lat(), marker.lon(), n.lat(), n.lon())
-                    ))
-                    .map(Node::id)
-                    .orElse(marker.id());
-
-            if (nearNode != marker.id()) {
-                waybleMarkers.put(nearNode, marker.type());
-            }
-        }
+        // 거리 임계값 기반 매핑
+        // NOTE: HaversineUtil.haversine 반환 단위(미터/킬로미터)를 확인 후 임계값을 조정하세요.
+        // 예시: meters 기준 150m
+        if (markers != null && !markers.isEmpty()) {
+            // rampMarkers가 가변 Set인 전제 (클래스 필드 변경 필요)
+            rampMarkers.clear();
+        }
+        for (WaybleMarker marker : markers) {
+            Node nearest = nodes.stream()
+                    .min(Comparator.comparingDouble(
+                            n -> HaversineUtil.haversine(marker.lat(), marker.lon(), n.lat(), n.lon())
+                    ))
+                    .orElse(null);
+            if (nearest == null) continue;
+
+            double distance = HaversineUtil.haversine(marker.lat(), marker.lon(), nearest.lat(), nearest.lon());
+            if (distance <= MARKER_ATTACH_THRESHOLD_METERS) {
+                waybleMarkers.put(nearest.id(), marker.type());
+                if (marker.type() == Type.RAMP) {
+                    rampMarkers.add(nearest.id());
+                }
+            }
+        }
         return waybleMarkers;
     }

아래 변경은 선택한 범위 밖이지만, 위 변경을 위해 반드시 함께 적용되어야 합니다(참고용 코드 스니펫):

// 클래스 필드 쪽 개선 (라인 32 부근)
private static final double MARKER_ATTACH_THRESHOLD_METERS = 150.0; // Haversine 단위에 맞춰 조정
private final Set<Long> rampMarkers = new HashSet<>(); // Collections.emptySet() -> 가변 Set

추가로, HaversineUtil.haversine의 리턴 단위(미터/킬로미터) 확인이 필요합니다. 단위가 km라면 임계값을 0.15 등으로 조정하세요.

🧹 Nitpick comments (2)
src/main/java/com/wayble/server/direction/init/GraphInit.java (1)

32-36: 하드코딩된 상수와 가변 컬렉션 초기화 제안

  • rampMarkersCollections.emptySet()으로 초기화되어 있어 실제로 값을 채울 수 없습니다. 가변 Set로 바꾸는 편이 안전합니다.
  • 거리 임계값 및 그래프 리소스 경로 상수를 도입하면 가독성과 관리성이 좋아집니다.
@@
-    private Set<Long> rampMarkers = Collections.emptySet();
+    private static final String GRAPH_JSON = "/seocho_gongdeok_pedestrian.json";
+    private static final double RAMP_PENALTY = 5.0;
+    private static final double MARKER_DISCOUNT = 0.5;
+    private static final double MARKER_ATTACH_THRESHOLD_METERS = 150.0; // 단위 확인 후 조정
+    private final Set<Long> rampMarkers = new HashSet<>();

그리고 사용부는 아래처럼 상수를 활용하세요.

- try (InputStream graphStream = getClass().getResourceAsStream("/seocho_gongdeok_pedestrian.json")) {
+ try (InputStream graphStream = getClass().getResourceAsStream(GRAPH_JSON)) {
src/main/resources/wayble_markers.json (1)

2-20: 리소스 분리/모듈화 제안(선택)

운영/배포 편의와 초기화 성능을 위해 지역별 마커 JSON을 분리하고, 환경설정(예: Spring profile)별로 필요한 리소스만 로딩하는 방식을 고려해 주세요. 현재 단일 파일이 매우 커서 불필요 데이터까지 메모리에 적재될 가능성이 있습니다.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 253f65a and cab23c1.

📒 Files selected for processing (3)
  • src/main/java/com/wayble/server/direction/init/GraphInit.java (1 hunks)
  • src/main/resources/wayble_markers.json (4 hunks)
  • src/test/java/com/wayble/server/direction/service/WalkingServiceTest.java (0 hunks)
💤 Files with no reviewable changes (1)
  • src/test/java/com/wayble/server/direction/service/WalkingServiceTest.java
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/main/resources/wayble_markers.json (1)
src/main/java/com/wayble/server/direction/entity/WaybleMarker.java (1)
  • WaybleMarker (5-11)
🔇 Additional comments (4)
src/main/java/com/wayble/server/direction/init/GraphInit.java (1)

43-52: 그래프 리소스 존재 확인 완료 — 추가 조치 불필요

리포지토리에서 다음 리소스 파일을 확인했습니다:

  • src/main/resources/seocho_gongdeok_pedestrian.json
  • src/main/resources/wayble_markers.json

따라서 현재 변경으로 인해 런타임에서 GRAPH_FILE_NOT_FOUND 예외가 발생할 가능성은 낮습니다. (빌드 시 해당 리소스들이 classpath에 포함되는지 유지해주세요.)

src/main/resources/wayble_markers.json (3)

2-67: 공덕 지역 신규 마커 추가 — 포맷/타입 일관성 확인

id/lat/lon/type 포맷과 타입 값(WHEELCHAIR_CHARGER/RAMP/WHEELCHAIR_LIFT/NONE)이 일관적입니다. 데이터 추가 방향성 문제없어 보입니다.


1995-1999: 기존 마커 타입 재분류 확인

다음 재분류가 의도대로 반영된 것 확인했습니다.

  • 1740825183: RAMP → WHEELCHAIR_LIFT
  • 1012654209: RAMP → WHEELCHAIR_CHARGER
  • 6875654572: RAMP → NONE
  • 2747865798: RAMP → NONE

Also applies to: 2001-2005, 2031-2035, 2151-2155


1-40: 검증 결과: 마커 ID 중복 없음 · 거리 문제 없음 — 추가 조치 불필요

요약:

  • 검사 대상: src/main/resources/wayble_markers.json (마커 1,312개) vs src/main/resources/seocho_gongdeok_pedestrian.json
  • 중복 ID: 0
  • 사용한 임계값: 150.0m
  • 150m 초과 비율: 0/1,312 (0.00%)
  • 최장 거리(상위 1): 62.7m (id: 9169674314)

결론:

  • 현재 데이터 기준으로 원 리뷰에서 지적한 중복 ID와 그래프 외부 마커에 대한 우려는 확인되지 않았습니다. 당장 필터링/분할 또는 GraphInit 변경은 필요하지 않습니다.
  • 권장: 데이터가 다른 지역(다지역 통합)으로 확장될 경우 동일 검증을 자동화하거나 지역별 분리·거리 임계값 적용을 재검토하세요.

검사한 파일:

  • src/main/resources/wayble_markers.json
  • src/main/resources/seocho_gongdeok_pedestrian.json

@hyoinYang hyoinYang 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.

수고하셨습니다 👍

@zyovn zyovn merged commit 1ccdb70 into develop Aug 15, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💡 feature 기능 구현 및 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants