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

ajout inspireid #181

Merged
merged 1 commit into from
May 2, 2019
Merged
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
3 changes: 2 additions & 1 deletion scripts/plugin/2018/majic3_formatage_donnees.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ INSERT INTO [PREFIXE]parcelle
dparpi, ccoarp, gparnf, gparbat, parrev, gpardp, fviti, dnvoiri, dindic, ccovoi, ccoriv, ccocif, gpafpd, ajoutcoherence,
comptecommunal, pdl, voie,
cconvo, dvoilib, ccocomm, ccoprem, ccosecm, dnuplam, parcellefiliation, type_filiation,
ccoifp,
ccoifp, inspireid,
lot
)
SELECT
Expand Down Expand Up @@ -65,6 +65,7 @@ SELECT
SUBSTRING(tmp,178,1) AS type_filiation,

CASE WHEN trim(SUBSTRING(tmp,179,3))='' THEN NULL ELSE to_number(SUBSTRING(tmp,179,3),'999') END AS ccoifp,
REPLACE('FR'||SUBSTRING(tmp,1,15),' ','0') AS inspireid,

'[LOT]' as lot
FROM [PREFIXE]nbat WHERE SUBSTRING(tmp,20,2) ='10';
Expand Down
2 changes: 2 additions & 0 deletions scripts/plugin/commun_create_metier.sql
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ CREATE TABLE parcelle (
parcellefiliation text,
type_filiation text,
ccoifp integer,
inspireid text,
lot text
);

Expand Down Expand Up @@ -835,6 +836,7 @@ CREATE TABLE geo_parcelle
codm text,
creat_date date,
update_dat date,
inspireid text,
lot text,
ogc_fid serial NOT NULL
);
Expand Down
4 changes: 2 additions & 2 deletions scripts/plugin/edigeo_formatage_donnees.sql
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ DROP INDEX IF EXISTS [PREFIXE]geo_subdsect_object_rid_idx;
CREATE INDEX geo_subdsect_object_rid_idx ON [PREFIXE]geo_subdsect (object_rid);

INSERT INTO [PREFIXE]geo_parcelle
(geo_parcelle, annee, object_rid, idu, geo_section, geo_subdsect, supf, geo_indp, coar, tex, tex2, codm, creat_date, update_dat, geom, lot)
SELECT DISTINCT '[ANNEE]'||'[DEPDIR]'||p.idu, '[ANNEE]', p.object_rid, p.idu, '[ANNEE]'||'[DEPDIR]'||SUBSTRING(p.idu,1,8), foo.geo_subdsect, p.supf, p.indp, p.coar, p.tex, p.tex2, p.codm, to_date(to_char(p.creat_date,'00000000'), 'YYYYMMDD'), to_date(to_char(p.update_date,'00000000'), 'YYYYMMDD'), ST_Multi(ST_CollectionExtract(ST_MakeValid(p.geom),3)), '[LOT]'
(geo_parcelle, annee, object_rid, idu, geo_section, geo_subdsect, supf, geo_indp, coar, tex, tex2, codm, creat_date, update_dat, inspireid, geom, lot)
SELECT DISTINCT '[ANNEE]'||'[DEPDIR]'||p.idu, '[ANNEE]', p.object_rid, p.idu, '[ANNEE]'||'[DEPDIR]'||SUBSTRING(p.idu,1,8), foo.geo_subdsect, p.supf, p.indp, p.coar, p.tex, p.tex2, p.codm, to_date(to_char(p.creat_date,'00000000'), 'YYYYMMDD'), to_date(to_char(p.update_date,'00000000'), 'YYYYMMDD'), 'FR'||'[DEPDIR]'||p.idu, ST_Multi(ST_CollectionExtract(ST_MakeValid(p.geom),3)), '[LOT]'
FROM [PREFIXE]parcelle_id AS p
LEFT JOIN (
SELECT s.geo_section, s.geo_subdsect, r.de
Expand Down