Skip to content

Commit

Permalink
minor text changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ciscorn committed Sep 11, 2023
1 parent f5cf991 commit f65064e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
6 changes: 3 additions & 3 deletions japanese_grids/algorithms/create_grid_square.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Processing algorithm for generating Japan's Mesh"""
"""Processing algorithm to create the "Grid Square Code" of Japan (JIS X 0410) as vector layers"""

# Copyright (C) 2023 MIERUNE Inc.
#
Expand Down Expand Up @@ -48,10 +48,10 @@
作成したい種類のメッシュの出力先を「一時レイヤ」や「ファイル」に設定して、アルゴリズムを実行してください。
デフォルトでは日本全域のメッシュを作成しますが、「メッシュの作成範囲」オプションで作成する範囲を制限できます
デフォルトでは日本全域のメッシュを作成しますが、「メッシュの作成範囲」オプションでメッシュの作成範囲を制限できます
なお、1/2地域メッシュより小さいメッシュについては、大量の地物生成を防ぐため、生成範囲を制限しないとアルゴリズムを実行できません。
""" # noqa: RUF001
"""


def _tr(string: str):
Expand Down
20 changes: 11 additions & 9 deletions japanese_grids/algorithms/utils/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,17 @@ def iter_standard_mesh_patch(
yield (prefix + str(x), bbox)


def iter_subdivision_mesh_patch(standard_mesh_patch: tuple[str, LngLatBox]):
def iter_subdivided_mesh_patch(standard_mesh_patch: tuple[str, LngLatBox]):
parent_code, parent_bbox = standard_mesh_patch
lng0, lat0, lng1, lat1 = parent_bbox
lath = (lat0 + lat1) / 2
lngh = (lng0 + lng1) / 2
yield (parent_code + "1", (lng0, lat0, lngh, lath))
yield (parent_code + "2", (lngh, lat0, lng1, lath))
yield (parent_code + "3", (lng0, lath, lngh, lat1))
yield (parent_code + "4", (lngh, lath, lng1, lat1))
return [
(parent_code + "1", (lng0, lat0, lngh, lath)),
(parent_code + "2", (lngh, lat0, lng1, lath)),
(parent_code + "3", (lng0, lath, lngh, lat1)),
(parent_code + "4", (lngh, lath, lng1, lat1)),
]


def iter_patch( # noqa: C901
Expand Down Expand Up @@ -284,15 +286,15 @@ def iter_patch( # noqa: C901
if standard:
yield ("standard", *standard_mesh_patch)
if half or quarter or eighth:
for patch2 in iter_subdivision_mesh_patch(standard_mesh_patch):
for patch2 in iter_subdivided_mesh_patch(standard_mesh_patch):
if half:
yield ("half", *patch2)
if quarter or eighth:
for patch4 in iter_subdivision_mesh_patch(patch2):
for patch4 in iter_subdivided_mesh_patch(patch2):
if quarter:
yield ("quarter", *patch4)
if eighth:
for patch8 in iter_subdivision_mesh_patch(patch4):
for patch8 in iter_subdivided_mesh_patch(patch4):
yield ("eighth", *patch8)


Expand All @@ -305,7 +307,7 @@ def estimate_total_count(
quarter: bool = False,
eighth: bool = False,
):
"""生成されるパッチ数を推定する"""
"""生成されるパッチ数の概数を返す"""
num_primary = len(list(iter_primary_mesh_patch(extent=extent)))

c = 0
Expand Down

0 comments on commit f65064e

Please sign in to comment.