Coordinate Reference Systems - jejjohnson/ml4eo GitHub Wiki
Conceptual
We need an invertible transformation between the projection and the lat-lon coordinates.
- Lat-Lon -> Forward Transformation -> Projection
- Projection -> Inverse Transformation -> Lat-Lon
Fortunately for us, these invertible transformations are typically very simple, i.e., Affine Transformations.
To go from one projection A to another projection B need 2 transformations:
- Invertible Transform I
- Invertible Transform II
This is basically akin to having a common space which are the lat-lon coords to act as a bridge/liason between different projections.
Direction A to B:
- A -> T1 Inverse -> Lat-Lon
- Lat-Lon -> T2 Forward -> B
Examples
- Transform CRS1 to CRS2 using
pyproj
- Blog - Transform Coordinates from CRS1 to CRS2 using
cartopy
- Cartopy Docs - Regular 2D Lat-Lon Coordinates to Affine Transform - Georeader
- Calculate 2D Lat-Lon to bbox + transform - Georeader
- Reproject Data - GeoReader
- Georeference Image - georeader
- pyresample quickie tutorial - Pyresample
- SatPy, Resample and Zarr bulk save tutorial - Example
- BBox Utils (coords, shapely, arrays, initialization, resolution) - Examples
Utilities
- Create a Reference Grid - xarray.Coordinates
Tasks
This is inspired from this issue.
- Swath Image to Curvilinear Grid
- Curvilinear Grid to Rectilinear Grid
- Rectilinear Grid to Curvilinear Grid
- Grid to SWATH Image
Examples
- MODIS
- GOES 16
- Sentinel
- LANDSAT
Demo API
# create bounding box from coordinates
bbox = BoundingBox.from_xy(x, y, crs=None)
# create geobox from bounding box
geobox = GeoBox.from_bbox(bbox, crs=None, tight=False, shape=None, resolution=None, anchor='default', tol=0.01)
# calculate utm coordinates
CRS.utm(x, y=None, /, datum_name='WGS 84')