[gdal-dev] gdalwarp has blank metadata
Adam Dershowitz
adershowitz at exponent.com
Mon Feb 13 17:58:16 PST 2017
Thanks much for both the fix and the work around. I'll look into ncdump.
--Adam
-----Original Message-----
From: Even Rouault [even.rouault at spatialys.com<mailto:even.rouault at spatialys.com>]
Sent: Monday, February 13, 2017 03:04 PM Pacific Standard Time
To: gdal-dev at lists.osgeo.org
Cc: Adam Dershowitz
Subject: Re: [gdal-dev] gdalwarp has blank metadata
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170214/153a130d/attachment.html>
More information about the gdal-dev
mailing list