ctu-geoforall-lab-sandbox / qgis-erosion-plugin-wps

QGIS plugin for erosion computation (also available as WPS service)
0 stars 0 forks source link

Design base class for input/output #1

Open landam opened 7 years ago

landam commented 7 years ago

Design base Python class for communication with GRASS GIS.

class ErosionBase:

    def __init__(self):
         # 1. establish connection with GRASS

    def import(self, [filepath1, filepath2]):
         # call self._import in loop

   def _import(self, filepath):
         # 1. create new location (need to define srs) and mapset - only for first imported file
         # 2. determine using GDAL file type (raster, vector, table - vector without geometry)
         if raster:
             # link using GRASS module r.external
         elif vector:
             # import using v.import (includes also transformation if srs differs) or v.in.ogr
         else: # table
            # import csv file using db.in.ogr

    def export(self, dest_dir):
         # export output data (rasters - r.out.gdal, vectors - v.out.ogr) to destination directory
landam commented 7 years ago

See https://github.com/ctu-geoforall-lab-sandbox/qgis-erosion-plugin-wps/blob/master/pyerosion/erosionbase.py

landam commented 7 years ago

Example of commit log message:

"base class - implement import method (see #1)"

or fix #1 when you want to close issue via commit

landam commented 7 years ago

To be implemented: