1
0
Fork 0

Minor clean up

This commit is contained in:
Scott Giese 2019-01-20 17:52:56 -06:00
parent e84b69efae
commit de43172716
3 changed files with 67 additions and 64 deletions

View file

@ -198,7 +198,6 @@ TGArray::parse( SGBucket& b ) {
SG_LOG(SG_GENERAL, SG_DEBUG, " cols = " << cols << " rows = " << rows ); SG_LOG(SG_GENERAL, SG_DEBUG, " cols = " << cols << " rows = " << rows );
SG_LOG(SG_GENERAL, SG_DEBUG, " col_step = " << col_step << " row_step = " << row_step ); SG_LOG(SG_GENERAL, SG_DEBUG, " col_step = " << col_step << " row_step = " << row_step );
in_data = new short[cols * rows]; in_data = new short[cols * rows];
memset(in_data, 0, sizeof(short) * cols * rows); memset(in_data, 0, sizeof(short) * cols * rows);
SG_LOG(SG_GENERAL, SG_DEBUG, " File not open, so using zero'd data" ); SG_LOG(SG_GENERAL, SG_DEBUG, " File not open, so using zero'd data" );
@ -254,7 +253,8 @@ void TGArray::write_bin(const string root_dir, bool rectified, SGBucket& b) {
string base = b.gen_base_path(); string base = b.gen_base_path();
string path = root_dir + "/" + base; string path = root_dir + "/" + base;
string extension = ".arr.new.gz"; string extension = ".arr.new.gz";
if (rectified) extension = ".arr.rectified.gz"; if (rectified)
extension = ".arr.rectified.gz";
SGPath sgp( path ); SGPath sgp( path );
sgp.append( "dummy" ); sgp.append( "dummy" );
sgp.create_dir( 0755 ); sgp.create_dir( 0755 );
@ -924,4 +924,3 @@ bool TGArray::is_open() const
return false; return false;
} }
} }

View file

@ -49,6 +49,7 @@ private:
// Whether or not the input data have been rectified // Whether or not the input data have been rectified
bool rectified; bool rectified;
// Distance between column and row data points (in arc seconds) // Distance between column and row data points (in arc seconds)
double col_step, row_step; double col_step, row_step;
@ -61,6 +62,7 @@ private:
// list of cliff contours // list of cliff contours
tgcontour_list cliffs_list; tgcontour_list cliffs_list;
void parse_bin(); void parse_bin();
// Routines for height rectification // Routines for height rectification
@ -68,6 +70,7 @@ private:
bool is_bad_point(const int xgrid, const int ygrid, const std::vector<int> bad_points) const; bool is_bad_point(const int xgrid, const int ygrid, const std::vector<int> bad_points) const;
double rectify_point(const int xgrid, const int ygrid, const std::vector<int> bad_points) const; double rectify_point(const int xgrid, const int ygrid, const std::vector<int> bad_points) const;
bool is_near_cliff(const double lon1,const double lon2, const double bad_zone) const; bool is_near_cliff(const double lon1,const double lon2, const double bad_zone) const;
public: public:
// Constructor // Constructor
@ -129,6 +132,7 @@ public:
// Check whether or not two points are on the same side of contour // Check whether or not two points are on the same side of contour
bool check_points (const double a,const double b, const double c, const double d) const; bool check_points (const double a,const double b, const double c, const double d) const;
// reset Array to initial state - ready to load another elevation file // reset Array to initial state - ready to load another elevation file
void unload( void ); void unload( void );
}; };

View file

@ -812,7 +812,7 @@ extern SGGeod InterpolateElevation( const SGGeod& dst_node, const SGGeod& start,
static void AddIntermediateNodes( const SGGeod& p0, const SGGeod& p1, bool preserve3d, std::vector<TGNode*>& nodes, tgContour& result, double bbEpsilon, double errEpsilon ) static void AddIntermediateNodes( const SGGeod& p0, const SGGeod& p1, bool preserve3d, std::vector<TGNode*>& nodes, tgContour& result, double bbEpsilon, double errEpsilon )
{ {
TGNode* new_pt; TGNode* new_pt = nullptr;
SGGeod new_geode; SGGeod new_geode;
SG_LOG(SG_GENERAL, SG_BULK, " " << p0 << " <==> " << p1 ); SG_LOG(SG_GENERAL, SG_BULK, " " << p0 << " <==> " << p1 );