Skip to content

Commit

Permalink
Use default arguments for vector arguments.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Oct 13, 2016
1 parent 2d02306 commit 75908c5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
17 changes: 1 addition & 16 deletions io/derivative/DerivativeWriter.cpp
Expand Up @@ -77,7 +77,7 @@ void DerivativeWriter::addArgs(ProgramArgs& args)
args.add("filename", "Output filename", m_filename).setPositional();
args.add("grid_dist_x", "X grid distance", m_GRID_DIST_X, 15.0);
args.add("grid_dist_y", "Y grid distance", m_GRID_DIST_Y, 15.0);
args.add("primitive_type", "Primitive type", m_primTypesSpec);
args.add("primitive_type", "Primitive type", m_primTypesSpec, {"slope_d8"});
}


Expand All @@ -95,21 +95,6 @@ void DerivativeWriter::initialize()
{"total_curvature", TOTAL_CURVATURE},
{"catchment_area", CATCHMENT_AREA}
};
/**
primtypes["slope_d8"] = SLOPE_D8;
primtypes["slope_fd"] = SLOPE_FD;
primtypes["aspect_d8"] = ASPECT_D8;
primtypes["aspect_fd"] = ASPECT_FD;
primtypes["hillshade"] = HILLSHADE;
primtypes["contour_curvature"] = CONTOUR_CURVATURE;
primtypes["profile_curvature"] = PROFILE_CURVATURE;
primtypes["tangential_curvature"] = TANGENTIAL_CURVATURE;
primtypes["total_curvature"] = TOTAL_CURVATURE;
primtypes["catchment_area"] = CATCHMENT_AREA;
**/

if (m_primTypesSpec.empty())
m_primTypesSpec.push_back("slope_d8");

handleFilenameTemplate();
if (m_hashPos == std::string::npos && m_primTypesSpec.size() > 1)
Expand Down
4 changes: 1 addition & 3 deletions io/gdal/GDALWriter.cpp
Expand Up @@ -67,7 +67,7 @@ void GDALWriter::addArgs(ProgramArgs& args)
args.add("gdalopts", "GDAL driver options (name=value,name=value...)",
m_options);
args.add("output_type", "Statistics produced ('min', 'max', 'mean', "
"'idw', 'count', 'stdev' or 'all')", m_outputTypeString);
"'idw', 'count', 'stdev' or 'all')", m_outputTypeString, {"all"} );
args.add("window_size", "Cell distance for fallback interpolation",
m_windowSize);
}
Expand Down Expand Up @@ -102,8 +102,6 @@ void GDALWriter::initialize()
throw pdal_error(oss.str());
}
}
if (m_outputTypes == 0)
m_outputTypes = ~0;

gdal::registerDrivers();
}
Expand Down
4 changes: 1 addition & 3 deletions plugins/p2g/io/P2gWriter.cpp
Expand Up @@ -61,7 +61,7 @@ void P2gWriter::addArgs(ProgramArgs& args)
args.add("grid_dist_y", "Y grid distance", m_GRID_DIST_Y, 6.0);
args.add("radius", "Radius", m_RADIUS, 8.4852813742385713);
args.add("fill_window_size", "Fill window size", m_fill_window_size, 3U);
args.add("output_type", "Output type", m_outputTypeSpec);
args.add("output_type", "Output type", m_outputTypeSpec, {"all"});
args.add("output_format", "Output format", m_outputFormatSpec, "grid");
args.add("bounds", "Output raster bounds", m_bounds);

Expand Down Expand Up @@ -95,8 +95,6 @@ void P2gWriter::initialize()
throw p2g_error(oss.str());
}
}
if (m_outputTypes == 0)
m_outputTypes = OUTPUT_TYPE_ALL;

std::string fmt = Utils::tolower(m_outputFormatSpec);
if (fmt == "grid")
Expand Down

0 comments on commit 75908c5

Please sign in to comment.