asw_component/__init__.py +3−0 View file@@ -0,0 +1,3 @@
1 +
from .component import execute 2 +
3 +
__all__ = ["execute"][참조 MVP] GIS 기반 전역 측위 A-SW — WGS84 좌표를 기준점 중심의 농경지 로컬 좌표계로 변환합니다.
https://git.agrithing.ai/jbnu/global-localization.git 6f0a9d5 173c090 48fb69a ebf3a8d 9f68bc8 ac3fd1d 9f68bc8617cec232975c402251aec52afab17a0f asw_component/__init__.py +3−0 View filefrom .component import execute__all__ = ["execute"]asw_component/component.py +10−0 View filefrom __future__ import annotationsimport mathdef execute(payload: dict) -> dict: origin, fix = payload["origin"], payload["fix"] radius = 6378137.0 lat0 = math.radians(float(origin["lat"])) north = math.radians(float(fix["lat"]) - float(origin["lat"])) * radius east = math.radians(float(fix["lon"]) - float(origin["lon"])) * radius * math.cos(lat0) return {"frame": "field_local", "x_east_m": round(east, 3), "y_north_m": round(north, 3), "heading_deg": float(fix.get("heading_deg", 0)), "quality": "RTK_FIXED"}examples/input.json +11−0 View file{ "origin": { "lat": 35.846, "lon": 127.129 }, "fix": { "lat": 35.8461, "lon": 127.1292, "heading_deg": 90 }}pyproject.toml +8−0 View file[project]name = "global_localization"version = "0.1.0"description = "WGS84 좌표를 기준점 중심의 농경지 로컬 좌표계로 변환합니다."requires-python = ">=3.11"[tool.unittest]test-path = "tests"run.py +10−0 View filefrom __future__ import annotationsimport jsonimport sysfrom asw_component import executeif __name__ == "__main__": path = sys.argv[1] if len(sys.argv) > 1 else None with open(path, encoding="utf-8") if path else sys.stdin as source: payload = json.load(source) print(json.dumps(execute(payload), ensure_ascii=False, indent=2))