Skip to content

Commit cb534a2

Browse files
authored
feat: add antimeridian (#24)
* feat: add antimeridian * fix: add antimeridian info * docs: add note about info
1 parent 8767a0c commit cb534a2

File tree

4 files changed

+69
-1
lines changed

4 files changed

+69
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ To add a new test case:
2727
1. Create a new Python file in `geotiff_test_data/fixtures/`
2828
2. Implement a `generate(output_path: Path)` function that creates the GeoTIFF
2929

30-
Run `pixi run generate`.
30+
Run `pixi run generate` and `pixi run info`.
3131

3232
## Image Sources
3333

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""Generate a GeoTIFF that crosses the antimeridian near the Aleutian Islands."""
2+
3+
from pathlib import Path
4+
5+
import numpy as np
6+
from rasterio.transform import from_origin
7+
8+
from rasterio_generated.write_utils import write_cog
9+
10+
11+
def generate(output_path: Path) -> None:
12+
data = np.arange(42, dtype=np.uint8).reshape(1, 42)
13+
data = np.repeat(data, 42, axis=0)
14+
transform = from_origin(-204, 24, 1, 1)
15+
16+
write_cog(
17+
output_path,
18+
data,
19+
blocksize=64,
20+
compress="DEFLATE",
21+
crs="EPSG:4326",
22+
transform=transform,
23+
)
670 Bytes
Binary file not shown.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
```
2+
Driver: GTiff
3+
File: rasterio_generated/fixtures/antimeridian.tif
4+
COG: True
5+
Compression: DEFLATE
6+
ColorSpace: None
7+
8+
Profile
9+
Width: 42
10+
Height: 42
11+
Bands: 1
12+
Tiled: True
13+
Dtype: uint8
14+
NoData: 0.0
15+
Alpha Band: False
16+
Internal Mask: False
17+
Interleave: BAND
18+
ColorMap: False
19+
ColorInterp: ('gray',)
20+
Scales: (1.0,)
21+
Offsets: (0.0,)
22+
23+
Geo
24+
Crs: EPSG:4326
25+
Origin: (-204.0, 24.0)
26+
Resolution: (1.0, -1.0)
27+
BoundingBox: (-204.0, -18.0, -162.0, 24.0)
28+
MinZoom: 0
29+
MaxZoom: 0
30+
31+
Image Metadata
32+
AREA_OR_POINT: Area
33+
34+
Image Structure
35+
LAYOUT: COG
36+
COMPRESSION: DEFLATE
37+
INTERLEAVE: BAND
38+
39+
Band 1
40+
ColorInterp: gray
41+
42+
IFD
43+
Id Size BlockSize Decimation
44+
0 42x42 64x64 0
45+
```

0 commit comments

Comments
 (0)