@@ -111,7 +111,7 @@ bool MDAL::DriverGdal::initVertices( Vertices &vertices )
111
111
return is_longitude_shifted;
112
112
}
113
113
114
- void MDAL::DriverGdal::initFaces ( Vertices &Vertexs, Faces &Faces, bool is_longitude_shifted )
114
+ void MDAL::DriverGdal::initFaces ( const Vertices &Vertexs, Faces &Faces, bool is_longitude_shifted )
115
115
{
116
116
int reconnected = 0 ;
117
117
unsigned int mXSize = meshGDALDataset ()->mXSize ;
@@ -587,7 +587,7 @@ std::unique_ptr<MDAL::Mesh> MDAL::DriverGdal::load( const std::string &fileName,
587
587
}
588
588
}
589
589
590
- for ( std::shared_ptr<MDAL::GdalDataset> ds : datasets )
590
+ for ( std::shared_ptr<MDAL::GdalDataset> & ds : datasets )
591
591
if ( gdal_datasets.empty () || meshes_equals ( meshGDALDataset (), ds.get () ) )
592
592
gdal_datasets.push_back ( ds );
593
593
@@ -645,26 +645,28 @@ void MDAL::DriverGdal::parseBandIsVector( std::string &band_name, bool *is_vecto
645
645
{
646
646
band_name = MDAL::trim ( band_name );
647
647
648
- if ( MDAL::startsWith ( band_name, " u-" , MDAL::CaseInsensitive ) ||
649
- MDAL::startsWith ( band_name, " x-" , MDAL::CaseInsensitive ) ||
648
+ if ( MDAL::contains ( band_name, " U wind component" , MDAL::CaseInsensitive ) ||
650
649
MDAL::contains ( band_name, " u-component" , MDAL::CaseInsensitive ) ||
651
650
MDAL::contains ( band_name, " u component" , MDAL::CaseInsensitive ) ||
652
- MDAL::contains ( band_name, " U wind component" , MDAL::CaseInsensitive ) ||
653
- MDAL::startsWith ( band_name, " Northward" , MDAL::CaseInsensitive ) ||
651
+ MDAL::startsWith ( band_name, " u-" , MDAL::CaseInsensitive ) ||
654
652
MDAL::contains ( band_name, " x-component" , MDAL::CaseInsensitive ) ||
655
- MDAL::contains ( band_name, " x component" , MDAL::CaseInsensitive ) )
653
+ MDAL::contains ( band_name, " x component" , MDAL::CaseInsensitive ) ||
654
+ MDAL::startsWith ( band_name, " x-" , MDAL::CaseInsensitive ) ||
655
+ MDAL::contains ( band_name, " eastward" , MDAL::CaseInsensitive ) ||
656
+ MDAL::contains ( band_name, " zonal" , MDAL::CaseInsensitive ) )
656
657
{
657
658
*is_vector = true ; // vector
658
659
*is_x = true ; // X-Axis
659
660
}
660
- else if ( MDAL::startsWith ( band_name, " v-" , MDAL::CaseInsensitive ) ||
661
- MDAL::startsWith ( band_name, " y-" , MDAL::CaseInsensitive ) ||
661
+ else if ( MDAL::contains ( band_name, " V wind component" , MDAL::CaseInsensitive ) ||
662
662
MDAL::contains ( band_name, " v-component" , MDAL::CaseInsensitive ) ||
663
663
MDAL::contains ( band_name, " v component" , MDAL::CaseInsensitive ) ||
664
- MDAL::contains ( band_name, " V wind component" , MDAL::CaseInsensitive ) ||
665
- MDAL::startsWith ( band_name, " Eastward" , MDAL::CaseInsensitive ) ||
664
+ MDAL::startsWith ( band_name, " v-" , MDAL::CaseInsensitive ) ||
666
665
MDAL::contains ( band_name, " y-component" , MDAL::CaseInsensitive ) ||
667
- MDAL::contains ( band_name, " y component" , MDAL::CaseInsensitive ) )
666
+ MDAL::contains ( band_name, " y component" , MDAL::CaseInsensitive ) ||
667
+ MDAL::startsWith ( band_name, " y-" , MDAL::CaseInsensitive ) ||
668
+ MDAL::contains ( band_name, " northward" , MDAL::CaseInsensitive ) ||
669
+ MDAL::contains ( band_name, " meridional" , MDAL::CaseInsensitive ) )
668
670
{
669
671
*is_vector = true ; // vector
670
672
*is_x = false ; // Y-Axis
@@ -677,30 +679,48 @@ void MDAL::DriverGdal::parseBandIsVector( std::string &band_name, bool *is_vecto
677
679
678
680
if ( *is_vector )
679
681
{
680
- band_name = MDAL::replace ( band_name, " u-component of" , " " , MDAL::CaseInsensitive );
681
- band_name = MDAL::replace ( band_name, " v-component of" , " " , MDAL::CaseInsensitive );
682
+
682
683
band_name = MDAL::replace ( band_name, " U wind component" , " wind" , MDAL::CaseInsensitive );
683
684
band_name = MDAL::replace ( band_name, " V wind component" , " wind" , MDAL::CaseInsensitive );
684
- band_name = MDAL::replace ( band_name, " Northward" , " " , MDAL::CaseInsensitive );
685
- band_name = MDAL::replace ( band_name, " Eastward" , " " , MDAL::CaseInsensitive );
686
- band_name = MDAL::replace ( band_name, " x-component of" , " " , MDAL::CaseInsensitive );
687
- band_name = MDAL::replace ( band_name, " y-component of" , " " , MDAL::CaseInsensitive );
685
+
686
+ band_name = MDAL::replace ( band_name, " u-component of" , " " , MDAL::CaseInsensitive );
687
+ band_name = MDAL::replace ( band_name, " v-component of" , " " , MDAL::CaseInsensitive );
688
688
band_name = MDAL::replace ( band_name, " u-component" , " " , MDAL::CaseInsensitive );
689
689
band_name = MDAL::replace ( band_name, " v-component" , " " , MDAL::CaseInsensitive );
690
- band_name = MDAL::replace ( band_name, " x-component" , " " , MDAL::CaseInsensitive );
691
- band_name = MDAL::replace ( band_name, " y-component" , " " , MDAL::CaseInsensitive );
690
+ band_name = MDAL::replace ( band_name, " u-" , " " , MDAL::CaseInsensitive );
691
+ band_name = MDAL::replace ( band_name, " v-" , " " , MDAL::CaseInsensitive );
692
+
692
693
band_name = MDAL::replace ( band_name, " u component of" , " " , MDAL::CaseInsensitive );
693
694
band_name = MDAL::replace ( band_name, " v component of" , " " , MDAL::CaseInsensitive );
694
- band_name = MDAL::replace ( band_name, " x component of" , " " , MDAL::CaseInsensitive );
695
- band_name = MDAL::replace ( band_name, " y component of" , " " , MDAL::CaseInsensitive );
696
695
band_name = MDAL::replace ( band_name, " u component" , " " , MDAL::CaseInsensitive );
697
696
band_name = MDAL::replace ( band_name, " v component" , " " , MDAL::CaseInsensitive );
698
- band_name = MDAL::replace ( band_name, " x component" , " " , MDAL::CaseInsensitive );
699
- band_name = MDAL::replace ( band_name, " y component" , " " , MDAL::CaseInsensitive );
700
- band_name = MDAL::replace ( band_name, " u-" , " " , MDAL::CaseInsensitive );
701
- band_name = MDAL::replace ( band_name, " v-" , " " , MDAL::CaseInsensitive );
697
+
698
+ band_name = MDAL::replace ( band_name, " x-component of" , " " , MDAL::CaseInsensitive );
699
+ band_name = MDAL::replace ( band_name, " y-component of" , " " , MDAL::CaseInsensitive );
700
+ band_name = MDAL::replace ( band_name, " x-component" , " " , MDAL::CaseInsensitive );
701
+ band_name = MDAL::replace ( band_name, " y-component" , " " , MDAL::CaseInsensitive );
702
702
band_name = MDAL::replace ( band_name, " x-" , " " , MDAL::CaseInsensitive );
703
703
band_name = MDAL::replace ( band_name, " y-" , " " , MDAL::CaseInsensitive );
704
+
705
+ band_name = MDAL::replace ( band_name, " x component of" , " " , MDAL::CaseInsensitive );
706
+ band_name = MDAL::replace ( band_name, " y component of" , " " , MDAL::CaseInsensitive );
707
+ band_name = MDAL::replace ( band_name, " x component" , " " , MDAL::CaseInsensitive );
708
+ band_name = MDAL::replace ( band_name, " y component" , " " , MDAL::CaseInsensitive );
709
+
710
+ band_name = MDAL::replace ( band_name, " eastward component of" , " " , MDAL::CaseInsensitive );
711
+ band_name = MDAL::replace ( band_name, " northward component of" , " " , MDAL::CaseInsensitive );
712
+ band_name = MDAL::replace ( band_name, " eastward component" , " " , MDAL::CaseInsensitive );
713
+ band_name = MDAL::replace ( band_name, " northward component" , " " , MDAL::CaseInsensitive );
714
+ band_name = MDAL::replace ( band_name, " eastward" , " " , MDAL::CaseInsensitive );
715
+ band_name = MDAL::replace ( band_name, " northward" , " " , MDAL::CaseInsensitive );
716
+
717
+ band_name = MDAL::replace ( band_name, " zonal component of" , " " , MDAL::CaseInsensitive );
718
+ band_name = MDAL::replace ( band_name, " meridional component of" , " " , MDAL::CaseInsensitive );
719
+ band_name = MDAL::replace ( band_name, " zonal component" , " " , MDAL::CaseInsensitive );
720
+ band_name = MDAL::replace ( band_name, " meridional component" , " " , MDAL::CaseInsensitive );
721
+ band_name = MDAL::replace ( band_name, " zonal" , " " , MDAL::CaseInsensitive );
722
+ band_name = MDAL::replace ( band_name, " meridional" , " " , MDAL::CaseInsensitive );
723
+
704
724
band_name = MDAL::trim ( band_name );
705
725
}
706
726
}
0 commit comments