[GRASS-git] [OSGeo/grass] ff33a4: r.import and v.import: Use PID and node for tmp lo...

Vaclav Petras noreply at github.com
Tue Nov 17 07:11:05 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/OSGeo/grass
  Commit: ff33a47ec7608d3be7116df11de8b0b4b186c654
      https://github.com/OSGeo/grass/commit/ff33a47ec7608d3be7116df11de8b0b4b186c654
  Author: Vaclav Petras <wenzeslaus at gmail.com>
  Date:   2020-11-17 (Tue, 17 Nov 2020)

  Changed paths:
    M lib/python/script/core.py
    A lib/python/script/testsuite/test_names.py
    M lib/python/script/utils.py
    M scripts/r.import/r.import.py
    A scripts/r.import/testsuite/test_parallel.sh
    M scripts/r.import/testsuite/test_r_import.py
    A scripts/v.import/testsuite/data/all_types.gpkg
    A scripts/v.import/testsuite/data/all_types_wgs84.gpkg
    A scripts/v.import/testsuite/test_parallel.sh
    A scripts/v.import/testsuite/test_v_import.py
    M scripts/v.import/v.import.py

  Log Message:
  -----------
  r.import and v.import: Use PID and node for tmp location (#653)

This adds several new functions to the library API for creating unique names
for temporary elements/objects in GRASS database. The one needed by r.import and v.import
is adding PID and node name to a name provided by the caller which is based on the current
practice of adding PID, but now adding the node name similarly to how mapset .tmp directory
is handled.

A completely new test is provided for basic functionality of v.import and the current r.import
is partially fixed, but still failing which is unrelated to this change.
A parallel test with reprojection is provided for both modules, although the v.import
is suboptimal because the attribute table import cannot be currently disabled.
The library functions are tested for expected results (but not for likelihood of collisions).

The library functions are based on the multiple needs in r.import and v.import which
create a temporary vector in the current mapset and existing functions in the library.
The goal is to provide a unified API as well as clear way how to fix user code in the
future if any of the methods will turn up to be wrong.

A new legalize/replace/escape vector name function is based on C equivalent Vect_legal_filename()
in terms of character limitations and keyword checks, but it is trying to be more flexible
since it is in Python and it is actually trying to create a legal name automatically
as opposed to being used for checking user input and giving an error. The keywords check
from Vect_legal_filename() is limited and left as future work.




More information about the grass-commit mailing list