diff --git a/src/Airports/GenAirports850/airport.cxx b/src/Airports/GenAirports850/airport.cxx index b697cc78..15a2348f 100644 --- a/src/Airports/GenAirports850/airport.cxx +++ b/src/Airports/GenAirports850/airport.cxx @@ -1065,19 +1065,25 @@ void Airport::BuildBtg(const string& root, const string_list& elev_src ) point_list taxisigns_nodes = calc_elevations( apt_surf, ts_nodes, 0.0 ); // calc water runway buoys elevations: - point_list buoy_nodes; - buoy_nodes.clear(); - for ( i = 0; i < (int)waterrunways.size(); ++i ) - { - TGPolygon tmp_nodes; - tmp_nodes.erase(); - tmp_nodes = waterrunways[i]->GetNodes(); - for (j=0; j< tmp_nodes.contour_size( 0 ); ++j ) + point_list water_buoys_nodes; + if ( waterrunways.size() > 0){ + if ( waterrunways[0]->HasBuoys() ) { - buoy_nodes.push_back( tmp_nodes.get_pt( 0, j ) ); + point_list buoy_nodes; + buoy_nodes.clear(); + for ( i = 0; i < (int)waterrunways.size(); ++i ) + { + TGPolygon tmp_nodes; + tmp_nodes.erase(); + tmp_nodes = waterrunways[i]->GetNodes(); + for (j=0; j< tmp_nodes.contour_size( 0 ); ++j ) + { + buoy_nodes.push_back( tmp_nodes.get_pt( 0, j ) ); + } + } + water_buoys_nodes = calc_elevations( apt_surf, buoy_nodes, 0.0 ); } } - point_list water_buoys_nodes = calc_elevations( apt_surf, buoy_nodes, 0.0 ); // add base skirt (to hide potential cracks) diff --git a/src/Airports/GenAirports850/runway.cxx b/src/Airports/GenAirports850/runway.cxx index d8b35751..7054ebfa 100644 --- a/src/Airports/GenAirports850/runway.cxx +++ b/src/Airports/GenAirports850/runway.cxx @@ -114,16 +114,14 @@ TGPolygon WaterRunway::GetNodes() { TGPolygon buoy_nodes; buoy_nodes.erase(); - if (buoys == 1){ /*no point to calculate stuff we don't need*/ - double heading, az2, length; - // calculate runway heading and length - geo_inverse_wgs_84( lat[0], lon[0], lat[1], lon[1], &heading, &az2, &length ); + double heading, az2, length; + // calculate runway heading and length + geo_inverse_wgs_84( lat[0], lon[0], lat[1], lon[1], &heading, &az2, &length ); - // create a polygon for the 4 buoy points - // TODO: The amount of points can be increased if needed (more buoys) - buoy_nodes = gen_wgs84_area(Point3D( (lon[0] + lon[1]) / 2 , (lat[0] + lat[1]) / 2, 0), length, 0, 0, width, heading, 0, false); - } + // create a polygon for the 4 buoy points + // TODO: The amount of points can be increased if needed (more buoys) + buoy_nodes = gen_wgs84_area(Point3D( (lon[0] + lon[1]) / 2 , (lat[0] + lat[1]) / 2, 0), length, 0, 0, width, heading, 0, false); return buoy_nodes; } diff --git a/src/Airports/GenAirports850/runway.hxx b/src/Airports/GenAirports850/runway.hxx index 2509f849..98ec8d79 100644 --- a/src/Airports/GenAirports850/runway.hxx +++ b/src/Airports/GenAirports850/runway.hxx @@ -163,6 +163,14 @@ public: return ( Point3D( lon[1], lat[1], 0.0f )); } + bool HasBuoys() + { + if (buoys == 1) + return true; + else + return false; + } + double width; int buoys; char rwnum[2][16];