diff --git a/src/main.cpp b/src/main.cpp index 2a195d7..591d141 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -176,7 +176,7 @@ constexpr std::tuple marching_squares_lookup(int case 7: return {0, 0.5, 0.5, 1}; case 8: - return {0.5, 0.5, 0, 0.5}; + return {0.5, 1, 0, 0.5}; }; @@ -250,7 +250,7 @@ void write_output_file(std::vector> all_points, const char *f if ((points[k].x - points[k-1].x) < 0) left_to_right = false; bool top_to_bottom = true; - if ((points[k].y - points[k-1].y) < 0) + if ((points[k].y - points[k-1].y) <= 0) left_to_right = false; @@ -263,12 +263,12 @@ void write_output_file(std::vector> all_points, const char *f if (left_to_right or !top_to_bottom) { - geometry->setPoint(geometry->getNumPoints(),x + (x1/6) ,y + (y1/6)); - geometry->setPoint(geometry->getNumPoints(),x + (x2/6) ,y + (y2/6)); + geometry->setPoint(geometry->getNumPoints(),x + (x1/4) ,y + (y1/4)); + geometry->setPoint(geometry->getNumPoints(),x + (x2/4) ,y + (y2/4)); } else { - geometry->setPoint(geometry->getNumPoints(),x + (x2/6) ,y + (y2/6)); - geometry->setPoint(geometry->getNumPoints(),x + (x1/6) ,y + (y1/6)); + geometry->setPoint(geometry->getNumPoints(),x + (x2/4) ,y + (y2/4)); + geometry->setPoint(geometry->getNumPoints(),x + (x1/4) ,y + (y1/4)); } } @@ -324,8 +324,8 @@ int main(int argc, const char* argv[]) map.statistics(); std::string steepness_output_file; - if (cmdl({"--steepness"}, "steepness.tif") >> steepness_output_file) - map.calculate_steepness(output_file.c_str()); + //if (cmdl({"--steepness"}, "steepness.tif") >> steepness_output_file) + // map.calculate_steepness(output_file.c_str()); auto lines = create_lines(&map, interval); write_output_file(lines, output_file.c_str(), &map);