VCityTeam / py3dtilers

Tilers accepting various input formats (OBJ, 3DCity databases, GeoJson, IFC) and producing 3DTiles tilesets.
GNU Lesser General Public License v2.1
199 stars 52 forks source link

Crash on unknown arguments #155

Closed wesley-petit closed 1 year ago

wesley-petit commented 1 year ago

For one of my projects, I'm using TilesetTiler's parse_command_line function to parse 3D Tiles, and I'm also using non-py3DTilers arguments to set options in my application. However, I get an error message from py3DTilers TilesetTiler:

unrecognized arguments : --start_date 42

This is because, by default, TilesetTiler uses parse_args() which will create an error message when an unknown command appears: a https://stackoverflow.com/questions/12818146/python-argparse-ignore-unrecognised-arguments

You can create reproduces the error with :

    tiler = TilesetTiler()
    args = tiler.parser.parse_args(['--foo', '42'])

We can easily fix this issue using parse_known_args function.