#11514 OSDU: parse and add datum elevation to well paths.

This commit is contained in:
Kristian Bendiksen committed 2024-06-18 15:47:47 +02:00
1 parent 4365b0dfb9
commit d0a870bb38
11 files changed
+70 -12

No files matched your search

@@ -19,6 +19,8 @@
#include <QUrl>
#include <QUrlQuery>
#include <limits>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -457,7 +459,29 @@ void RiaOsduConnector::parseWellbores( QNetworkReply* reply, const QString& well
QString id = resultObj["id"].toString();
QString kind = resultObj["kind"].toString();
QString name = resultObj["data"].toObject()["FacilityName"].toString();
m_wellbores[wellId].push_back( OsduWellbore{ id, kind, name, wellId } );
// Extract datum elevation. The DefaultVerticalMeasurementID is probably the datum elevation needed.
// Default to 0.0 if nothing is found, but finding nothing is suspicious.
double datumElevation = std::numeric_limits<double>::infinity();
QString defaultVerticalMeasurementId = resultObj["data"].toObject()["DefaultVerticalMeasurementID"].toString();
QJsonArray verticalMeasurementsArray = resultObj["data"].toObject()["VerticalMeasurements"].toArray();
for ( const QJsonValue& vma : verticalMeasurementsArray )
{
QString verticalMeasurementId = vma["VerticalMeasurementID"].toString();
if ( verticalMeasurementId == defaultVerticalMeasurementId )
{
double verticalMeasurement = vma["VerticalMeasurement"].toDouble( 0.0 );
datumElevation = verticalMeasurement;
}
}
if ( std::isinf( datumElevation ) )
{
RiaLogging::warning( QString( "Missing datum elevation for well bore '%1'. Id: %2" ).arg( name ).arg( id ) );
datumElevation = 0.0;
}
m_wellbores[wellId].push_back( OsduWellbore{ id, kind, name, wellId, datumElevation } );
}
}
@@ -27,6 +27,7 @@ struct OsduWellbore
QString kind;
QString name;
QString wellId;
double datumElevation;
};
struct OsduWellboreTrajectory
@@ -90,7 +90,7 @@ void RicWellPathsImportOsduFeature::onActionTriggered( bool isChecked )
auto task = progress.task( QString( "Importing well: %1" ).arg( w.name ) );
auto [wellPathGeometry, errorMessage] =
RimWellPathCollection::loadWellPathGeometryFromOsdu( osduConnector, w.wellboreTrajectoryId );
RimWellPathCollection::loadWellPathGeometryFromOsdu( osduConnector, w.wellboreTrajectoryId, w.datumElevation );
if ( wellPathGeometry.notNull() )
{
auto wellPath = new RimOsduWellPath;
@@ -98,6 +98,7 @@ void RicWellPathsImportOsduFeature::onActionTriggered( bool isChecked )
wellPath->setWellId( w.wellId );
wellPath->setWellboreId( w.wellboreId );
wellPath->setWellboreTrajectoryId( w.wellboreTrajectoryId );
wellPath->setDatumElevationFromOsdu( w.datumElevation );
oilField->wellPathCollection->addWellPath( wellPath );
@@ -579,7 +579,8 @@ void WellSummaryPage::wellboreTrajectoryFinished( const QString& wellboreId, int
wiz->addWellInfo( { .name = wellbore.value().name,
.wellId = well.value().id,
.wellboreId = w.wellboreId,
.wellboreTrajectoryId = wellboreTrajectoryId } );
.wellboreTrajectoryId = wellboreTrajectoryId,
.datumElevation = wellbore.value().datumElevation } );
}
}
@@ -370,6 +370,7 @@ public:
QString wellId;
QString wellboreId;
QString wellboreTrajectoryId;
double datumElevation;
};
RiuWellImportWizard( const QString& downloadFolder,