- # Let's check if this tile needs water beneath
- """
- if self.does_ortho_have_water(str(lat) + "_" + str(lng)):
-
- # Begin a new patch
- with open(meshtxt, 'a') as textfile:
- textfile.write("BEGIN_PATCH " + str(curpatch) + " 0.000000 -1.000000 2 5\r\n")
-
- # Generate the ortho tile
- for y in range(0,odiv):
- for x in range(0,odiv):
- # Coordinates
- lat_b = round(base_lat + (y*latstep), 6)
- lat_t = round(base_lat + ((y+1)*latstep), 6)
- lng_l = round(base_lng + (x*lngstep), 6)
- lng_r = round(base_lng + ((x+1)*lngstep), 6)
-
- # Minimal adjustment
- if x == 0:
- lng_l = base_lng
- if y == 0:
- lat_b = base_lat
- if y == 3:
- lat_t = base_lat + self._vstep
- if x == 3:
- lng_r = base_lng + mstr_zl_18
-
- # Corrections, just in case
- if lat_b > self._lat + 1: lat_b = self._lat+1
- if lat_t > self._lat + 1: lat_t = self._lat+1
- if lng_l > self._lng + 1: lng_l = self._lng+1
- if lng_r > self._lng + 1: lng_r = self._lng+1
-
- hgt_bl_idx = self.find_height_for_coord([lat_b, lng_l])
- hgt_br_idx = self.find_height_for_coord([lat_b, lng_r])
- hgt_tr_idx = self.find_height_for_coord([lat_t, lng_r])
- hgt_tl_idx = self.find_height_for_coord([lat_t, lng_l])
- hgt_bl = round(self._demcoord[ hgt_bl_idx[0] ][ hgt_bl_idx[1] ][2] - .01, 6)
- hgt_br = round(self._demcoord[ hgt_br_idx[0] ][ hgt_br_idx[1] ][2] - .01, 6)
- hgt_tr = round(self._demcoord[ hgt_tr_idx[0] ][ hgt_tr_idx[1] ][2] - .01, 6)
- hgt_tl = round(self._demcoord[ hgt_tl_idx[0] ][ hgt_tl_idx[1] ][2] - .01, 6)
-
- # Coords of triangle vertices
- # 0 - Longitude
- # 1 - Latitude
- # 2 - Height in m
- t1_v1 = [ lng_r, lat_b, hgt_br ]
- t1_v2 = [ lng_l, lat_t, hgt_tl ]
- t1_v3 = [ lng_r, lat_t, hgt_tr ]
- t2_v1 = [ lng_l, lat_t, hgt_tl ]
- t2_v2 = [ lng_r, lat_b, hgt_br ]
- t2_v3 = [ lng_l, lat_b, hgt_bl ]
-
- # Write down the two triangles
- t_str = ""
- t_str = t_str + "BEGIN_PRIMITIVE 0\r\n"
- t_str = t_str + "PATCH_VERTEX " + str(t1_v1[0]) + " " + str(t1_v1[1]) + " " + str(t1_v1[2]) + " 0.000015 0.000015\r\n"
- t_str = t_str + "PATCH_VERTEX " + str(t1_v2[0]) + " " + str(t1_v2[1]) + " " + str(t1_v2[2]) + " 0.000015 0.000015\r\n"
- t_str = t_str + "PATCH_VERTEX " + str(t1_v3[0]) + " " + str(t1_v3[1]) + " " + str(t1_v3[2]) + " 0.000015 0.000015\r\n"
- t_str = t_str + "END_PRIMITIVE 0\r\n"
- t_str = t_str + "BEGIN_PRIMITIVE 0\r\n"
- t_str = t_str + "PATCH_VERTEX " + str(t2_v1[0]) + " " + str(t2_v1[1]) + " " + str(t2_v1[2]) + " 0.000015 0.000015\r\n"
- t_str = t_str + "PATCH_VERTEX " + str(t2_v2[0]) + " " + str(t2_v2[1]) + " " + str(t2_v2[2]) + " 0.000015 0.000015\r\n"
- t_str = t_str + "PATCH_VERTEX " + str(t2_v3[0]) + " " + str(t2_v3[1]) + " " + str(t2_v3[2]) + " 0.000015 0.000015\r\n"
- t_str = t_str + "END_PRIMITIVE 0\r\n"
-
- # Send to the file
- with open(meshtxt, 'a') as textfile:
- textfile.write(t_str)
-
- # End this patch
- with open(meshtxt, 'a') as textfile:
- textfile.write("END PATCH\r\n")
-
- # Increase patch number
- curpatch = curpatch + 1
- """
-
-