Skip to content

Commit ae9bf4a

Browse files
authored
grass.jupyter: fix setting region interactively in latlon projects (#6301)
This commit fixes interactive region setting in jupyter by avoiding using -a flag which doesn't work well with units degrees. Also updates g.region to use json instead of -g flag.
1 parent 1887afa commit ae9bf4a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

python/grass/jupyter/interactivemap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ def _update_output(self, region):
554554
self.bottom_output_widget.clear_output()
555555
print(
556556
_(
557-
"Region changed to: n={n}, s={s}, e={e}, w={w} "
557+
"Region changed to: n={north}, s={south}, e={east}, w={west} "
558558
"nsres={nsres} ewres={ewres}"
559559
).format(**region)
560560
)

python/grass/jupyter/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,13 +475,14 @@ def update_region(region):
475475
current = gs.region()
476476
return gs.parse_command(
477477
"g.region",
478-
flags="ga",
478+
flags="p" if gs.locn_is_latlong() else "pa",
479479
n=region["north"],
480480
s=region["south"],
481481
e=region["east"],
482482
w=region["west"],
483483
nsres=current["nsres"],
484484
ewres=current["ewres"],
485+
format="json",
485486
)
486487

487488

0 commit comments

Comments
 (0)