@@ -123,6 +123,8 @@ def point_to_tile_bbox(lon: float, lat: float) -> tuple:
123123 """Convert a point to the bounding box of its containing tile.
124124
125125 Tiles are 0.1x0.1 degree squares centered at 0.05-degree offsets.
126+ Returns a point bbox at the tile center, which the registry query
127+ will expand by 0.05 degrees to match exactly one tile.
126128
127129 Args:
128130 lon: Longitude in decimal degrees
@@ -132,8 +134,9 @@ def point_to_tile_bbox(lon: float, lat: float) -> tuple:
132134 Tuple of (min_lon, min_lat, max_lon, max_lat) for the containing tile
133135 """
134136 tile_lon , tile_lat = tile_from_world (lon , lat )
135- # Tile center ± 0.05 degrees
136- return (tile_lon - 0.05 , tile_lat - 0.05 , tile_lon + 0.05 , tile_lat + 0.05 )
137+ # Return point bbox at tile center - registry expands by 0.05 degrees
138+ # which will match exactly this one tile
139+ return (tile_lon , tile_lat , tile_lon , tile_lat )
137140
138141
139142app = typer .Typer (
@@ -659,7 +662,7 @@ def coverage(
659662 tile_center = tile_from_world (lon , lat )
660663 region_bbox = point_to_tile_bbox (lon , lat )
661664 rprint (
662- f"[green]Point ({ lon } , { lat } ) → tile "
665+ f"[green]Point ({ lon } , { lat } ) -> tile "
663666 f"grid_{ tile_center [0 ]:.2f} _{ tile_center [1 ]:.2f} [/green]"
664667 )
665668 rprint (f"[green]Region bounding box:[/green] { format_bbox (region_bbox )} " )
@@ -675,7 +678,7 @@ def coverage(
675678 tile_center = tile_from_world (lon , lat )
676679 region_bbox = point_to_tile_bbox (lon , lat )
677680 rprint (
678- f"[green]Point ({ lon } , { lat } ) → tile "
681+ f"[green]Point ({ lon } , { lat } ) -> tile "
679682 f"grid_{ tile_center [0 ]:.2f} _{ tile_center [1 ]:.2f} [/green]"
680683 )
681684 elif len (bbox_coords ) == 4 :
@@ -1109,7 +1112,7 @@ def download(
11091112 tile_center = tile_from_world (lon , lat )
11101113 bbox_coords = point_to_tile_bbox (lon , lat )
11111114 rprint (
1112- f"[green]Point ({ lon } , { lat } ) → tile "
1115+ f"[green]Point ({ lon } , { lat } ) -> tile "
11131116 f"grid_{ tile_center [0 ]:.2f} _{ tile_center [1 ]:.2f} [/green]"
11141117 )
11151118 rprint (f"[green]Using bounding box:[/green] { format_bbox (bbox_coords )} " )
@@ -1125,7 +1128,7 @@ def download(
11251128 tile_center = tile_from_world (lon , lat )
11261129 bbox_coords = point_to_tile_bbox (lon , lat )
11271130 rprint (
1128- f"[green]Point ({ lon } , { lat } ) → tile "
1131+ f"[green]Point ({ lon } , { lat } ) -> tile "
11291132 f"grid_{ tile_center [0 ]:.2f} _{ tile_center [1 ]:.2f} [/green]"
11301133 )
11311134 rprint (f"[green]Using bounding box:[/green] { format_bbox (bbox_coords )} " )
0 commit comments