Skip to content

[Bug] v.import datum_trans=-1 fails #5866

Open
@marisn

Description

@marisn

Describe the bug

If datum_trans parameter is set to -1, that should print datum transformation info, it actually results in a Python traceback as code calls g.proj without providing a -p flag.

To reproduce

v.import input=tp_92_20_92.gpkg epsg=3059 datum_trans=-1
KĻŪDA: No output format specified. Define one of the options: plain,
         shell, json, wkt, or proj4 using the -p flag.
Traceback (most recent call last):
  File "scripts/v.import", line 398, in <module>
    sys.exit(main())
             ~~~~^^
  File "scripts/v.import", line 208, in main
    return gs.run_command(
           ~~~~~~~~~~~~~~^
        "g.proj", epsg=options["epsg"], datum_trans=options["datum_trans"]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "etc/python/grass/script/core.py", line 522, in run_command
    return handle_errors(returncode, result=None, args=args, kwargs=kwargs)
  File "etc/python/grass/script/core.py", line 375, in handle_errors
    raise CalledModuleError(module=module, code=code, returncode=returncode)
grass.exceptions.CalledModuleError: Module run `g.proj epsg=3059 datum_trans=-1` ended with an error.
The subprocess ended with a non-zero return code: 1. See errors above the traceback or in the error output.

Expected behavior

Datum transformation information is printed (as per documentation).

System description

Current main on Linux.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PythonRelated code is in PythonbugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions