-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalyze_coordinates.py
More file actions
59 lines (46 loc) · 1.81 KB
/
analyze_coordinates.py
File metadata and controls
59 lines (46 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Coordinate Analysis Script
좌표 분석 스크립트
"""
import pandas as pd
def main():
"""메인 함수"""
print("🔍 Analyzing Coordinates")
# 지도 데이터 로드
df = pd.read_csv('basic_map.csv')
print(f"\n📐 Coordinate Ranges:")
print(f" X range: {df['x'].min():.0f} to {df['x'].max():.0f}")
print(f" Y range: {df['y'].min():.0f} to {df['y'].max():.0f}")
x_span = df['x'].max() - df['x'].min()
y_span = df['y'].max() - df['y'].min()
print(f"\n📏 Spans:")
print(f" X span: {x_span:.0f}m")
print(f" Y span: {y_span:.0f}m")
# 500m 셀 크기로 그리드 계산
cell_size = 500
grid_width = int(x_span / cell_size) + 1
grid_height = int(y_span / cell_size) + 1
print(f"\n🔲 Grid Calculation (500m cells):")
print(f" Grid width: {grid_width} cells")
print(f" Grid height: {grid_height} cells")
print(f" Total grid cells: {grid_width * grid_height:,}")
print(f" Actual data cells: {len(df):,}")
print(f" Empty cells: {grid_width * grid_height - len(df):,}")
# 좌표 간격 확인
x_coords = sorted(df['x'].unique())
y_coords = sorted(df['y'].unique())
print(f"\n📊 Coordinate Analysis:")
print(f" Unique X coordinates: {len(x_coords)}")
print(f" Unique Y coordinates: {len(y_coords)}")
# X 간격 확인
if len(x_coords) > 1:
x_intervals = [x_coords[i+1] - x_coords[i] for i in range(len(x_coords)-1)]
print(f" X intervals: {set(x_intervals)}")
# Y 간격 확인
if len(y_coords) > 1:
y_intervals = [y_coords[i+1] - y_coords[i] for i in range(len(y_coords)-1)]
print(f" Y intervals: {set(y_intervals)}")
if __name__ == "__main__":
main()