Upgrade to Pro — share decks privately, control downloads, hide ads and more …

look_for_shade

yrarchi
June 18, 2019

 look_for_shade

yrarchi

June 18, 2019
Tweet

Other Decks in Technology

Transcript

  1. 道路にかかる影の割合を決める要素は何か? - 建物形状・高さ:6.0m * 6.0m * 6.0m
 
 - 道路幅員:4.0m


    
 - 道路からの離れ・隣棟間隔:1.0m
 
 - 道路の方位角:22.5°ずつ変えて計算

  2. 道路にかかる影の割合を決める要素は何か? - 建物形状・高さ:6.0m * 6.0m * 6.0m
 
 - 道路幅員:4.0m


    
 - 道路からの離れ・隣棟間隔:1.0m
 
 - 道路の方位角:22.5°ずつ変えて計算

  3. 計算過程_1 ①モデル建物画像  読込み ②モデル画像回転 ③建物の輪郭を検出     ↓  コーナーの座標を  求める import cv2

    model = cv2.imread("img/model.png") … for angle in [angle/10 for angle in range(0, 1800, 225)]: img = rotate_img(angle, model) … contours = find_contours() approx_contours = approximate_contours() … 画像処理を行うライブラリ OpenCVを利用
  4. ⑥道路のうち、影と 重なる割合を求める ⑤影の座標を求める 計算過程_2 ④諸条件より太陽の 方位角・高度を出す def calc_coordinate_of_shade(): h =

    calc_solar_altitude() A = calc_azimuth() shade_longth = bldg_h_pixel / math.tan(h) shade_x = shade_longth * math.sin(A) * -1 shade_y = shade_longth * math.cos(A) * -1 return shade_x, shade_y … for time in [i / 100 for i in range(500, 2000, 25)]: … shade_x, shade_y = calc_coordinate_of_shade() shade_msk, hull_points = make_shade_mask() road_shade_per = calc_per_of_shade_on_road() …
  5. 実際の道路で求めてみる_1 天神駅 福岡県庁 道路の方位角を取得して、経路上の影の割合を出してみる import osmnx as ox import networkx

    as nx G = ox.graph_from_point((latitude, longitude), distance=1800, network_type="walk") … origin_node = ox.get_nearest_node(G, origin_point) destination_node = ox.get_nearest_node(G, destination_point) route = nx.shortest_path(G, origin_node, destination_node, weight="length") … G = ox.add_edge_bearings(G) bearings = pd.Series(ox.get_route_edge_attributes(G, route, "bearing")) … OpenStreetMapのデータを利用して街路網の計算を行えるOSMnxを 利用