GeoLibre NetCDF Loader Plugin adds NetCDF4/HDF5 climate-grid support to GeoLibre Desktop. It reads local or HTTPS NetCDF4 files, lets you choose a variable and 2D slice, and renders the result as a color-mapped raster.
Developed by Husayn El Sharif.
- Load local
.nc,.cdf, and.netcdffiles. - Load HTTPS NetCDF files with the
?netcdfUrl=...URL parameter. - Detect classic NetCDF3/CDF files and explain that they are not supported in version 1.
- Read NetCDF4/HDF5 files with
h5wasm. - Detect common latitude and longitude coordinate variables.
- Render float and integer climate rasters, including packed unsigned integer grids with scale/offset metadata.
- Fetch HTTPS NetCDF files directly in the WebView to avoid large desktop IPC transfers.
- Select time slices with a date picker, previous/next controls, slider, and raw index field when CF time metadata is available.
- Select non-spatial dimension indexes such as
time,level, ordepth. - Choose between a GeoLibre-registered raster layer that appears in the left Layers panel and a direct MapLibre raster overlay.
- Register plugin-owned raster layers with GeoLibre through
registerExternalNativeLayer. - Identify raster pixel values from GeoLibre's Layers-panel Identify tool with direct click-to-value sampling.
- Switch GeoLibre to Mercator while NetCDF rasters are active so canvas rasters align with the basemap.
- Render with Panoply-inspired color ramps:
- Temperature
- Viridis
- Turbo
- Blue-red
- Grayscale
- Use direct MapLibre overlays as an explicit alternate rendering mode for visual debugging without layer-store registration.
The default GeoLibre layer (left panel) mode renders the selected NetCDF slice as a MapLibre canvas raster layer, then registers that plugin-owned native layer with GeoLibre through registerExternalNativeLayer. GeoLibre's Identify button activates a plugin click sampler that converts the clicked longitude/latitude into a raster row and column, then reads the value directly from the typed array. Because MapLibre canvas rasters are planar sources, the plugin switches GeoLibre to Mercator while active and restores the previous projection when the plugin deactivates.
The Direct raster overlay mode renders the same slice into an in-memory canvas and registers it directly with MapLibre as a canvas source and raster layer. This is still raster rendering, not a vector fallback, but it bypasses GeoLibre's layer store, so direct overlays are managed from the plugin panel rather than the left Layers panel.
Download or build the plugin zip, then install it in GeoLibre Desktop:
- Open Settings > Manage Plugins.
- Go to the plugin settings/install section.
- Choose Install from file.
- Select the generated zip:
geolibre-plugin/geolibre-netcdf-0.5.9.zip
You can also add the unpacked development directory:
geolibre-plugin
- Activate NetCDF Loader from GeoLibre's Plugins menu if it is not already active.
- Click the NC map control to open the plugin panel.
- Choose a local NetCDF file or enter an HTTPS NetCDF URL.
- Select a renderable variable, such as
tavg (time, lat, lon). - Set any non-spatial dimension indexes, such as
time index. - Choose a colormap, opacity, and layer mode.
- Click Add raster layer.
- Use the layer's Identify button in GeoLibre's left Layers panel to inspect pixel values.
Use GeoLibre layer (left panel) when you want the layer in GeoLibre's Layers panel. Use Direct raster overlay only for quick visual debugging without a left-panel entry.
npm install
npm run package:geolibreThe packaged GeoLibre plugin archive is written to:
geolibre-plugin/geolibre-netcdf-0.5.9.zip
Run tests:
npm testRun a production build without packaging:
npm run buildThe test suite includes a few pure grid helper checks. If a local sample file exists at example_netcdf_files/JVBC_HistAnalog_tavg.nc, the suite also runs a NetCDF4/HDF5 regression test against that file. The sample data directory is intentionally git-ignored to avoid committing large climate files.
- NetCDF4/HDF5 support depends on
h5wasm; unsupported HDF5 features or compression filters may still fail. - Classic NetCDF3/CDF files are detected but not rendered in version 1.
- Large multidimensional files are read in the browser/WebView, so very large arrays may be slow or memory-heavy.
- Curvilinear grids and projected coordinates are not fully supported yet; the current renderer expects latitude and longitude coordinates.
- Full GeoLibre Layers-panel integration requires a GeoLibre build that exposes
registerExternalNativeLayer. Direct overlays render independently but are not visible in the left Layers panel.
Suggested GitHub topics:
geolibre geolibre-plugin netcdf netcdf4 hdf5 climate-data gis maplibre raster colormap
MIT License. See LICENSE.