mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
update to MDAL 0.5.1: fcritical fix for SWW/Telemac files
This commit is contained in:
parent
fd32338747
commit
572ff9b724
8
external/mdal/frmts/mdal_netcdf.cpp
vendored
8
external/mdal/frmts/mdal_netcdf.cpp
vendored
@ -305,6 +305,14 @@ double NetCDFFile::getFillValue( int varid ) const
|
||||
return getAttrDouble( varid, "_FillValue" );
|
||||
}
|
||||
|
||||
bool NetCDFFile::hasAttrDouble( int varid, const std::string &attr_name ) const
|
||||
{
|
||||
double res;
|
||||
if ( nc_get_att_double( mNcid, varid, attr_name.c_str(), &res ) )
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
double NetCDFFile::getAttrDouble( int varid, const std::string &attr_name ) const
|
||||
{
|
||||
double res;
|
||||
|
1
external/mdal/frmts/mdal_netcdf.hpp
vendored
1
external/mdal/frmts/mdal_netcdf.hpp
vendored
@ -59,6 +59,7 @@ class NetCDFFile
|
||||
|
||||
bool hasAttrInt( const std::string &name, const std::string &attr_name ) const;
|
||||
int getAttrInt( const std::string &name, const std::string &attr_name ) const;
|
||||
bool hasAttrDouble( int varid, const std::string &attr_name ) const;
|
||||
double getAttrDouble( int varid, const std::string &attr_name ) const;
|
||||
/**
|
||||
* Get string attribute
|
||||
|
8
external/mdal/frmts/mdal_sww.cpp
vendored
8
external/mdal/frmts/mdal_sww.cpp
vendored
@ -122,8 +122,12 @@ MDAL::Vertices MDAL::DriverSWW::readVertices( const NetCDFFile &ncFile ) const
|
||||
std::vector<double> pz = readZCoords( ncFile );
|
||||
|
||||
// we may need to apply a shift to the X,Y coordinates
|
||||
double xLLcorner = ncFile.getAttrDouble( NC_GLOBAL, "xllcorner" );
|
||||
double yLLcorner = ncFile.getAttrDouble( NC_GLOBAL, "yllcorner" );
|
||||
double xLLcorner = 0.0;
|
||||
if ( ncFile.hasAttrDouble( NC_GLOBAL, "xllcorner" ) )
|
||||
xLLcorner = ncFile.getAttrDouble( NC_GLOBAL, "xllcorner" );
|
||||
double yLLcorner = 0.0;
|
||||
if ( ncFile.hasAttrDouble( NC_GLOBAL, "yllcorner" ) )
|
||||
yLLcorner = ncFile.getAttrDouble( NC_GLOBAL, "yllcorner" );
|
||||
|
||||
MDAL::Vertices vertices( nPoints );
|
||||
Vertex *vertexPtr = vertices.data();
|
||||
|
2
external/mdal/mdal.cpp
vendored
2
external/mdal/mdal.cpp
vendored
@ -22,7 +22,7 @@ static MDAL_Status sLastStatus;
|
||||
|
||||
const char *MDAL_Version()
|
||||
{
|
||||
return "0.5.0";
|
||||
return "0.5.1";
|
||||
}
|
||||
|
||||
MDAL_Status MDAL_LastStatus()
|
||||
|
Loading…
x
Reference in New Issue
Block a user