QGEP / qgepqwat2ili

3 stars 3 forks source link

qgep:extractlabels_interlis cannot be launched from cmd line #129

Open sjib opened 1 year ago

sjib commented 1 year ago

Describe the bug When trying to use INTERLIS label export as batch command you have to have a valid LABELS_FILE at hand for the cmd call in qgepqwat2ili:

python -m qgepqwat2ili qgep [-h] [--selection SELECTION] [--labels_file LABELS_FILE] [--recreate_schema] [--skip_validation] [--pgservice PGSERVICE] [--log] {import,export} path

In the processing tools there is an extra processing tool qgep:extractlabels_interlis at hand that can be launched before. QGIS allows to launch processing tools also from the cmd line when launched via the OSGEO4W Shell (see 26.8. Using processing from the command line)

The problem is, that when running eg. qgis_process run qgep:extractlabels_interlis

C:\Program Files\QGIS 3.30.3>qgis_process run qgep:extractlabels_interlis --distance_units=meters --area_units=m2 --ellipsoid=NONE --OUTPUT='G:/psql/Export/test5.geojson' --RESTRICT_TO_SELECTION=false --SCALES=0 --SCALES=1 --STRUCTURE_VIEW_LAYER='service='\''pg_qgep_romo'\'' key='\''obj_id'\'' estimatedmetadata=true srid=2056 type=Point checkPrimaryKeyUnicity='\''1'\'' table="qgep_od"."vw_qgep_wastewater_structure" -- (situation_geometry)' --REACH_VIEW_LAYER='service='\''pg_qgep_romo'\'' key='\''obj_id'\'' srid=2056 type=CompoundCurveZ checkPrimaryKeyUnicity='\''1'\'' table="qgep_od"."vw_qgep_reach" (progression_geometry)' --CATCHMENT_AREA_VIEW_LAYER='service='\''pg_qgep_romo'\'' key='\''obj_id'\'' srid=2056 type=CurvePolygon checkPrimaryKeyUnicity='\''0'\'' table="qgep_od"."catchment_area" (perimeter_geometry)'

we get the information: Algorithm qgep:extractlabels_interlis not found!

When checking the available processes qgep:extractlabels_interlis is not listed.

To Reproduce Exact steps to reproduce the behavior:

  1. Go to your qgis installation directory
  2. Click on 'OSGeo4W.bat'
  3. Start command
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots / data If applicable, add screenshots or data to help explain your problem.

Desktop (please complete the following information):

Additional context It looks like there is no entry in the metadata.txt _Only installed plugins that advertise hasProcessingProvider=yes in their metadata.txt file are recognized and can be activated or loaded by qgisprocess tool. (see https://docs.qgis.org/3.28/en/docs/user_manual/processing/standalone.html)

This shows how to add processing_provider to a plugin; https://docs.qgis.org/3.28/en/docs/pyqgis_developer_cookbook/processing.html#updating-a-plugin

The folder with processing providers e.g. the swmm function exist; https://github.com/QGEP/qgepplugin/tree/master/qgepplugin/processing_provider

But the qgep:extractlabels_interlis code is in another folder processing_algs: https://github.com/QGEP/qgepqwat2ili/blob/master/qgepqwat2ili/processing_algs/extractlabels_interlis.py

sjib commented 1 year ago

qgis_process plugins enable qgepplugin qgis_process or qgis_process-qgis-ltr plugins

Sometimes only C:\Program Files\QGIS 3.28.4\bin>qgis_process-qgis-ltr plugins works in the shell and C:\Program Files\QGIS 3.28.4\bin>qgis_process plugins

Seems to be depending how qgis was installed (standalone or with OSGeo4W setup. I am not sure if there is a difference or not. With the plugins command it can be checked what plugins are available The command listcan be used to get a list of all available providers and algorithms -> qgep:extractlabels_interlis is not listed.

sjib commented 1 year ago

@tproduit Any hint what would need to be adapted?