On lundi 13 février 2017 21:32:02 CET Adam Dershowitz wrote: > I have been using gdalwarp to convert a geotiff to NetCDF format. The odd > thing is that if the result is in feet, I get blank units in my output > metadata units. While if I go to meters, I get the correct units. > So for example this works correctly: > > > gdalwarp -t_srs EPSG:3651 -of netCDF cea.tif cea_m.nc > > and gdalinof shows data like this: > x#standard_name=projection_x_coordinate > x#units=m > y#long_name=y coordinate of projection > y#standard_name=projection_y_coordinate > y#units=m > > > While this: > gdalwarp -t_srs EPSG:3652 -of netCDF cea.tif cea_ft.nc > > Has this metadata: > x#standard_name=projection_x_coordinate > x#units= > y#long_name=y coordinate of projection > y#standard_name=projection_y_coordinate > y#units= > > The reason that this is an issue is that I’m trying to view this data with a > reader that is crashing due to the empty strings. I have reported a bug > there, and it is being addressed. But, it does seem like there is also an > issue with gdalwarp generating these empty strings for netCDF files. > Shouldn’t these strings contain “feet”? I did try to use gdal_edit to try > to change that, but didn’t have any luck for the netCDF file. > Any suggestions for how to fix these files? And, how to work around this > problem?
Adam, The netCDF driver didn't have support for US survey foot unit. I've added it per https:// trac.osgeo.org/gdal/changeset/37378 I used the "US_survey_foot" string accordingly with http://mooring.ucsd.edu/software/matlab/mfiles/netcdf/udunits.dat , but I'd appreciate confirmation from netCDF experts lurking around. As a workaround you could use ncdump / ncgen to edit the existing file. Even -- Spatialys - Geospatial professional services http://www.spatialys.com
_______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev
