Mercurial > dive4elements > river
changeset 9639:df668014016e
Merge
author | dnt_bjoernsen <d.tironi@bjoernsen.de> |
---|---|
date | Tue, 12 Nov 2019 09:24:07 +0100 |
parents | 6c1ebf2220f5 (current diff) eb32f75c65c3 (diff) |
children | 68d7b09a47b7 |
files | |
diffstat | 6 files changed, 50 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/ChannelFinder.java Thu Oct 31 17:37:53 2019 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/ChannelFinder.java Tue Nov 12 09:24:07 2019 +0100 @@ -80,7 +80,7 @@ if (channel != null) return new ChannelFinder(problems, channel); - problems.addProblem("channelfinder.empty"); + problems.addProblem("bundu.channelfinder.empty"); return null; }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backend/doc/schema/oracle_migrations/update_nachtrag_20.sql Tue Nov 12 09:24:07 2019 +0100 @@ -0,0 +1,16 @@ +--Neues Feld infrastructure.group_id + +SET AUTOCOMMIT ON; + +ALTER TABLE infrastructure ADD (group_id NUMBER(38,0)); + +UPDATE infrastructure SET group_id=annotation_type_id; + +ALTER TABLE infrastructure MODIFY (group_id NOT NULL); + +ALTER TABLE infrastructure ADD CONSTRAINT cInfrastructureGroupAnnoType + FOREIGN KEY (group_id) REFERENCES annotation_types; + +COMMENT ON COLUMN infrastructure.group_id IS 'Reference to the infrastructure type group'; + +COMMIT;
--- a/backend/src/main/java/org/dive4elements/river/importer/sinfo/SInfoImporter.java Thu Oct 31 17:37:53 2019 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/sinfo/SInfoImporter.java Tue Nov 12 09:24:07 2019 +0100 @@ -50,11 +50,11 @@ INFRASTRUCTURE("Infrastrukturen_BWaStr"), // CHANNEL("Zu_gewaehrleistende_Fahrrinnenverhaeltnisse"), // COLLISION_EINZEL("Grundberuehrungen" + File.separator + "Einzeljahre"), // - TKH_NATUR("Transportkoerperhoehen" + File.separator + "Naturmessungen"), // - TKH_BERECHNUNG("Transportkoerperhoehen" + File.separator + "Berechnungsergebnisse"), // + TKH_NATUR("Transportkoerperhoehen" + File.separator + TkhParser.GroupDirectory.MEASUREMENT.getDirName()), // + TKH_BERECHNUNG("Transportkoerperhoehen" + File.separator + TkhParser.GroupDirectory.CALCULATION.getDirName()), // FLOW_DEPTH("Modellierte_Datensaetze" + File.separator + "Fliesstiefen"), // - DEPTH_EVOLUTION_AKTUELL("Fliesstiefenentwicklung" + File.separator + "Bezug_aktueller_GlW"), // - DEPTH_EVOLUTION_ETAPPEN("Fliesstiefenentwicklung" + File.separator + "GlW-Etappen"); + DEPTH_EVOLUTION_AKTUELL("Fliesstiefenentwicklung" + File.separator + DepthEvolutionParser.GroupDirectory.AKTUELL.getDirName()), // + DEPTH_EVOLUTION_ETAPPEN("Fliesstiefenentwicklung" + File.separator + DepthEvolutionParser.GroupDirectory.ETAPPE.getDirName()); private final String dirname;
--- a/backend/src/main/java/org/dive4elements/river/importer/sinfo/parsers/DepthEvolutionParser.java Thu Oct 31 17:37:53 2019 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/sinfo/parsers/DepthEvolutionParser.java Tue Nov 12 09:24:07 2019 +0100 @@ -50,10 +50,10 @@ private static final Pattern META_OLD_WSP = Pattern.compile("^#\\sHistorische Wasserspiegellage:\\s*([^;]*).*", Pattern.CASE_INSENSITIVE); - private enum GroupDirectory { + public enum GroupDirectory { NONE(DepthEvolution.Group.NONE, ""), // - AKTUELL(DepthEvolution.Group.AKTUELL, "Bezug_aktueller_GLW"), // - ETAPPE(DepthEvolution.Group.ETAPPE, "GLW-Etappen"); + AKTUELL(DepthEvolution.Group.AKTUELL, "Bezug_aktueller_GlW"), // + ETAPPE(DepthEvolution.Group.ETAPPE, "GlW-Etappen"); private final DepthEvolution.Group group; private final String dirname;
--- a/backend/src/main/java/org/dive4elements/river/importer/sinfo/parsers/InfrastructureParser.java Thu Oct 31 17:37:53 2019 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/sinfo/parsers/InfrastructureParser.java Tue Nov 12 09:24:07 2019 +0100 @@ -41,7 +41,9 @@ private static final Logger log = Logger.getLogger(InfrastructureParser.class); - private static final Pattern META_TYPE = Pattern.compile("^#\\sInfrastruktur:\\s*([^;]*).*", Pattern.CASE_INSENSITIVE); + private static final Pattern META_GROUP = Pattern.compile("^#\\sInfrastruktur:\\s*([^;]*).*", Pattern.CASE_INSENSITIVE); + + private static final Pattern META_TYPE = Pattern.compile("^#\\sTyp\\/Bezeichnung:\\s*([^;]*).*", Pattern.CASE_INSENSITIVE); private static final Pattern META_PROVIDER = Pattern.compile("^#\\sDatenherkunft:\\s*([^;]*).*", Pattern.CASE_INSENSITIVE); @@ -116,7 +118,9 @@ @Override protected boolean handleMetaOther() { - if (handleMetaType()) + if (handleMetaGroup()) + return true; + else if (handleMetaType()) return true; else if (handleMetaProvider()) return true; @@ -128,6 +132,25 @@ return false; } + private boolean handleMetaGroup() { + final Matcher m = META_GROUP.matcher(this.currentLine); + if (m.matches()) { + this.metaPatternsMatched.add(META_GROUP); + if (this.river.getAnnotationClassifier() != null) { + final ImportAnnotationType group = this.river.getAnnotationClassifier().classifyDescription(m.group(1).trim(), + this.river.getAnnotationClassifier().getDefaultType()); + this.seriesHeader.setGroup(group); + log.info(String.format("Group name in file: '%s', will be assigned to database name '%s'", m.group(1).trim(), group.getName())); + } + else { + log.error("No annotation types file configured, cannot process group '" + m.group(1).trim() + "'"); + this.headerParsingState = ParsingState.STOP; + } + return true; + } + return false; + } + private boolean handleMetaType() { final Matcher m = META_TYPE.matcher(this.currentLine); if (m.matches()) {
--- a/backend/src/main/java/org/dive4elements/river/importer/sinfo/parsers/TkhParser.java Thu Oct 31 17:37:53 2019 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/sinfo/parsers/TkhParser.java Tue Nov 12 09:24:07 2019 +0100 @@ -57,7 +57,7 @@ private static final Pattern COLUMN_TITLE = Pattern.compile("Transportk((.)|(oe))rperh((.)|(oe))he\\s*\\((.+?)\\)\\s*\\[cm\\].*", Pattern.CASE_INSENSITIVE); - private enum GroupDirectory { + public enum GroupDirectory { NONE(Tkh.Group.NONE, ""), // CALCULATION(Tkh.Group.CALCULATION, "Berechnungsergebnisse"), // MEASUREMENT(Tkh.Group.MEASUREMENT, "Naturmessungen");