[gdal-dev] NetCDF: how to read coordinates from "lon" and "lat" variables?

andy aborruso at gmail.com
Tue Dec 3 03:09:17 PST 2024


Hi Michael and thank you.

I do not have lon and lat subdatasets listed under "geolocation" and I
wrote here for that reason.
I also tried doing a VRT, but I am doing something wrong, because I always
see the coordinates in pixels

Thank you again


<VRTDataset rasterXSize="174" rasterYSize="229">
  <SRS>EPSG:4326</SRS>

  <VRTRasterBand dataType="Float32" band="1">
    <GeoLocationInfo>
      <GeoLocXDataSet>NETCDF:"out.input.nc":lon</GeoLocXDataSet>
      <GeoLocYDataSet>NETCDF:"out.input.nc":lat</GeoLocYDataSet>
      <GeoLocXBand>1</GeoLocXBand>
      <GeoLocYBand>1</GeoLocYBand>
      <GeoLocPixelOffset>0</GeoLocPixelOffset>
      <GeoLocLineOffset>0</GeoLocLineOffset>
      <GeoLocPixelStep>1</GeoLocPixelStep>
      <GeoLocLineStep>1</GeoLocLineStep>
    </GeoLocationInfo>

    <Metadata>
      <MDI key="long_name">NO2 Concentration</MDI>
      <MDI key="units">ppb vol</MDI>
    </Metadata>

    <ComplexSource>
      <SourceFilename relativeToVRT="1">NETCDF:"out.input.nc
":NO2[0][0]</SourceFilename>
      <SourceBand>1</SourceBand>
      <SourceProperties RasterXSize="174" RasterYSize="229"
DataType="Float32" BlockXSize="174" BlockYSize="1" />
      <SrcRect xOff="0" yOff="0" xSize="174" ySize="229" />
      <DstRect xOff="0" yOff="0" xSize="174" ySize="229" />
    </ComplexSource>
  </VRTRasterBand>
</VRTDataset>



-- 
___________________

Andrea Borruso
website: https://medium.com/tantotanto
38° 7' 48" N, 13° 21' 9" E, EPSG:4326
___________________

"cercare e saper riconoscere chi e cosa,
 in mezzo all’inferno, non è inferno,
e farlo durare, e dargli spazio"

Italo Calvino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20241203/eee37278/attachment-0001.htm>


More information about the gdal-dev mailing list