A library to convert between CF (Climate and Forecast) convention grid mappings and other coordinate reference system formats via Proj.jl.
- Convert CF grid mapping attributes to ProjJSON, WKT, ProjString, and other CRS formats
- Convert from other CRS formats back to CF grid mappings
- Supports 15+ projection types including Transverse Mercator, Lambert Conformal Conic, Polar Stereographic, and more
Convert CF grid mapping attributes from a NetCDF file to ProjJSON:
using CFCoordinateReferenceSystems, NCDatasets, GeoFormatTypes
# Read grid mapping attributes from NetCDF
attrs = NCDatasets.attribs(dataset["crs"])
cf = CFProjection(attrs)
# Convert to ProjJSON
projjson = convert(ProjJSON, cf)
# Or convert to other formats via Proj.jl
wkt = convert(WellKnownText, cf)
projstring = convert(ProjString, cf)Convert from other CRS formats to CF:
using Proj
# From an existing CRS
crs = Proj.CRS("EPSG:32615")
cf = convert(CFProjection, WellKnownText(crs))