Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix hecras parsing #230

Merged
merged 5 commits into from
Nov 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/GIS/private/reosgriddedrainfallrenderer_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class ReosGriddedRainfallRasterProvider_p : public QgsRasterDataProvider
QString description() const override {return QString();}

// QgsRasterDataProvider interface
QString htmlMetadata() override {return QString();}
QString htmlMetadata() const override {return QString();}
QString lastErrorTitle() override {return QString();}
QString lastError() override {return QString();}
Qgis::DataType sourceDataType( int ) const override {return Qgis::DataType::Float64;}
Expand Down
32 changes: 20 additions & 12 deletions src/simulationEngines/hecras/reoshecrasproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ bool ReosHecRasProject::parseProjectFile()
planFile.remove( QStringLiteral( "Plan File=" ) );
mPlans.insert( planFile, ReosHecRasPlan( projectDir.filePath( mProjectName + '.' + planFile ) ) );
if ( !mPlans.value( planFile ).isValid() )
return false;
mPlans.remove( planFile );
}

if ( line.startsWith( QStringLiteral( "Unsteady File=" ) ) )
Expand All @@ -150,7 +150,7 @@ bool ReosHecRasProject::parseProjectFile()
flowFile.remove( QStringLiteral( "Unsteady File=" ) );
mFlows.insert( flowFile, ReosHecRasFlow( projectDir.filePath( mProjectName + '.' + flowFile ) ) );
if ( !mFlows.value( flowFile ).isValid() )
return false;
mFlows.remove( flowFile );
}

if ( line.startsWith( QStringLiteral( "Current Plan=" ) ) )
Expand Down Expand Up @@ -331,7 +331,13 @@ bool ReosHecRasGeometry::parseGeometryFile()
if ( mTerrainFileName.contains( QStringLiteral( "\\" ) ) )
mTerrainFileName.replace( QLatin1String( "\\" ), QString( '/' ) );

mTerrainFileName = geomFileInfo.dir().filePath( mTerrainFileName );
QFileInfo terrainFileInfo( mTerrainFileName );
if ( !terrainFileInfo.isFile() || !terrainFileInfo.exists() )
mTerrainFileName = geomFileInfo.dir().filePath( mTerrainFileName );

terrainFileInfo = QFileInfo( mTerrainFileName );
if ( !terrainFileInfo.isFile() )
mTerrainFileName = geomFileInfo.dir().path() + QStringLiteral( "/Terrain/Terrain.hdf" );
}
}
else
Expand Down Expand Up @@ -1045,6 +1051,8 @@ bool ReosHecRasFlow::applyBoudaryFlow( const QList<BoundaryFlow> &flows )
}
else if ( inputLine.startsWith( QStringLiteral( "DSS File=" ) ) || inputLine.startsWith( QStringLiteral( "Use DSS=" ) ) )
continue;
else
outputStream << inputLine << "\r\n";

}
else if ( inputLine.startsWith( QStringLiteral( "Precipitation Mode=" ) ) )
Expand Down Expand Up @@ -1364,16 +1372,16 @@ QString ReosHecRasGeometry::BoundaryCondition::id() const
}


ReosDssPath ReosHecRasFlow::BoundaryFlow::buildDssFlowRatePath(const ReosHecRasPlan& plan) const
ReosDssPath ReosHecRasFlow::BoundaryFlow::buildDssFlowRatePath( const ReosHecRasPlan &plan ) const
{
ReosDssPath path;
path.setGroup(QStringLiteral("BCLINE"));
path.setVersion(plan.shortIdentifier());
path.setParameter(QStringLiteral("FLOW"));
path.setTimeInterval(plan.outputInterval());
ReosDssPath path;
path.setGroup( QStringLiteral( "BCLINE" ) );
path.setVersion( plan.shortIdentifier() );
path.setParameter( QStringLiteral( "FLOW" ) );
path.setTimeInterval( plan.outputInterval() );

const QString location = area() + QStringLiteral(": ") + boundaryConditionLine();
path.setLocation(location);
const QString location = area() + QStringLiteral( ": " ) + boundaryConditionLine();
path.setLocation( location );

return path;
return path;
}
3 changes: 1 addition & 2 deletions windows/osgeo_dependencies_bin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ ogdi.dll
openjp2.dll
parquet.dll
poppler.dll
proj_9_0.dll
proj_9_1.dll
proj_9_2.dll
proj_9_3.dll
spatialindex-64.dll
spatialite.dll
sqlite3.dll
Expand Down