[Qgis-user] Does QGIS require units "m" for the projection coordinate variables in a netCDF/CF file?
Thomas Lavergne
thomas.lavergne at met.no
Sat Sep 16 00:37:55 PDT 2023
Thank you Richard,
I am not from the GIS world and not even a QGIS user, so bear with me if my
answers do not use the expected vocabulary.
>From my point of view, my netCDF files describe their geolocation in a
CF-compliant manner, with a grid_mapping CRS variable, and the x and y
projection coordinate variables. But QGIS does not recognize the CRS,
seemingly because I have my x and y as km (and I do specify :units="km", I
am not hiding this).
Since I am also a programmer, I tried to find where in the QGIS code the
netCDF/CF geolocation is read and decoded, to see if there was a strict
test on :units="m". But I failed to find this in the code.
Before I fill out a bug report, I wanted to hear from a QGIS developer (or
someone who knows how to navigate the software code) if we can identify
where the strict test on :units="m" is in the code, and see if alternative
solutions (accepting other units, all multiples of meters) was feasible.
All the best,
Thomas
fre. 15. sep. 2023 kl. 15:16 skrev Richard McDonnell <
richard.mcdonnell at opw.ie>:
> Thomas,
>
> I’m open to correction on this, but meters would generally be the default
> unit used in GIS, when dealing with metric datasets.
>
> What units you use to measure on your Map Canvas or store as attribution
> is then a different thing.
>
>
>
> I had a look for the EPSG codes for EASE2 but all I could get was *EPSG:6931
> <https://epsg.io/6931>*
>
> If you look at the units there you can see meters as the UoM.
>
> I hope that helps,
>
>
>
> Richard.
>
>
>
>
>
>
>
> ——
> Richard McDonnell MSc GIS, FME Certified Professional
> *FRM Data Management*
>
> ——
> Oifig na nOibreacha Poiblí
> Office of Public Works
>
> Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
> Jonathan Swift Street, Trim, Co Meath, C15 NX36
> ——
> M +353 87 688 5964 T +353 46 942 2409
> https://gov.ie/opw
>
> ——
> To send me files larger than 30MB, please use the link below
> https://filetransfer.opw.ie/filedrop/richard.mcdonnell@opw.ie
>
> Email Disclaimer:
> https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/
>
> ——
> MSc GIS, FME Certified Professional
>
> ——
> Oifig na nOibreacha Poiblí
> Office of Public Works
>
> Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
> Jonathan Swift Street, Trim, Co Meath, C15 NX36
> ——
> M +353 87 688 5964 T +353 46 942 2409
> https://https://gov.ie/opw <https://www.opw.ie>
>
> ——
> Email Disclaimer:
> https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/
> <https://www.opw.ie/en/disclaimer/>
>
> *From:* QGIS-User <qgis-user-bounces at lists.osgeo.org> *On Behalf Of *Thomas
> Lavergne via QGIS-User
> *Sent:* 15 September 2023 13:34
> *To:* qgis-user at lists.osgeo.org
> *Subject:* [Qgis-user] Does QGIS require units "m" for the projection
> coordinate variables in a netCDF/CF file?
>
>
>
> Dear QGIS community,
>
>
>
> We recently released a number of sea-ice climate data records stored in
> netCDF/CF files.
>
> An example file is here
> <https://thredds.met.no/thredds/catalog/osisaf/met.no/reprocessed/ice/drift_455m_files/merged/2020/12/catalog.html?dataset=osisaf/met.no/reprocessed/ice/drift_455m_files/merged/2020/12/ice_drift_nh_ease2-750_cdr-v1p0_24h-202012211200.nc>
> :
>
>
>
> Our files use a polar equal area projection (EASE2) and the x / y axis
> values are given with units "km" (kilometers):
>
>
>
> double xc(xc) ;
> xc:axis = "X" ;
> xc:units = "km" ;
> xc:long_name = "x coordinate of projection (eastings)" ;
> xc:standard_name = "projection_x_coordinate" ;
> double yc(yc) ;
> yc:axis = "Y" ;
> yc:units = "km" ;
> yc:long_name = "y coordinate of projection (northings)" ;
> yc:standard_name = "projection_y_coordinate"
>
>
>
> When opening these in QGIS, they are placed correctly on the map, but the
> message "Unkown CRS" appears in the lower-right corner.
>
>
>
> By manipulating our files, we could get QGIS to recognize the correct CRS.
>
>
>
> ncap2 -s 'xc=xc*1000f;yc=yc*1000f' infile.nc outfile.nc
> ncatted -O -a units,xc,m,c,"m" outfile.nc
> ncatted -O -a units,yc,m,c,"m" outfile.nc
>
>
>
> The NCO commands above change the x / y axis variables to units "m"
> (meters).
>
>
>
> The CF convention
> <http://cfconventions.org/Data/cf-conventions/cf-conventions-1.10/cf-conventions.html> does
> not impose that x / y axis variables are given with unit meters, and shows
> several examples using units "km". But this is apparently an issue for QGIS.
>
>
>
> Can someone please confirm that QGIS requires "meters" for these
> variables, and comment if this is a desired feature or if I should open a
> bug report at github?
>
>
>
> All the best,
>
> Thomas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230916/2bade7e0/attachment.htm>
More information about the QGIS-User
mailing list