| 235 | |
| 236 | |
| 237 | void TIndexKernel::validateSwitches(ProgramArgs& args) |
| 238 | { |
| 239 | if (m_subcommand == "merge") |
| 240 | { |
| 241 | if (!m_wkt.empty() && !m_bounds.empty()) |
| 242 | throw pdal_error("Can't specify both 'polygon' and " |
| 243 | "'bounds' options."); |
| 244 | if (!m_bounds.empty()) |
| 245 | m_wkt = m_bounds.toWKT(); |
| 246 | } |
| 247 | else |
| 248 | { |
| 249 | int argc = static_cast<int>(!m_filespec.empty()) + |
| 250 | static_cast<int>(!m_listfile.empty()) + static_cast<int>(m_usestdin); |
| 251 | if (argc > 1) |
| 252 | throw pdal_error("Can't specify more than one of --glob, " |
| 253 | "--filelist or --stdin."); |
| 254 | if (!argc) |
| 255 | throw pdal_error("Must specify either --glob, --filelist or" |
| 256 | " --stdin."); |
| 257 | if (m_prefix.size() && m_absPath) |
| 258 | throw pdal_error("Can't specify both --write_absolute_path and " |
| 259 | "--path_prefix options."); |
| 260 | if (args.set("a_srs")) |
| 261 | m_overrideASrs = true; |
| 262 | if (m_driverName == "ESRI Shapefile") |
| 263 | m_maxFieldSize = 254; |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | |
| 268 | int TIndexKernel::execute() |