Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 1.83 KB

File metadata and controls

42 lines (31 loc) · 1.83 KB

CFCoordinateReferenceSystems

Build Status Coverage Stable Dev Aqua

A library to convert between CF (Climate and Forecast) convention grid mappings and other coordinate reference system formats via Proj.jl.

Features

  • 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

Quick start

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))