Skip to content

Commit

Permalink
rabbit test improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
bordoray committed Jun 18, 2024
1 parent bf23d2d commit d3a0d7d
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions elevation_tile_tools/elevation_tile_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,16 @@ def create_geotiff(self):
# どっちもプラス、マイナスなら、絶対値の大きい方から小さい方を引く
pixel_size_x = None
pixel_size_y = None
if upper_right_XY[0] >= 0 and lower_left_XY[0] >= 0:
pixel_size_x = (abs(upper_right_XY[0]) - abs(lower_left_XY[0])) / x_length
pixel_size_y = -(abs(upper_right_XY[1]) - abs(lower_left_XY[1])) / y_length
elif upper_right_XY[0] <= 0 and lower_left_XY[0] <= 0:

if (upper_right_XY[0] >= 0 and lower_left_XY[0] >= 0) or (
upper_right_XY[0] <= 0 and lower_left_XY[0] <= 0
):
pixel_size_x = (abs(upper_right_XY[0]) - abs(lower_left_XY[0])) / x_length
pixel_size_y = -(abs(upper_right_XY[1]) - abs(lower_left_XY[1])) / y_length
# 片方がプラスなら絶対値を足す
elif upper_right_XY[0] <= 0 <= lower_left_XY[0]:
pixel_size_x = (abs(upper_right_XY[0]) + abs(lower_left_XY[0])) / x_length
pixel_size_y = -(abs(upper_right_XY[1]) + abs(lower_left_XY[1])) / y_length
elif upper_right_XY[0] >= 0 >= lower_left_XY[0]:
elif (upper_right_XY[0] <= 0 <= lower_left_XY[0]) or (
upper_right_XY[0] >= 0 >= lower_left_XY[0]
):
pixel_size_x = (abs(upper_right_XY[0]) + abs(lower_left_XY[0])) / x_length
pixel_size_y = -(abs(upper_right_XY[1]) + abs(lower_left_XY[1])) / y_length

Expand Down

0 comments on commit d3a0d7d

Please sign in to comment.