[Lada-commits] [PATCH 2 of 5] An Ort always has a location which is created from respective input

Wald Commits scm-commit at wald.intevation.org
Thu Dec 8 16:12:39 CET 2016


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1481204841 -3600
# Node ID aed3332cfacc086f50d4c267586c4a4ff84289f5
# Parent  6f206d8eab7eed6add4df6f51212901785335086
An Ort always has a location which is created from respective input.

diff -r 6f206d8eab7e -r aed3332cfacc db_schema/stammdaten_schema.sql
--- a/db_schema/stammdaten_schema.sql	Thu Dec 08 14:30:35 2016 +0100
+++ b/db_schema/stammdaten_schema.sql	Thu Dec 08 14:47:21 2016 +0100
@@ -431,7 +431,7 @@
     koord_y_extern character varying(22) NOT NULL,
     hoehe_land real,
     letzte_aenderung timestamp without time zone DEFAULT now(),
-    geom public.geometry(Point,4326),
+    geom public.geometry(Point,4326) NOT NULL,
     shape public.geometry(MultiPolygon,4326),
     ort_typ smallint REFERENCES ort_typ,
     kurztext character varying(15) NOT NULL,
diff -r 6f206d8eab7e -r aed3332cfacc src/main/java/de/intevation/lada/rest/stamm/OrtService.java
--- a/src/main/java/de/intevation/lada/rest/stamm/OrtService.java	Thu Dec 08 14:30:35 2016 +0100
+++ b/src/main/java/de/intevation/lada/rest/stamm/OrtService.java	Thu Dec 08 14:47:21 2016 +0100
@@ -25,6 +25,7 @@
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.UriInfo;
 
+import de.intevation.lada.factory.OrtFactory;
 import de.intevation.lada.model.stammdaten.Filter;
 import de.intevation.lada.model.stammdaten.Ort;
 import de.intevation.lada.util.annotation.AuthorizationConfig;
@@ -90,6 +91,9 @@
     @AuthorizationConfig(type=AuthorizationType.HEADER)
     private Authorization authorization;
 
+    @Inject
+    private OrtFactory ortFactory;
+
     /**
      * Get all SOrt objects.
      * <p>
@@ -265,6 +269,7 @@
             repository.filterPlain(builder.getQuery(), "stamm");
         if (orte.isEmpty() ||
             orte.get(0).getId() == ort.getId()) {
+            ortFactory.transformCoordinates(ort);
             return repository.create(ort, "stamm");
         }
         return new Response(false, 672, null);


More information about the Lada-commits mailing list