Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrections suite à review #570

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions database/cadastrapp_load_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ echo ""
# lecture du fichier de configuration des connexions
. config.sh

# verifie si le mode silencieux est activé
silentMode=False
while [[ "$#" -gt 0 ]]
do
case $1 in
-s|--silent)
silentMode=True
;;
-*|--*)
echo "Invalid option: $1"
;;
esac
shift
done

if [ "$uniqueDB" = True ] ; then
echo " 1 seule base de données sera utilisée : $cadastrappDBName sur la machine $cadastrappDBHost"
echo " schéma des données cadastre QGIS : $qgisDBSchema"
Expand All @@ -32,9 +47,11 @@ else
exit 1
fi

echo ""
read -p " Si ces infos sont exactes : appuyer sur la touche [Entrée] sinon faire ctrl + C pour arrêter."
echo ""
if [ "$silentMode" = True ] ; then
echo ""
read -p " Si ces infos sont exactes : appuyer sur la touche [Entrée] sinon faire ctrl + C pour arrêter."
echo ""
fi


#
Expand Down
23 changes: 20 additions & 3 deletions database/cadastrapp_update_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ echo ""
# lecture du fichier de configuration des connexions
. config.sh

# verifie si le mode silencieux est activé
silentMode=False
while [[ "$#" -gt 0 ]]
do
case $1 in
-s|--silent)
silentMode=True
;;
-*|--*)
echo "Invalid option: $1"
;;
esac
shift
done

if [ "$uniqueDB" = True ] ; then
echo " 1 seule base de données sera utilisée : $cadastrappDBName sur la machine $cadastrappDBHost"
echo " schéma des données cadastre QGIS : $qgisDBSchema"
Expand All @@ -32,9 +47,11 @@ else
exit 1
fi

echo ""
read -p " Si ces infos sont exactes : appuyer sur la touche [Entrée] sinon faire ctrl + C pour arrêter."
echo ""
if [ "$silentMode" = True ] ; then
echo ""
read -p " Si ces infos sont exactes : appuyer sur la touche [Entrée] sinon faire ctrl + C pour arrêter."
echo ""
fi


#
Expand Down
2 changes: 2 additions & 0 deletions database/create_tables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ replaceAndLaunch sql/tables/prop_dmatgm.sql
replaceAndLaunch sql/tables/prop_type_filiation.sql
replaceAndLaunch sql/tables/prop_bati_detent.sql

replaceAndLaunch sql/tables/groupe_autorisation.sql

echo " Fait"
4 changes: 2 additions & 2 deletions database/create_views.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ echo ""

if [ "$uniqueDB" = True ] ; then

replaceAndLaunch sql/vues/commune.sql
replaceAndLaunch sql/vues/Commune.sql
replaceAndLaunch sql/vues/Section.sql
replaceAndLaunch sql/vues/Parcelle.sql
replaceAndLaunch sql/vues/Proprietaire.sql
Expand All @@ -26,7 +26,7 @@ if [ "$uniqueDB" = True ] ; then

elif [ "$uniqueDB" = False ] ; then

replaceAndLaunch sql/vues_dblink/commune.sql
replaceAndLaunch sql/vues_dblink/Commune.sql
replaceAndLaunch sql/vues_dblink/Section.sql
replaceAndLaunch sql/vues_dblink/Parcelle.sql
replaceAndLaunch sql/vues_dblink/Proprietaire.sql
Expand Down
26 changes: 26 additions & 0 deletions database/sql/tables/groupe_autorisation.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
-- Table: cadastreapp_qgis.groupe_autorisation

-- DROP TABLE #schema_cadastrapp.groupe_autorisation;

CREATE TABLE #schema_cadastrapp.groupe_autorisation
(
id serial NOT NULL, -- Id d'indentification de lignes
idgroup character varying(50), -- Identifiant du groupe LDAP devant être filtré
cgocommune character varying(6), -- Code commune INSEE
ccodep character varying(3), -- Code département à mettre en relation avec le code commune
CONSTRAINT groupe_autorisation_pk PRIMARY KEY (id ),
CONSTRAINT "groupe_autorisation_UK" UNIQUE (cgocommune , ccodep , idgroup )
)
WITH (
OIDS=FALSE
);
ALTER TABLE #schema_cadastrapp.groupe_autorisation
OWNER TO #user_cadastrapp;

COMMENT ON TABLE #schema_cadastrapp.groupe_autorisation IS 'Table de correlation entre les groupes LDAP et les droits géographiques';

COMMENT ON COLUMN #schema_cadastrapp.groupe_autorisation.id IS 'Id d''indentification de lignes';
COMMENT ON COLUMN #schema_cadastrapp.groupe_autorisation.idgroup IS 'Identfiant du groupe LDAP devant être filtré';
COMMENT ON COLUMN #schema_cadastrapp.groupe_autorisation.cgocommune IS 'Code commune INSEE';
COMMENT ON COLUMN #schema_cadastrapp.groupe_autorisation.ccodep IS 'Code département à mettre en relation avec le code commune';

2 changes: 1 addition & 1 deletion database/sql/vues/Parcelle.sql
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ CREATE MATERIALIZED VIEW #schema_cadastrapp.parcelledetails AS
p2.surfb
from #DBSchema_qgis.parcelle
full outer join #DBSchema_qgis.geo_parcelle on parcelle.parcelle = geo_parcelle.geo_parcelle
left join cadastrapp.v_parcelle_surfc p2 on parcelle.parcelle=p2.parcelle
left join #schema_cadastrapp.v_parcelle_surfc p2 on parcelle.parcelle=p2.parcelle
) AS parcelledetails ;

ALTER TABLE #schema_cadastrapp.parcelleDetails OWNER TO #user_cadastrapp;
Expand Down
2 changes: 1 addition & 1 deletion database/sql/vues/Proprietaire.sql
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ CREATE MATERIALIZED VIEW #schema_cadastrapp.proprietaire AS
WHEN gtoper = '2' THEN trim(ddenom)
END AS app_nom_usage,
CASE
WHEN gtoper = '1' THEN COALESCE(rtrim(dqualp),'')||' '||COALESCE(rtrim(dnomlp),'')||' '||COALESCE(rtrim(dprnlp),'')
WHEN gtoper = ''1'' THEN COALESCE(rtrim(dqualp),'''')||'' ''||REPLACE(rtrim(ddenom),''/'','' '')
WHEN gtoper = '2' THEN trim(ddenom)
END AS app_nom_naissance,
prop_ccodro.ccodro,
Expand Down
2 changes: 1 addition & 1 deletion database/sql/vues_dblink/Proprietaire.sql
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ CREATE MATERIALIZED VIEW #schema_cadastrapp.proprietaire AS
WHEN gtoper = ''2'' THEN trim(ddenom)
END AS app_nom_usage,
CASE
WHEN gtoper = ''1'' THEN COALESCE(rtrim(dqualp),'''')||'' ''||COALESCE(rtrim(dnomlp),'''')||'' ''||COALESCE(rtrim(dprnlp),'''')
WHEN gtoper = ''1'' THEN COALESCE(rtrim(dqualp),'''')||'' ''||REPLACE(rtrim(ddenom),''/'','' '')
WHEN gtoper = ''2'' THEN trim(ddenom)
END AS app_nom_naissance,
prop_ccodro.ccodro,
Expand Down
2 changes: 1 addition & 1 deletion database/tables_request.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test=`PGPASSWORD=$cadastrappDBPassword psql -h $cadastrappDBHost -p $cadastrappD
--set ON_ERROR_STOP=on \
--no-align \
-t \
--field-separator ' ' `
--field-separator ' ' &>/dev/null`

#echo "test = $test"

Expand Down