Skip to main content

An improved version of searoute package for calculating the shortest sea route between two points on Earth.

Project description

Sea Voyage

seavoyage는 해상 네트워크 기반의 선박 경로 탐색, 커스텀 제한구역(해역) 적용, 네트워크 시각화 등 다양한 해양 경로 분석 기능을 제공하는 Python 패키지입니다. 이 패키지는 searoute 패키지를 기반으로 개선되었습니다.

원본 프로젝트

  • 원본 패키지: searoute
  • 원작자: Gent Halili
  • 라이선스: Apache License 2.0

주요 기능

  • 해상 네트워크 기반 최적 경로 탐색
  • 커스텀 제한구역(GeoJSON) 등록 및 적용
  • 다양한 해상 네트워크 해상도(5km~100km) 지원
  • folium 기반 경로/네트워크 지도 시각화
  • 네트워크 및 경로의 GeoJSON 변환

설치

pip install seavoyage

개발 모드 설치

개발 중에 테스트를 쉽게 실행하려면 다음 명령으로 패키지를 개발 모드로 설치하세요:

pip install -e .

이렇게 하면 pytest.ps1 스크립트를 사용하지 않고도 바로 pytest 명령을 실행할 수 있습니다.

빠른 시작

1. 기본 경로 생성

import seavoyage as sv

# 출발지와 도착지 좌표 (경도, 위도)
start = (129.17, 35.075)
end = (-4.158, 44.644)

# 기본 해상 네트워크에서 최적 경로 탐색
route = sv.seavoyage(start, end)
print("경로 길이:", route["properties"]["length"], "km")
print("예상 소요 시간:", route["properties"]["duration_hours"], "시간")

2. 커스텀 제한구역(해역) 적용

# 제한구역 GeoJSON 파일 등록 (예: 'jwc.geojson')
sv.register_custom_restriction('jwc', '/path/to/jwc.geojson')

# 제한구역을 적용하여 경로 탐색
route = sv.seavoyage(start, end, restrictions=['jwc'])
print("제한구역 적용 후 경로 길이:", route["properties"]["length"], "km")

3. 다양한 해상 네트워크 해상도 사용

3.1 미리 설정된 해상 네트워크 사용

# 5km, 10km, 20km, 50km, 100km 네트워크 지원
mnet_5km = sv.get_m_network_5km()
route = sv.seavoyage(start, end, M=mnet_5km)

3.2 사용자 정의 해상 네트워크 사용

# 사용자 정의 해상 네트워크 생성
mnet = sv.MNetwork().from_geojson('/path/to/mnet.geojson')
route = sv.seavoyage(start, end, M=mnet)

4. folium 기반 지도 시각화

from seavoyage.utils import map_folium

# folium 지도 객체로 변환
m = map_folium(route)
m.save("route_map.html")

주요 API

  • seavoyage(start, end, restrictions=None, M=None, ...) : 최적 경로 탐색 (제한구역, 네트워크 해상도 등 옵션 지원)
  • MNetwork : 해상 네트워크 객체 (노드/엣지 추가, GeoJSON 변환 등 지원)
  • register_custom_restriction(name, geojson_file_path) : 커스텀 제한구역 등록
  • list_custom_restrictions() : 등록된 제한구역 이름 목록 반환
  • get_custom_restriction(name) : 제한구역 객체 반환
  • map_folium(data, ...) : folium 기반 지도 시각화

라이선스

이 프로젝트는 Apache License 2.0 라이선스 하에 배포됩니다.

Copyright 2024 - Gent Halili (원작자)
Copyright 2025 - Byeonggong Hwang

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

기여

버그 리포트, 기능 제안, 풀 리퀘스트는 언제나 환영합니다.

연락처

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

seavoyage-0.1.8.tar.gz (9.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

seavoyage-0.1.8-py3-none-any.whl (10.0 MB view details)

Uploaded Python 3

File details

Details for the file seavoyage-0.1.8.tar.gz.

File metadata

  • Download URL: seavoyage-0.1.8.tar.gz
  • Upload date:
  • Size: 9.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for seavoyage-0.1.8.tar.gz
Algorithm Hash digest
SHA256 23a4f4d25ba636911108762d2687f671edf3a0f24302d8d4a99587414aa26f37
MD5 0e1e2f37c7a8d6ed79add70bc7fe2616
BLAKE2b-256 a499afa9a1f660638084e1ce70a6caa51d3cea2956ff89d10f1c3420f4d2d6b7

See more details on using hashes here.

File details

Details for the file seavoyage-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: seavoyage-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 10.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for seavoyage-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 e9d39e61230b9467b8d4b1f0db6f59df5182340c77f94e62de199e8cb51fa975
MD5 1555ba880d92ff5e165cdc88cfc0b232
BLAKE2b-256 b4acd0edfda3ed869549a42ce507f55e2dc100ad94755faf2fbccfce826cfa2a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page