changeset 1194:289edf060550

Removed table de_vg and added verwaltungsgrenze.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 29 Nov 2016 15:57:09 +0100
parents 00323d9e642c
children 768a4c957a18
files db_schema/stammdaten_schema.sql src/main/java/de/intevation/lada/model/stammdaten/DeVg.java src/main/java/de/intevation/lada/model/stammdaten/Verwaltungsgrenze.java src/main/java/de/intevation/lada/validation/rules/ort/CoordinatesInVE.java
diffstat 4 files changed, 64 insertions(+), 232 deletions(-) [+]
line wrap: on
line diff
--- a/db_schema/stammdaten_schema.sql	Tue Nov 29 15:54:48 2016 +0100
+++ b/db_schema/stammdaten_schema.sql	Tue Nov 29 15:57:09 2016 +0100
@@ -167,7 +167,7 @@
 CREATE TABLE verwaltungsgrenze (
     id serial PRIMARY KEY,
     gem_id character varying(8) NOT NULL,
-    shape public.geometry(MultiPolygon)
+    shape public.geometry(MultiPolygon, 4326)
 );
 
 CREATE TABLE netz_betreiber (
@@ -236,26 +236,6 @@
 );
 CREATE TRIGGER letzte_aenderung_datensatz_erzeuger BEFORE UPDATE ON datensatz_erzeuger FOR EACH ROW EXECUTE PROCEDURE update_letzte_aenderung();
 
-CREATE TABLE de_vg (
-    id serial PRIMARY KEY,
-    use double precision,
-    rs character varying(12),
-    gf double precision,
-    rau_rs character varying(12),
-    gen character varying(50),
-    des character varying(75),
-    isn double precision,
-    bemerk character varying(75),
-    nambild character varying(16),
-    ags character varying(12),
-    rs_alt character varying(20),
-    wirksamkei date,
-    debkg_id character varying(16),
-    length numeric,
-    shape_area numeric,
-    geom public.geometry(MultiPolygon,4326)
-);
-
 
 CREATE TABLE deskriptor_umwelt (
     id serial PRIMARY KEY,
--- a/src/main/java/de/intevation/lada/model/stammdaten/DeVg.java	Tue Nov 29 15:54:48 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,205 +0,0 @@
-package de.intevation.lada.model.stammdaten;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.util.Date;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-
-import com.vividsolutions.jts.geom.MultiPolygon;
-
-
-/**
- * The persistent class for the de_vg database table.
- * 
- */
-@Entity
-@Table(name="de_vg")
-public class DeVg implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    @Id
-    private Integer id;
-
-    private String ags;
-
-    private String bemerk;
-
-    @Column(name="debkg_id")
-    private String debkgId;
-
-    private String des;
-
-    private String gen;
-
-    private MultiPolygon geom;
-
-    private double gf;
-
-    private double isn;
-
-    private BigDecimal length;
-
-    private String nambild;
-
-    @Column(name="rau_rs")
-    private String rauRs;
-
-    private String rs;
-
-    @Column(name="rs_alt")
-    private String rsAlt;
-
-    @Column(name="shape_area")
-    private BigDecimal shapeArea;
-
-    private double use;
-
-    @Temporal(TemporalType.DATE)
-    private Date wirksamkei;
-
-    public DeVg() {
-    }
-
-    public Integer getId() {
-        return this.id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getAgs() {
-        return this.ags;
-    }
-
-    public void setAgs(String ags) {
-        this.ags = ags;
-    }
-
-    public String getBemerk() {
-        return this.bemerk;
-    }
-
-    public void setBemerk(String bemerk) {
-        this.bemerk = bemerk;
-    }
-
-    public String getDebkgId() {
-        return this.debkgId;
-    }
-
-    public void setDebkgId(String debkgId) {
-        this.debkgId = debkgId;
-    }
-
-    public String getDes() {
-        return this.des;
-    }
-
-    public void setDes(String des) {
-        this.des = des;
-    }
-
-    public String getGen() {
-        return this.gen;
-    }
-
-    public void setGen(String gen) {
-        this.gen = gen;
-    }
-
-    public MultiPolygon getGeom() {
-        return this.geom;
-    }
-
-    public void setGeom(MultiPolygon geom) {
-        this.geom = geom;
-    }
-
-    public double getGf() {
-        return this.gf;
-    }
-
-    public void setGf(double gf) {
-        this.gf = gf;
-    }
-
-    public double getIsn() {
-        return this.isn;
-    }
-
-    public void setIsn(double isn) {
-        this.isn = isn;
-    }
-
-    public BigDecimal getLength() {
-        return this.length;
-    }
-
-    public void setLength(BigDecimal length) {
-        this.length = length;
-    }
-
-    public String getNambild() {
-        return this.nambild;
-    }
-
-    public void setNambild(String nambild) {
-        this.nambild = nambild;
-    }
-
-    public String getRauRs() {
-        return this.rauRs;
-    }
-
-    public void setRauRs(String rauRs) {
-        this.rauRs = rauRs;
-    }
-
-    public String getRs() {
-        return this.rs;
-    }
-
-    public void setRs(String rs) {
-        this.rs = rs;
-    }
-
-    public String getRsAlt() {
-        return this.rsAlt;
-    }
-
-    public void setRsAlt(String rsAlt) {
-        this.rsAlt = rsAlt;
-    }
-
-    public BigDecimal getShapeArea() {
-        return this.shapeArea;
-    }
-
-    public void setShapeArea(BigDecimal shapeArea) {
-        this.shapeArea = shapeArea;
-    }
-
-    public double getUse() {
-        return this.use;
-    }
-
-    public void setUse(double use) {
-        this.use = use;
-    }
-
-    public Date getWirksamkei() {
-        return this.wirksamkei;
-    }
-
-    public void setWirksamkei(Date wirksamkei) {
-        this.wirksamkei = wirksamkei;
-    }
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/intevation/lada/model/stammdaten/Verwaltungsgrenze.java	Tue Nov 29 15:57:09 2016 +0100
@@ -0,0 +1,57 @@
+package de.intevation.lada.model.stammdaten;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import com.vividsolutions.jts.geom.MultiPolygon;
+
+
+/**
+ * The persistent class for the verwaltungsgrenze database table.
+ * 
+ */
+@Entity
+@Table(name="verwaltungsgrenze")
+public class Verwaltungsgrenze implements Serializable {
+	private static final long serialVersionUID = 1L;
+
+	@Id
+	private Integer id;
+
+	@Column(name="gem_id")
+	private String gemId;
+
+	private MultiPolygon shape;
+
+	public Verwaltungsgrenze() {
+	}
+
+	public Integer getId() {
+		return this.id;
+	}
+
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	public String getGemId() {
+		return this.gemId;
+	}
+
+	public void setGemId(String gemId) {
+		this.gemId = gemId;
+	}
+
+	public MultiPolygon getShape() {
+		return this.shape;
+	}
+
+	public void setShape(MultiPolygon shape) {
+		this.shape = shape;
+	}
+
+}
--- a/src/main/java/de/intevation/lada/validation/rules/ort/CoordinatesInVE.java	Tue Nov 29 15:54:48 2016 +0100
+++ b/src/main/java/de/intevation/lada/validation/rules/ort/CoordinatesInVE.java	Tue Nov 29 15:57:09 2016 +0100
@@ -17,9 +17,9 @@
 import com.vividsolutions.jts.geom.PrecisionModel;
 
 import de.intevation.lada.model.land.Ortszuordnung;
-import de.intevation.lada.model.stammdaten.DeVg;
 import de.intevation.lada.model.stammdaten.Ort;
 import de.intevation.lada.model.stammdaten.Verwaltungseinheit;
+import de.intevation.lada.model.stammdaten.Verwaltungsgrenze;
 import de.intevation.lada.util.annotation.RepositoryConfig;
 import de.intevation.lada.util.data.QueryBuilder;
 import de.intevation.lada.util.data.Repository;
@@ -65,11 +65,11 @@
             return violation;
         }
         Verwaltungseinheit ve = ((List<Verwaltungseinheit>)ver.getData()).get(0);
-        QueryBuilder<DeVg> vg =
-            new QueryBuilder<DeVg>(repository.entityManager("stamm"), DeVg.class);
+        QueryBuilder<Verwaltungsgrenze> vg =
+            new QueryBuilder<Verwaltungsgrenze>(repository.entityManager("stamm"), Verwaltungsgrenze.class);
         vg.and("ags", ve.getId());
         Response rvg = repository.filter(vg.getQuery(), "stamm");
-        List<DeVg> vgs = (List<DeVg>)rvg.getData();
+        List<Verwaltungsgrenze> vgs = (List<Verwaltungsgrenze>)rvg.getData();
         if (vgs == null || vgs.isEmpty()) {
             Violation violation = new Violation();
             violation.addWarning("verwaltungseinheit", 653);
@@ -81,8 +81,8 @@
         GeometryFactory gf = new GeometryFactory(new PrecisionModel(PrecisionModel.FLOATING), 4326);
         Point p = gf.createPoint(c);
         boolean hit = false;
-        for (DeVg singlevg : vgs) {
-            if(singlevg.getGeom().contains(p)) {
+        for (Verwaltungsgrenze singlevg : vgs) {
+            if(singlevg.getShape().contains(p)) {
                 hit = true;
             }
         }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)