arno974 / lizmap-altiProfil

Module Lizmap permettant la création d'un profil
6 stars 11 forks source link

Hanging Profile #22

Closed PhVdV closed 1 year ago

PhVdV commented 1 year ago

Cher Dev Team AltiProfil,

Nous utilisons notre propre MNT dans une BD Postgis afin de créer le profil.

Les fichiers profiles.ini.php et altProfil.inin.php ont été édités en conséquence.

Cependant, lors de l'utilisation de l'outil, ce dernier reste suspendu:

image

Plusieurs variantes on été testées sans succès.

Auriez-vous une idée de où proviendrait le problème?

Lizmap 3.4.4 altiProfil 0.2.3 Qgis 3.18.1 DB PostGIS/Postrgres OS Debian Ubuntu

Merci pour votre aide et votre temps

Philippe Vandevondele

arno974 commented 1 year ago

Bonjour,

Sans plus d'information il sera difficile de répondre. Est-ce qu'il y a un message dans les logs de Lizmap ou d'Apache ?

Arnaud

On Wed, Sep 28, 2022 at 4:33 PM PhVdV @.***> wrote:

Cher Dev Team AltiProfil,

Nous utilisons notre propre MNT dans une BD Postgis afin de créer le profil.

Les fichiers profiles.ini.php et altProfil.inin.php ont été édités en conséquence.

Cependant, lors de l'utilisation de l'outil, ce dernier reste suspendu:

[image: image] https://user-images.githubusercontent.com/72783461/192778486-1054c298-a071-449c-9868-0712f30770d8.png

Plusieurs variantes on été testées sans succès.

Auriez-vous une idée de où proviendrait le problème?

Lizmap 3.4.4 altiProfil 0.2.3 Qgis 3.18.1 DB PostGIS/Postrgres OS Debian Ubuntu

Merci pour votre aide et votre temps

Philippe Vandevondele

— Reply to this email directly, view it on GitHub https://github.com/arno974/lizmap-altiProfil/issues/22, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADH2G76FYDDRZ5RHVZ2QD3WAQ3ITANCNFSM6AAAAAAQXXOK3A . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

Arnaud Vandecasteele

PhVdV commented 1 year ago

Bonjour Arnaud,

Voici le message du log Lizmap:

2022-09-26 14:22:47 10.200.201.224  default No altimetrie provider define in the configuration file
2022-09-26 15:14:42 10.200.201.224  default No altimetrie provider define in the configuration file
2022-09-27 16:42:28 10.90.1.129 default No altimetrie provider define in the configuration file
2022-09-28 10:27:12 10.200.201.127  default AltiProfil :: Wrong or No Alti Provider defined (config )
2022-09-28 10:27:13 10.200.201.127  default AltiProfil :: Wrong or No Alti Provider defined (config )
2022-09-28 10:27:13 10.200.201.127  default AltiProfil :: Wrong or No Alti Provider defined (config )

Le fichier altiProfil.ini.php comprend:

[altiProfil]
altisource=pgsql
database=nom de notre DB
host=adresse IP
port=5432
user=nom de l'utilisateur
search_path=Nom de notre schema

;si cas database
altiProfileProvider=database
altiProfileTable=MNT_EBLG3857
srid=3857
; profilUnit = PERCENT or DEGREES - choix de l'unité de calcul du profil
profilUnit=PERCENT
; dock panel = dock or minidock or rightdock
dock=dock

;si cas IGN
altiProfileProvider=database
;ignServiceKey=
;ignServiceUrl=

main=
altiresolution=20
database=
ign=

Notre fichier profiles.ini.php comprend:

[jdb:altiProfil]
driver=pgsql
database=nom de notre DB
host=adresse IP de notre DB
port=5432
user=nom du user
password= mot de passe de notre user
search_path=nom du shema

Est-ce que cela peut aider?

Merci pour votre aide et votre temps.

Très bonne journée

Philippe

arno974 commented 1 year ago

Votre configuration semble bonne, mais le message d'erreur semble indiquer que le paramètre altiProfileProvider n'est pas correctement défini. Il doit y avoir quelque chose dans votre configuration qui pose problème.

Arnaud

On Thu, Sep 29, 2022 at 11:48 AM PhVdV @.***> wrote:

Bonjour Arnaud,

Voici le message du log Lizmap:

2022-09-26 14:22:47 10.200.201.224 default No altimetrie provider define in the configuration file 2022-09-26 15:14:42 10.200.201.224 default No altimetrie provider define in the configuration file 2022-09-27 16:42:28 10.90.1.129 default No altimetrie provider define in the configuration file 2022-09-28 10:27:12 10.200.201.127 default AltiProfil :: Wrong or No Alti Provider defined (config ) 2022-09-28 10:27:13 10.200.201.127 default AltiProfil :: Wrong or No Alti Provider defined (config ) 2022-09-28 10:27:13 10.200.201.127 default AltiProfil :: Wrong or No Alti Provider defined (config )

Le fichier altiProfil.ini.php comprend:

[altiProfil] altisource=pgsql database=nom de notre DB host=adresse IP port=5432 user=nom de l'utilisateur search_path=Nom de notre schema

;si cas database altiProfileProvider=database altiProfileTable=MNT_EBLG3857 srid=3857 ; profilUnit = PERCENT or DEGREES - choix de l'unité de calcul du profil profilUnit=PERCENT ; dock panel = dock or minidock or rightdock dock=dock

;si cas IGN altiProfileProvider=database ;ignServiceKey= ;ignServiceUrl=

main= altiresolution=20 database= ign=

Notre fichier profiles.ini.php comprend:

[jdb:altiProfil] driver=pgsql database=nom de notre DB host=adresse IP de notre DB port=5432 user=nom du user password= mot de passe de notre user search_path=nom du shema

Est-ce que cela peut aider?

Merci pour votre aide et votre temps.

Très bonne journée

Philippe

— Reply to this email directly, view it on GitHub https://github.com/arno974/lizmap-altiProfil/issues/22#issuecomment-1261897286, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADH2G6VJJFS4SXUKJCITLDWAVCTJANCNFSM6AAAAAAQXXOK3A . You are receiving this because you commented.Message ID: @.***>

--

Arnaud Vandecasteele

PhVdV commented 1 year ago

Le fichiers errors.log décrit une erreur:

2022-09-30 15:34:06 10.90.1.129 error   2022-09-30 15:34:06 [403]   invalid query (ERROR:  function st_makepoint(numeric, numeric) does not exist
LINE 7: ...                          ST_Transform(ST_SetSRID(ST_MakePoi...
                                                             ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.(
            WITH
                line AS(
                    -- From an arbitrary line
                    SELECT
                        ST_MakeLine(
                            ST_Transform(ST_SetSRID(ST_MakePoint(5.450965, 50.644844),4326), 3857),
                            ST_Transform(ST_SetSRID(ST_MakePoint(5.471050, 50.635046),4326), 3857)
                        )
                    AS geom
                ), 
                linemesure AS(
                    -- Add a mesure dimension to extract steps
                    SELECT
                        ST_AddMeasure(line.geom, 0, ST_Length(line.geom)) as linem,
                        generate_series(
                            0,
                            ST_Length(line.geom)::int,
                            --for very long line we reduce the steps
                            CASE
                                WHEN ST_Length(line.geom)::int < 1000 THEN 2
                                ELSE 2*5
                            END
                        ) as i,
                        CASE
                            WHEN ST_Length(line.geom)::int < 1000 THEN 2
                            ELSE 2*5
                        END as resolution
                    FROM line
                ), 
                points2d AS (
                    SELECT ST_GeometryN(ST_LocateAlong(linem, i), 1) AS geom, resolution FROM linemesure
                ),
                cells AS (
                    -- Get DEM elevation for each
                    SELECT 
                        p.geom AS geom, 
                        ST_Value(Urba.MNT_EBLG3857.rast, 1, p.geom) AS val,                      
                        resolution
                    FROM Urba.MNT_EBLG3857, points2d p
                    WHERE ST_Intersects(Urba.MNT_EBLG3857.rast, p.geom)
                ),           
                -- Instantiate 3D points
                points3d AS (
                    SELECT ST_SetSRID(
                                ST_MakePoint(ST_X(geom), ST_Y(geom), val),
                                3857
                            ) AS geom, resolution FROM cells
                ),
                line3D AS(
                    SELECT ST_MakeLine(geom)as geom, MAX(resolution) as resolution FROM points3d
                ),
                xz AS(
                    SELECT (ST_DumpPoints(geom)).geom AS geom,
                    ST_StartPoint(geom) AS origin, resolution
                    FROM line3D
                )
            -- Build 3D line from 3D points
            SELECT ST_distance(origin, geom) AS x, ST_Z(geom) as y, ST_X(geom) as lon, ST_Y(geom) as lat, resolution FROM xz))  /opt/www/lizmap-web-client-3.4.4/lib/jelix/plugins/db/pgsql/pgsql.dbconnection.php  187

Comment la résoudre?

Philippe

arno974 commented 1 year ago

Bonjour,

Êtes-vous certains que l'extension PostGIS soit installée ? L'erreur provient d'une fonction manquante qui est une fonction classique de PostGIS.

PhVdV commented 1 year ago

Bonjour,

Effectivement, cela aurait pu, cependant cette BD PostGIS est utilisée depuis plus de deux ans pour y stocker des données vectorielles et rasters.

Philippe

Gustry commented 1 year ago

Duplicate of #12 This kind of error is often linked to a wrong "search path" when the function is called.

PhVdV commented 1 year ago

Bonjour Gustry, il y a bien un paramètre pour le search_path qui pointe sur le schéma PostGIS dans lequel se trouve le MNT du fichier profiles.ini.php

Gustry commented 1 year ago

Can you try search_path=YOUR_SCHEMA,public ?

PhVdV commented 1 year ago

without success search_path=MY_SCHEMA, public or search_path="MY_SCHEMA", "public"

PhVdV commented 1 year ago

Est-ce que Lizmap ou le plugin Alti ne doivent-ils pas avoir un droit spécifique dans la DB PostGIS?

arno974 commented 1 year ago

Non pas de droit spécifique mise à part que l'utilisateur (au sens BD du terme) qui y accède doit pouvoir lire les données et aussi accéder aux fonctions PostGIS.

Gustry commented 1 year ago

Je ne connais pas la gestion du "search_path" dans un module, mais le problème est la.

arno974 commented 1 year ago

Dans le search_path, il faut mettre le nom du schema dans lequel la table raster est stockée (si différent du schema default)

PhVdV commented 1 year ago

Le nom du schema se note avec ou sans double quote?

arno974 commented 1 year ago

sans double quote, ni simple quote exemple : search_path=public,raster_schema

arno974 commented 1 year ago

No more activities