[GIS] Georeferencing uneven/irregularly gridded rasters using GDAL

coordinate systemgdalgeoreferencingraster

I'm trying to take a set of NetCDFs and turn them into georeferenced datasets using GDAL.

However, the only Geospatial data is a set of 2-D lat/lon arrays. The projection type is not lat/lon. THe arrays give the lat/lon of every individual cell.

I can't use a geotransform to reference the data because of the irregular gridding.

How can I create a dataset (such as a GeoTiff) that properly references the data?

Ideally I would then warp to some even grid.

I tried using an even spread of Ground Control Points, but the resulting GeoTiff did not display correctly… Despite giving GCPs up to 90 deg lat, ArcMap claims the GTiff has an extent ending at 70 deg latitude…


I was able to solve the issue using gdalwarp -geoloc as suggested. I created 3 VRTs (1 with cell values, 1 with latitude, 1 with longitude), and wrote the lat/lon vrts in a geoarrays in the data vrt metadata. Then using gdalwarp -geoloc worked like a charm.

The issue with extent was unrelated and due simply to the large difference between the original coordinate system and lat/lon. It was solved by explicitely stating the extent instead of having GDAL try to guess what it should be. (i.e. I added -te -180 0 180 90 to the gdalwarp line)

Best Answer

gdalwarp -geoloc allows you to use the complete 2d-array of latlon as georeference. With that, you can use any target CRS to reproject your data to a commonly used projection.

See my answer to this question for an example:

How to match a raster NetCDF data with a vector layer in QGIS?

Related Question