jageocoder 2.2.1__tar.gz → 2.2.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/PKG-INFO +1 -1
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/rtree.py +30 -2
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/pyproject.toml +1 -1
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/LICENSE +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/README.md +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/__init__.py +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/__main__.py +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/address.py +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/aza_master.py +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/dataset.py +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/dbm/__init__.py +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/dbm/abstract_table.py +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/dbm/base_index.py +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/dbm/base_table.py +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/dbm/exceptions.py +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/dbm/types.py +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/exceptions.py +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/itaiji.py +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/itaiji_dic.json +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/local.py +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/module.py +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/node.py +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/remote.py +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/result.py +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/strlib.py +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/tree.py +0 -0
- {jageocoder-2.2.1 → jageocoder-2.2.1.1}/jageocoder/trie.py +0 -0
|
@@ -358,6 +358,8 @@ class Index(object):
|
|
|
358
358
|
"""
|
|
359
359
|
file_idx = index.Rtree(str(treepath)) # Filename must be passed as str
|
|
360
360
|
node_table: AddressNodeTable = self._tree.address_nodes
|
|
361
|
+
node_stack = []
|
|
362
|
+
next_check_id = -1
|
|
361
363
|
|
|
362
364
|
def _insert_node_to_rtree(
|
|
363
365
|
id: int,
|
|
@@ -367,6 +369,22 @@ class Index(object):
|
|
|
367
369
|
id=id,
|
|
368
370
|
coordinates=coordinates,
|
|
369
371
|
)
|
|
372
|
+
# Remove ancestor nodes of the registred node from the stack
|
|
373
|
+
nonlocal node_stack, next_check_id
|
|
374
|
+
while len(node_stack) > 0:
|
|
375
|
+
n = node_table.get_node_by_id(id)
|
|
376
|
+
if node_stack[0][0] == id:
|
|
377
|
+
node_stack = node_stack[1:]
|
|
378
|
+
elif node_stack[0][0] == n.parent_id:
|
|
379
|
+
node_stack = node_stack[1:]
|
|
380
|
+
id = n.parent_id
|
|
381
|
+
else:
|
|
382
|
+
break
|
|
383
|
+
|
|
384
|
+
if len(node_stack) == 0:
|
|
385
|
+
next_check_id = -1
|
|
386
|
+
else:
|
|
387
|
+
next_check_id = node_stack[0][1]
|
|
370
388
|
|
|
371
389
|
def _get_limit_bdr(cx: float, cy: float, radius: float) -> Tuple[float, float, float, float]:
|
|
372
390
|
# cx, cy を中心とし、半径 radius (m)の円を内包する BDR の (x0, y0, x1, y1) を返す
|
|
@@ -428,13 +446,19 @@ class Index(object):
|
|
|
428
446
|
|
|
429
447
|
continue
|
|
430
448
|
|
|
449
|
+
elif id == next_check_id:
|
|
450
|
+
n = node_stack[0]
|
|
451
|
+
_insert_node_to_rtree(
|
|
452
|
+
id=n[0],
|
|
453
|
+
coordinates=(n[2], n[3], n[2], n[3])
|
|
454
|
+
)
|
|
455
|
+
|
|
431
456
|
if node.level <= AddressLevel.WARD:
|
|
432
457
|
registered_coordinates.clear()
|
|
433
458
|
continue
|
|
434
459
|
|
|
435
460
|
if node.sibling_id == node.id + 1:
|
|
436
461
|
# The node has no child nodes
|
|
437
|
-
|
|
438
462
|
if not node.has_valid_coordinate_values():
|
|
439
463
|
continue
|
|
440
464
|
|
|
@@ -450,7 +474,11 @@ class Index(object):
|
|
|
450
474
|
continue
|
|
451
475
|
|
|
452
476
|
# The node has 1 or more child nodes
|
|
453
|
-
if node.level
|
|
477
|
+
if node.level < AddressLevel.BLOCK and node.has_valid_coordinate_values():
|
|
478
|
+
node_stack.insert(0, (id, node.sibling_id, node.x, node.y))
|
|
479
|
+
next_check_id = node.sibling_id
|
|
480
|
+
|
|
481
|
+
elif node.level == AddressLevel.BLOCK:
|
|
454
482
|
# Get BDR of child nodes
|
|
455
483
|
mode = "block"
|
|
456
484
|
sibling_id = node.sibling_id
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|