불법주정차 CCTV 위치

24331·2021년 5월 19일
0

DS

목록 보기
2/3

Outline

서울시 불법주정차 CCTV 위치를 지도에 표시.

Reference

Code

folium 모듈 사용하여 지도를 출력

# center of seoul
center = [37.541, 126.986]
# make a map
map = folium.Map(location=center, zoom_start=12)

행정구역별 Geodata를 사용하여 각 구를 표시

# get geodata of district in Seoul
smfile = open('data/seoul-map.json', 'r', encoding='utf-8').read()
districtLocData = json.loads(smfile)
folium.GeoJson(districtLocData, name='json_data').add_to(map)

CCTV 위치정보를 로드하고 지도에 표기

# get location data
df_camera = pd.read_csv('data/fixed_cctv_for_parking_enforcement.csv', encoding='utf-8')

# there are too many cameras so I use data of "Yeongdeungpo-gu" only.
df_cam_yeongdeungpo = df_camera[df_camera['district'] == 'Yeongdeungpo-gu']

# mark location on map
for i in range(0, len(df_cam_yeongdeungpo)):
  folium.Marker(
    location = [df_cam_yeongdeungpo.iloc[i]['latitude'], df_cam_yeongdeungpo.iloc[i]['longitude']],
    icon=folium.Icon(color="red")
  ).add_to(map)

지도는 html로 저장할 수 있음

# save map to file
map.save('out/y.html')

모든 카메라 위치를 표기하면...

profile
Today I Failed.

2개의 댓글

comment-user-thumbnail
2021년 8월 1일

How can I secure my home?

답글 달기
comment-user-thumbnail
2021년 8월 1일

I can give you a couple of tips. First of all, your house should look like there is nothing to steal from it. It may sound strange, but it helps. Remember that you can not leave the key under the rug or somewhere outside the house. I also advise you to purchase a pair of motion, smoke and water leakage sensors from Ajax. I also recommend you a great way to create an atmosphere that someone is at home when you leave but leave the lights and the radio or TV on. Great ways! Try them out. I hope that I was able to help you.

답글 달기