diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/.classpath b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/.classpath new file mode 100644 index 00000000..a52eb822 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/.project b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/.project new file mode 100644 index 00000000..dd254f27 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/.project @@ -0,0 +1,23 @@ + + + org.eclipse.sensinact.gateway.core.geo-json.model.test + + + + + + org.eclipse.jdt.core.javabuilder + + + + + bndtools.core.bndbuilder + + + + + + org.eclipse.jdt.core.javanature + bndtools.core.bndnature + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/.settings/org.eclipse.core.resources.prefs b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000..cbe1c3c4 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +encoding//.settings/org.eclipse.core.resources.prefs=UTF-8 +encoding//src/org/eclipse/sensinact/gateway/core/geo_json/model/test/GeoJsonTest.java=UTF-8 +encoding/=UTF-8 +encoding/bnd.bnd=UTF-8 +encoding/build.gradle=UTF-8 +encoding/test.bndrun=UTF-8 diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/.settings/org.eclipse.jdt.core.prefs b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..3d1fdb61 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,11 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=17 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=17 diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/bnd.bnd b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/bnd.bnd new file mode 100644 index 00000000..e4d04ea9 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/bnd.bnd @@ -0,0 +1,19 @@ +Test-Cases: ${classes;HIERARCHY_INDIRECTLY_ANNOTATED;org.junit.platform.commons.annotation.Testable;CONCRETE} + +-library: enableOSGi-Test,\ + enable-emf + +# sets the usually required buildpath using the bnd library, you can extend it with the normal -buildpath to your liking +-buildpath: \ + org.osgi.framework;version=latest,\ + org.eclipse.sensinact.gateway.core.geo-json.model;version=snapshot,\ + org.gecko.emf.util.annotations;version=latest,\ + org.eclipse.emfcloud.emfjson-jackson + +Private-Package: org.eclipse.sensinact.gateway.core.geo_json.model.test + +Bundle-Version: 1.0.0.SNAPSHOT + +# Sometimes without DynamicImport Mockito will not find certain classes +#DynamicImport-Package: *,\ + \ No newline at end of file diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/build.gradle b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/build.gradle new file mode 100644 index 00000000..d3adac90 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/build.gradle @@ -0,0 +1,8 @@ + +def resolveTask = tasks.named("resolve.test") { + outputBndrun = layout.buildDirectory.file("test.bndrun") +} + +tasks.named("testOSGi") { + bndrun = resolveTask.flatMap { it.outputBndrun } +} diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/src/org/eclipse/sensinact/gateway/core/geo_json/model/test/GeoJsonTest.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/src/org/eclipse/sensinact/gateway/core/geo_json/model/test/GeoJsonTest.java new file mode 100644 index 00000000..9f85cb50 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/src/org/eclipse/sensinact/gateway/core/geo_json/model/test/GeoJsonTest.java @@ -0,0 +1,375 @@ +/** + * Copyright (c) 2012 - 2023 Data In Motion and others. + * All rights reserved. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Data In Motion - initial API and implementation + */ +package org.eclipse.sensinact.gateway.core.geo_json.model.test; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emfcloud.jackson.annotations.EcoreTypeInfo; +import org.eclipse.emfcloud.jackson.resource.JsonResource; +import org.eclipse.sensinact.gateway.core.geojson.Coordinates; +import org.eclipse.sensinact.gateway.core.geojson.Feature; +import org.eclipse.sensinact.gateway.core.geojson.Hole; +import org.eclipse.sensinact.gateway.core.geojson.LineString; +import org.eclipse.sensinact.gateway.core.geojson.MultiPoint; +import org.eclipse.sensinact.gateway.core.geojson.Point; +import org.eclipse.sensinact.gateway.core.geojson.Polygon; +import org.eclipse.sensinact.gateway.core.geojson.Ring; +import org.eclipse.sensinact.gateway.core.geojson.impl.CoordinatesImpl; +import org.eclipse.sensinact.gateway.core.geojson.impl.FeatureImpl; +import org.eclipse.sensinact.gateway.core.geojson.impl.HoleImpl; +import org.eclipse.sensinact.gateway.core.geojson.impl.LineStringImpl; +import org.eclipse.sensinact.gateway.core.geojson.impl.MultiPointImpl; +import org.eclipse.sensinact.gateway.core.geojson.impl.PointImpl; +import org.eclipse.sensinact.gateway.core.geojson.impl.PolygonImpl; +import org.eclipse.sensinact.gateway.core.geojson.impl.RingImpl; +import org.gecko.emf.json.annotation.RequireEMFJson; +import org.gecko.emf.json.constants.EMFJs; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.osgi.test.common.annotation.InjectService; +import org.osgi.test.junit5.context.BundleContextExtension; +import org.osgi.test.junit5.service.ServiceExtension; + +//import org.mockito.Mock; +//import org.mockito.junit.jupiter.MockitoExtension; + +/** + * See documentation here: + * https://github.com/osgi/osgi-test + * https://github.com/osgi/osgi-test/wiki + * Examples: https://github.com/osgi/osgi-test/tree/main/examples + */ +@ExtendWith(BundleContextExtension.class) +@ExtendWith(ServiceExtension.class) +@RequireEMFJson +public class GeoJsonTest { + + @Test + public void point(@InjectService ResourceSet set) throws IOException { + System.err.println("Running Test Point"); + + Point point = new PointImpl(); + Coordinates coords = new CoordinatesImpl(); + coords.setLatitude(12); + coords.setLongitude(52); + coords.setElevation(120); + + point.setCoordinates(coords); + + JsonResource resource = (JsonResource) set.createResource(URI.createURI("test.json")); + resource.getContents().add(point); + Map map = new HashMap<>(); + map.put(EMFJs.OPTION_SERIALIZE_DEFAULT_VALUE, true); + map.put(EMFJs.OPTION_TYPE_FIELD, "type"); + map.put(EMFJs.OPTION_TYPE_USE, EcoreTypeInfo.USE.NAME); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + resource.save(baos, map); + + System.out.println(new String(baos.toByteArray())); + + + String test = """ + { + "type" : "Point", + "coordinates" : [ 52.0, 12.0, 120.0 ] +} + """; + + System.err.println("Trying to load Point"); + + JsonResource loadResource = (JsonResource) set.createResource(URI.createURI("test2.json")); + loadResource.load(new ByteArrayInputStream(test.getBytes()), map); + + System.err.println(loadResource.getContents().isEmpty()); + assertFalse(loadResource.getContents().isEmpty()); + Point result = (Point) loadResource.getContents().get(0); + System.err.println(result.getCoordinates()); + } + + @Test + public void pointWithBoundingBox(@InjectService ResourceSet set) throws IOException { + System.err.println("Running Test Point with BoundingBox"); + + Point point = new PointImpl(); + Coordinates coords = new CoordinatesImpl(); + coords.setLatitude(12); + coords.setLongitude(52); + coords.setElevation(120); + + point.setCoordinates(coords); + + point.getBoundingBox().add(EcoreUtil.copy(coords)); + point.getBoundingBox().add(EcoreUtil.copy(coords)); + + JsonResource resource = (JsonResource) set.createResource(URI.createURI("test.json")); + resource.getContents().add(point); + Map map = new HashMap<>(); + map.put(EMFJs.OPTION_SERIALIZE_DEFAULT_VALUE, true); + map.put(EMFJs.OPTION_TYPE_FIELD, "type"); + map.put(EMFJs.OPTION_TYPE_USE, EcoreTypeInfo.USE.NAME); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + resource.save(baos, map); + + System.out.println(new String(baos.toByteArray())); + + + String test = """ + { + "type" : "Point", + "bbox" : [ [ 52.0, 12.0, 120.0 ], [ 52.0, 12.0, 120.0 ] ], + "coordinates" : [ 52.0, 12.0, 120.0 ] + } + """; + + System.err.println("Trying to load Point with BoundingBox"); + + JsonResource loadResource = (JsonResource) set.createResource(URI.createURI("test2.json")); + loadResource.load(new ByteArrayInputStream(test.getBytes()), map); + + System.err.println(loadResource.getContents().isEmpty()); + assertFalse(loadResource.getContents().isEmpty()); + assertFalse(loadResource.getContents().isEmpty()); + Point result = (Point) loadResource.getContents().get(0); + System.err.println(result.getCoordinates()); + assertFalse(result.getBoundingBox().isEmpty()); + assertThat(result.getBoundingBox()).hasSize(2); + } + + @Test + public void lineString(@InjectService ResourceSet set) throws IOException { + System.err.println("Running Test"); + + LineString point = new LineStringImpl(); + Coordinates coords = new CoordinatesImpl(); + coords.setLatitude(12); + coords.setLongitude(52); + coords.setElevation(120); + + point.getCoordinates().add(coords); + point.getCoordinates().add(EcoreUtil.copy(coords)); + + JsonResource resource = (JsonResource) set.createResource(URI.createURI("test.json")); + resource.getContents().add(point); + Map map = new HashMap<>(); + map.put(EMFJs.OPTION_SERIALIZE_DEFAULT_VALUE, true); + map.put(EMFJs.OPTION_TYPE_FIELD, "type"); + map.put(EMFJs.OPTION_TYPE_USE, EcoreTypeInfo.USE.NAME); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + resource.save(baos, map); + + System.out.println(new String(baos.toByteArray())); + + + String test = """ + { + "type" : "LineString", + "coordinates" : [ [ 52.0, 12.0, 120.0 ], [ 52.0, 12.0, 120.0 ] ] +} + """; + + System.err.println("Trying to load LineString"); + + JsonResource loadResource = (JsonResource) set.createResource(URI.createURI("test2.json")); + loadResource.load(new ByteArrayInputStream(test.getBytes()), map); + + System.err.println(loadResource.getContents().isEmpty()); + assertFalse(loadResource.getContents().isEmpty()); + LineString result = (LineString) loadResource.getContents().get(0); + result.getCoordinates().forEach(System.err::println);; + } + + @Test + public void multiPointString(@InjectService ResourceSet set) throws IOException { + System.err.println("Running Test"); + + MultiPoint point = new MultiPointImpl(); + Coordinates coords = new CoordinatesImpl(); + coords.setLatitude(12); + coords.setLongitude(52); + coords.setElevation(120); + + point.getCoordinates().add(coords); + point.getCoordinates().add(EcoreUtil.copy(coords)); + + JsonResource resource = (JsonResource) set.createResource(URI.createURI("test.json")); + resource.getContents().add(point); + Map map = new HashMap<>(); + map.put(EMFJs.OPTION_SERIALIZE_DEFAULT_VALUE, true); + map.put(EMFJs.OPTION_TYPE_FIELD, "type"); + map.put(EMFJs.OPTION_TYPE_USE, EcoreTypeInfo.USE.NAME); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + resource.save(baos, map); + + System.out.println(new String(baos.toByteArray())); + + + String test = """ + { + "type" : "MultiPoint", + "coordinates" : [ [ 52.0, 12.0, 120.0 ], [ 52.0, 12.0, 120.0 ] ] + } + """; + + System.err.println("Trying to load MultiPoint"); + + JsonResource loadResource = (JsonResource) set.createResource(URI.createURI("test2.json")); + loadResource.load(new ByteArrayInputStream(test.getBytes()), map); + + System.err.println(loadResource.getContents().isEmpty()); + assertFalse(loadResource.getContents().isEmpty()); + MultiPoint result = (MultiPoint) loadResource.getContents().get(0); + result.getCoordinates().forEach(System.err::println);; + } + + @Test + public void feature(@InjectService ResourceSet set) throws IOException { + System.err.println("Running Feature Test"); + + Feature feature = new FeatureImpl(); + Coordinates coords = new CoordinatesImpl(); + coords.setLatitude(12); + coords.setLongitude(52); + coords.setElevation(120); + + feature.getBoundingBox().add(coords); + feature.getBoundingBox().add(EcoreUtil.copy(coords)); + feature.setProperties(EcoreUtil.copy(coords)); + + JsonResource resource = (JsonResource) set.createResource(URI.createURI("test.json")); + resource.getContents().add(feature); + Map map = new HashMap<>(); + map.put(EMFJs.OPTION_SERIALIZE_DEFAULT_VALUE, true); + map.put(EMFJs.OPTION_TYPE_FIELD, "type"); + map.put(EMFJs.OPTION_TYPE_USE, EcoreTypeInfo.USE.NAME); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + resource.save(baos, map); + + System.out.println(new String(baos.toByteArray())); + + + String test = """ + { + "type" : "Feature", + "bbox" : [ [ 52.0, 12.0, 120.0 ], [ 52.0, 12.0, 120.0 ] ] + } + """; + + System.err.println("Trying to load Feature"); + + JsonResource loadResource = (JsonResource) set.createResource(URI.createURI("test2.json")); + loadResource.load(new ByteArrayInputStream(test.getBytes()), map); + + System.err.println(loadResource.getContents().isEmpty()); + assertFalse(loadResource.getContents().isEmpty()); + Feature result = (Feature) loadResource.getContents().get(0); + assertThat(result.getBoundingBox()).hasSize(2); + assertThat(feature.getProperties()).isInstanceOf(Coordinates.class); + + } + + @Test + public void ploygone(@InjectService ResourceSet set) throws IOException { + System.err.println("Running Test Polygon"); + + + Polygon polygon = new PolygonImpl(); + Coordinates coords = new CoordinatesImpl(); + coords.setLatitude(12); + coords.setLongitude(52); + coords.setElevation(120); + + Ring ring = new RingImpl(); + ring.getCoordinates().add(coords); + polygon.setExteriorRing(ring); + + Hole hole = new HoleImpl(); + hole.getCoordinates().add(EcoreUtil.copy(coords)); + hole.getCoordinates().add(EcoreUtil.copy(coords)); + hole.getCoordinates().add(EcoreUtil.copy(coords)); + + polygon.getInteriorHoles().add(hole); + polygon.getInteriorHoles().add(EcoreUtil.copy(hole)); + polygon.getInteriorHoles().add(EcoreUtil.copy(hole)); + + polygon.getBoundingBox().add(EcoreUtil.copy(coords)); + polygon.getBoundingBox().add(EcoreUtil.copy(coords)); + + JsonResource resource = (JsonResource) set.createResource(URI.createURI("test.json")); + resource.getContents().add(polygon); + Map map = new HashMap<>(); + map.put(EMFJs.OPTION_SERIALIZE_DEFAULT_VALUE, true); + map.put(EMFJs.OPTION_TYPE_FIELD, "type"); + map.put(EMFJs.OPTION_TYPE_USE, EcoreTypeInfo.USE.NAME); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + resource.save(baos, map); + + System.out.println(new String(baos.toByteArray())); + + String test = """ + { + "type" : "Polygon", + "bbox" : [ [ 52.0, 12.0, 120.0 ], [ 52.0, 12.0, 120.0 ] ], + "coordinates" : [ + [ + [ 52.0, 12.0 ] + ], + [ + [ 52.0, 12.0 ], + [ 52.0, 12.0 ], + [ 52.0, 12.0 ] + ], + [ + [ 52.0, 12.0 ], + [ 52.0, 12.0 ], + [ 52.0, 12.0 ] + ], + [ + [ 52.0, 12.0 ], + [ 52.0, 12.0 ], + [ 52.0, 12.0 ] + ] + ] +} + """; + + System.err.println("Trying to load Polygon"); + + JsonResource loadResource = (JsonResource) set.createResource(URI.createURI("test2.json")); + loadResource.load(new ByteArrayInputStream(test.getBytes()), map); + + System.err.println(loadResource.getContents().isEmpty()); + assertFalse(loadResource.getContents().isEmpty()); + Polygon result = (Polygon) loadResource.getContents().get(0); + baos = new ByteArrayOutputStream(); + loadResource.save(baos, map); + System.out.println(new String(baos.toByteArray())); + + assertThat(result.getBoundingBox()).hasSize(2); + assertThat(result.getExteriorRing()).isNotNull(); + assertThat(result.getInteriorHoles()).hasSize(3); + + } + +} diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/test.bndrun b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/test.bndrun new file mode 100644 index 00000000..16462487 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/test.bndrun @@ -0,0 +1,46 @@ +-library: enableOSGi-Test + +-resolve.effective: active + +-runrequires: bnd.identity;id='org.eclipse.sensinact.gateway.core.geo-json.model.test' + +-runbundles.test: \ + org.eclipse.sensinact.gateway.core.geo-json.model.test;version=snapshot + +-runfw: org.apache.felix.framework + +-runee: JavaSE-17 + +-runtrace: true + +-runbundles: \ + com.fasterxml.jackson.core.jackson-annotations;version='[2.16.0,2.16.1)',\ + com.fasterxml.jackson.core.jackson-core;version='[2.16.0,2.16.1)',\ + com.fasterxml.jackson.core.jackson-databind;version='[2.16.0,2.16.1)',\ + com.fasterxml.jackson.dataformat.jackson-dataformat-properties;version='[2.14.1,2.14.2)',\ + com.fasterxml.jackson.dataformat.jackson-dataformat-yaml;version='[2.16.0,2.16.1)',\ + com.fasterxml.jackson.datatype.jackson-datatype-jsr310;version='[2.16.0,2.16.1)',\ + junit-jupiter-api;version='[5.10.1,5.10.2)',\ + junit-jupiter-engine;version='[5.10.1,5.10.2)',\ + junit-jupiter-params;version='[5.10.1,5.10.2)',\ + junit-platform-commons;version='[1.10.1,1.10.2)',\ + junit-platform-engine;version='[1.10.1,1.10.2)',\ + junit-platform-launcher;version='[1.10.1,1.10.2)',\ + org.apache.felix.scr;version='[2.2.12,2.2.13)',\ + org.eclipse.emf.common;version='[2.29.0,2.29.1)',\ + org.eclipse.emf.ecore;version='[2.35.0,2.35.1)',\ + org.eclipse.emf.ecore.xmi;version='[2.36.0,2.36.1)',\ + org.eclipse.emfcloud.emfjson-jackson;version='[2.2.0,2.2.1)',\ + org.eclipse.sensinact.gateway.core.geo-json.model;version=snapshot,\ + org.eclipse.sensinact.gateway.core.geo-json.model.test;version=snapshot,\ + org.gecko.emf.json;version='[1.5.1,1.5.2)',\ + org.gecko.emf.osgi.component.minimal;version='[6.2.0,6.2.1)',\ + org.opentest4j;version='[1.3.0,1.3.1)',\ + org.osgi.service.cm;version='[1.6.1,1.6.2)',\ + org.osgi.service.component;version='[1.5.1,1.5.2)',\ + org.osgi.test.common;version='[1.2.1,1.2.2)',\ + org.osgi.test.junit5;version='[1.2.1,1.2.2)',\ + org.osgi.util.converter;version='[1.0.9,1.0.10)',\ + org.osgi.util.function;version='[1.2.0,1.2.1)',\ + org.osgi.util.promise;version='[1.3.0,1.3.1)',\ + org.yaml.snakeyaml;version='[2.3.0,2.3.1)' \ No newline at end of file diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291159-SNAPSHOT.xml b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291159-SNAPSHOT.xml new file mode 100644 index 00000000..1004853e --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291159-SNAPSHOT.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291233-SNAPSHOT.xml b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291233-SNAPSHOT.xml new file mode 100644 index 00000000..26adfa2d --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291233-SNAPSHOT.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291234-SNAPSHOT.xml b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291234-SNAPSHOT.xml new file mode 100644 index 00000000..34b17b30 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291234-SNAPSHOT.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291237-SNAPSHOT.xml b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291237-SNAPSHOT.xml new file mode 100644 index 00000000..fe7453f3 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291237-SNAPSHOT.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291238-SNAPSHOT.xml b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291238-SNAPSHOT.xml new file mode 100644 index 00000000..b2a3d7e9 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291238-SNAPSHOT.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291243-SNAPSHOT.xml b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291243-SNAPSHOT.xml new file mode 100644 index 00000000..855f1a64 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291243-SNAPSHOT.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291309-SNAPSHOT.xml b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291309-SNAPSHOT.xml new file mode 100644 index 00000000..8e5ee42c --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291309-SNAPSHOT.xml @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291315-SNAPSHOT.xml b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291315-SNAPSHOT.xml new file mode 100644 index 00000000..ed8250f0 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291315-SNAPSHOT.xml @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291317-SNAPSHOT.xml b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291317-SNAPSHOT.xml new file mode 100644 index 00000000..4ffa9c2a --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291317-SNAPSHOT.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291548-SNAPSHOT.xml b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291548-SNAPSHOT.xml new file mode 100644 index 00000000..51dcfdf5 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291548-SNAPSHOT.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291550-SNAPSHOT.xml b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291550-SNAPSHOT.xml new file mode 100644 index 00000000..270841ac --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291550-SNAPSHOT.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291551-SNAPSHOT.xml b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291551-SNAPSHOT.xml new file mode 100644 index 00000000..02c8b57e --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291551-SNAPSHOT.xml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291552-SNAPSHOT.xml b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291552-SNAPSHOT.xml new file mode 100644 index 00000000..6e2ab368 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291552-SNAPSHOT.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291553-SNAPSHOT.xml b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291553-SNAPSHOT.xml new file mode 100644 index 00000000..23d553e4 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291553-SNAPSHOT.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291633-SNAPSHOT.xml b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291633-SNAPSHOT.xml new file mode 100644 index 00000000..d93af1cf --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model.test/testdir/TEST-org.eclipse.sensinact.gateway.core.geo-json.model.test-1.0.0.202411291633-SNAPSHOT.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/.classpath b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/.classpath new file mode 100644 index 00000000..7e9d05c6 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/.classpath @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/.project b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/.project new file mode 100644 index 00000000..f3beb4c7 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/.project @@ -0,0 +1,34 @@ + + + org.eclipse.sensinact.gateway.core.geo-json.model + + + + + + org.eclipse.jdt.core.javabuilder + + + + + bndtools.core.bndbuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + bndtools.core.bndnature + org.eclipse.pde.PluginNature + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/.settings/org.eclipse.core.resources.prefs b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000..1d9d67b8 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,10 @@ +eclipse.preferences.version=1 +encoding//.settings/org.eclipse.core.resources.prefs=UTF-8 +encoding//.settings/org.eclipse.jdt.core.prefs=UTF-8 +encoding//.settings/org.eclipse.jdt.ui.prefs=UTF-8 +encoding//model/geojson.ecore=UTF-8 +encoding//model/geojson.genmodel=UTF-8 +encoding//src/test/component/Example.java=UTF-8 +encoding//test/test/component/ExampleTest.java=UTF-8 +encoding/bnd.bnd=UTF-8 +encoding/launch.bndrun=UTF-8 diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/.settings/org.eclipse.jdt.core.prefs b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..502518c4 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,11 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=17 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=17 diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/.settings/org.eclipse.jdt.ui.prefs b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000..05331f3e --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,8 @@ +content_assist_proposals_background=255,255,255 +content_assist_proposals_foreground=0,0,0 +eclipse.preferences.version=1 +org.eclipse.jdt.ui.formatterprofiles.version=13 +org.eclipse.jdt.ui.javadoc=true +spelling_locale_initialized=true +useAnnotationsPrefPage=true +useQuickDiffPrefPage=true diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/bnd.bnd b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/bnd.bnd new file mode 100644 index 00000000..3cd0251b --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/bnd.bnd @@ -0,0 +1,26 @@ +# sets the usually required buildpath using the bnd library, you can extend it with the normal -buildpath to your liking +-library: enable-emf + +src: src, src-gen + +# The code generation takes a bit of time and makes the build a bit slower. +# It might be a good idea to put comments around it, when you don't need it +-generate:\ + model/geojson.genmodel;\ + generate=geckoEMF;\ + genmodel=model/geojson.genmodel;\ + output=src-gen +# Add this attribute to find some logging information +# logfile=test.log;\ + +# If this is not done with a instruction namespace, bnd would think you like +# to take full control over whats exported and imported and will ignore @Export +# Bundle Annotations +-includeresource.model: model=model + +Bundle-Version: 1.0.0.SNAPSHOT + +-buildpath: \ + org.gecko.emf.json,\ + org.eclipse.emfcloud.emfjson-jackson,\ + com.fasterxml.jackson.core.jackson-databind \ No newline at end of file diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/model/geojson.ecore b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/model/geojson.ecore new file mode 100644 index 00000000..a3c847bf --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/model/geojson.ecore @@ -0,0 +1,233 @@ + + + +
+ + +
+ + + + + + + + +
+ + + +
+
+ + + + + +
+ + +
+
+
+
+
+ + + + + + + +
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + +
+ + + + + +
+ + +
+
+
+
+
+ + + + + + + + + + + + + + +
+ + + + + +
+ + + +
+ + +
+
+
+
+
+ + + + + + +
+ + + + +
+ + + + + +
+ + + + +
+ + + +
+
+ + + + + +
+ + +
+
+
+
+
+ + + + + + +
+ + + +
+
+ + + + + +
+ + +
+
+
+
+
+ + + + + + + +
+ + + +
+
+ + + + + +
+ + +
+
+
+
+
+ + + + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/model/geojson.genmodel b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/model/geojson.genmodel new file mode 100644 index 00000000..04b87246 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/model/geojson.genmodel @@ -0,0 +1,91 @@ + + + geojson.ecore + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/model/geojson_bak.ecore b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/model/geojson_bak.ecore new file mode 100644 index 00000000..18ef2ee6 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/model/geojson_bak.ecore @@ -0,0 +1,88 @@ + + + +
+ + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + + +
+
+ + + +
+ + + +
+
+
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Coordinates.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Coordinates.java new file mode 100644 index 00000000..3fe484c2 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Coordinates.java @@ -0,0 +1,96 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson; + +import org.eclipse.emf.ecore.EObject; + +import org.osgi.annotation.versioning.ProviderType; + +/** + * + * A representation of the model object 'Coordinates'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.Coordinates#getLongitude Longitude}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.Coordinates#getLatitude Latitude}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.Coordinates#getElevation Elevation}
  • + *
+ * + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getCoordinates() + * @model + * @generated + */ +@ProviderType +public interface Coordinates extends EObject { + /** + * Returns the value of the 'Longitude' attribute. + * + * + * @return the value of the 'Longitude' attribute. + * @see #setLongitude(double) + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getCoordinates_Longitude() + * @model required="true" + * @generated + */ + double getLongitude(); + + /** + * Sets the value of the '{@link org.eclipse.sensinact.gateway.core.geojson.Coordinates#getLongitude Longitude}' attribute. + * + * + * @param value the new value of the 'Longitude' attribute. + * @see #getLongitude() + * @generated + */ + void setLongitude(double value); + + /** + * Returns the value of the 'Latitude' attribute. + * + * + * @return the value of the 'Latitude' attribute. + * @see #setLatitude(double) + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getCoordinates_Latitude() + * @model required="true" + * @generated + */ + double getLatitude(); + + /** + * Sets the value of the '{@link org.eclipse.sensinact.gateway.core.geojson.Coordinates#getLatitude Latitude}' attribute. + * + * + * @param value the new value of the 'Latitude' attribute. + * @see #getLatitude() + * @generated + */ + void setLatitude(double value); + + /** + * Returns the value of the 'Elevation' attribute. + * The default value is "0.0d". + * + * + * @return the value of the 'Elevation' attribute. + * @see #setElevation(double) + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getCoordinates_Elevation() + * @model default="0.0d" + * @generated + */ + double getElevation(); + + /** + * Sets the value of the '{@link org.eclipse.sensinact.gateway.core.geojson.Coordinates#getElevation Elevation}' attribute. + * + * + * @param value the new value of the 'Elevation' attribute. + * @see #getElevation() + * @generated + */ + void setElevation(double value); + +} // Coordinates diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Feature.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Feature.java new file mode 100644 index 00000000..5b4ce63a --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Feature.java @@ -0,0 +1,95 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson; + +import org.eclipse.emf.ecore.EObject; + +import org.osgi.annotation.versioning.ProviderType; + +/** + * + * A representation of the model object 'Feature'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.Feature#getId Id}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.Feature#getGeometry Geometry}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.Feature#getProperties Properties}
  • + *
+ * + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getFeature() + * @model + * @generated + */ +@ProviderType +public interface Feature extends GeoJsonObject { + /** + * Returns the value of the 'Id' attribute. + * + * + * @return the value of the 'Id' attribute. + * @see #setId(String) + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getFeature_Id() + * @model id="true" required="true" + * @generated + */ + String getId(); + + /** + * Sets the value of the '{@link org.eclipse.sensinact.gateway.core.geojson.Feature#getId Id}' attribute. + * + * + * @param value the new value of the 'Id' attribute. + * @see #getId() + * @generated + */ + void setId(String value); + + /** + * Returns the value of the 'Geometry' containment reference. + * + * + * @return the value of the 'Geometry' containment reference. + * @see #setGeometry(Geometry) + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getFeature_Geometry() + * @model containment="true" + * @generated + */ + Geometry getGeometry(); + + /** + * Sets the value of the '{@link org.eclipse.sensinact.gateway.core.geojson.Feature#getGeometry Geometry}' containment reference. + * + * + * @param value the new value of the 'Geometry' containment reference. + * @see #getGeometry() + * @generated + */ + void setGeometry(Geometry value); + + /** + * Returns the value of the 'Properties' containment reference. + * + * + * @return the value of the 'Properties' containment reference. + * @see #setProperties(EObject) + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getFeature_Properties() + * @model containment="true" + * @generated + */ + EObject getProperties(); + + /** + * Sets the value of the '{@link org.eclipse.sensinact.gateway.core.geojson.Feature#getProperties Properties}' containment reference. + * + * + * @param value the new value of the 'Properties' containment reference. + * @see #getProperties() + * @generated + */ + void setProperties(EObject value); + +} // Feature diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/FeatureCollection.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/FeatureCollection.java new file mode 100644 index 00000000..ffb8d60d --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/FeatureCollection.java @@ -0,0 +1,39 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson; + +import org.eclipse.emf.common.util.EList; + +import org.osgi.annotation.versioning.ProviderType; + +/** + * + * A representation of the model object 'Feature Collection'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.FeatureCollection#getFeatures Features}
  • + *
+ * + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getFeatureCollection() + * @model + * @generated + */ +@ProviderType +public interface FeatureCollection extends GeoJsonObject { + /** + * Returns the value of the 'Features' containment reference list. + * The list contents are of type {@link org.eclipse.sensinact.gateway.core.geojson.Feature}. + * + * + * @return the value of the 'Features' containment reference list. + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getFeatureCollection_Features() + * @model containment="true" + * @generated + */ + EList getFeatures(); + +} // FeatureCollection diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/GeoJsonFactory.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/GeoJsonFactory.java new file mode 100644 index 00000000..0ceb89f2 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/GeoJsonFactory.java @@ -0,0 +1,251 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson; + +import org.eclipse.emf.ecore.EFactory; + +import org.osgi.annotation.versioning.ProviderType; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage + * @generated + */ +@ProviderType +public interface GeoJsonFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + GeoJsonFactory eINSTANCE = org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonFactoryImpl.init(); + + /** + * Returns a new object of class 'Coordinates'. + * + * + * @return a new object of class 'Coordinates'. + * @generated + */ + Coordinates createCoordinates(); + + /** + * Returns a new object of class 'Point'. + * + * + * @return a new object of class 'Point'. + * @generated + */ + Point createPoint(); + + /** + * Returns a new object of class 'Object'. + * + * + * @return a new object of class 'Object'. + * @generated + */ + GeoJsonObject createGeoJsonObject(); + + /** + * Returns a new object of class 'Line String'. + * + * + * @return a new object of class 'Line String'. + * @generated + */ + LineString createLineString(); + + /** + * Returns a new object of class 'Simple Line String'. + * + * + * @return a new object of class 'Simple Line String'. + * @generated + */ + SimpleLineString createSimpleLineString(); + + /** + * Returns a new object of class 'Feature'. + * + * + * @return a new object of class 'Feature'. + * @generated + */ + Feature createFeature(); + + /** + * Returns a new object of class 'Feature Collection'. + * + * + * @return a new object of class 'Feature Collection'. + * @generated + */ + FeatureCollection createFeatureCollection(); + + /** + * Returns a new object of class 'Geometry Collection'. + * + * + * @return a new object of class 'Geometry Collection'. + * @generated + */ + GeometryCollection createGeometryCollection(); + + /** + * Returns a new object of class 'Multi Point'. + * + * + * @return a new object of class 'Multi Point'. + * @generated + */ + MultiPoint createMultiPoint(); + + /** + * Returns a new object of class 'Polygon'. + * + * + * @return a new object of class 'Polygon'. + * @generated + */ + Polygon createPolygon(); + + /** + * Returns a new object of class 'Ring'. + * + * + * @return a new object of class 'Ring'. + * @generated + */ + Ring createRing(); + + /** + * Returns a new object of class 'Hole'. + * + * + * @return a new object of class 'Hole'. + * @generated + */ + Hole createHole(); + + /** + * Returns a new object of class 'Multi Polygon'. + * + * + * @return a new object of class 'Multi Polygon'. + * @generated + */ + MultiPolygon createMultiPolygon(); + + /** + * Returns a new object of class 'Simple Polygon'. + * + * + * @return a new object of class 'Simple Polygon'. + * @generated + */ + SimplePolygon createSimplePolygon(); + + /** + * Returns a new object of class 'Multi Line String'. + * + * + * @return a new object of class 'Multi Line String'. + * @generated + */ + MultiLineString createMultiLineString(); + + /** + * Returns an instance of data type 'Double Array1 D' corresponding the given literal. + * + * + * @param literal a literal of the data type. + * @return a new instance value of the data type. + * @generated + */ + double[] createDoubleArray1D(String literal); + + /** + * Returns a literal representation of an instance of data type 'Double Array1 D'. + * + * + * @param instanceValue an instance value of the data type. + * @return a literal representation of the instance value. + * @generated + */ + String convertDoubleArray1D(double[] instanceValue); + + /** + * Returns an instance of data type 'Double Array2 D' corresponding the given literal. + * + * + * @param literal a literal of the data type. + * @return a new instance value of the data type. + * @generated + */ + double[][] createDoubleArray2D(String literal); + + /** + * Returns a literal representation of an instance of data type 'Double Array2 D'. + * + * + * @param instanceValue an instance value of the data type. + * @return a literal representation of the instance value. + * @generated + */ + String convertDoubleArray2D(double[][] instanceValue); + + /** + * Returns an instance of data type 'Double Array3 D' corresponding the given literal. + * + * + * @param literal a literal of the data type. + * @return a new instance value of the data type. + * @generated + */ + double[][][] createDoubleArray3D(String literal); + + /** + * Returns a literal representation of an instance of data type 'Double Array3 D'. + * + * + * @param instanceValue an instance value of the data type. + * @return a literal representation of the instance value. + * @generated + */ + String convertDoubleArray3D(double[][][] instanceValue); + + /** + * Returns an instance of data type 'Double Array4 D' corresponding the given literal. + * + * + * @param literal a literal of the data type. + * @return a new instance value of the data type. + * @generated + */ + double[][][][] createDoubleArray4D(String literal); + + /** + * Returns a literal representation of an instance of data type 'Double Array4 D'. + * + * + * @param instanceValue an instance value of the data type. + * @return a literal representation of the instance value. + * @generated + */ + String convertDoubleArray4D(double[][][][] instanceValue); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + GeoJsonPackage getGeoJsonPackage(); + +} //GeoJsonFactory diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/GeoJsonObject.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/GeoJsonObject.java new file mode 100644 index 00000000..6f2e8d29 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/GeoJsonObject.java @@ -0,0 +1,44 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +import org.osgi.annotation.versioning.ProviderType; + +/** + * + * A representation of the model object 'Object'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.GeoJsonObject#getBoundingBox Bounding Box}
  • + *
+ * + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getGeoJsonObject() + * @model features="bbox" + * bboxDataType="org.eclipse.sensinact.gateway.core.geojson.DoubleArray1D" bboxMany="true" bboxVolatile="true" bboxSuppressedGetVisibility="true" bboxSuppressedSetVisibility="true" bboxSuppressedUnsetVisibility="true" + * bboxExtendedMetaData="name='bbox'" + * bboxAnnotation="http://www.eclipse.org/emf/2002/GenModel get='return new org.eclipse.sensinact.gateway.core.geojson.util.GenericConvertingList<double[], Coordinates>(getBoundingBox(), org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper::toCoordinates, org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper::convertCoordinates);'" + * @generated + */ +@ProviderType +public interface GeoJsonObject extends EObject { + /** + * Returns the value of the 'Bounding Box' containment reference list. + * The list contents are of type {@link org.eclipse.sensinact.gateway.core.geojson.Coordinates}. + * + * + * @return the value of the 'Bounding Box' containment reference list. + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getGeoJsonObject_BoundingBox() + * @model containment="true" transient="true" + * @generated + */ + EList getBoundingBox(); + +} // GeoJsonObject diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/GeoJsonPackage.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/GeoJsonPackage.java new file mode 100644 index 00000000..b5ad8ec2 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/GeoJsonPackage.java @@ -0,0 +1,2104 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson; + + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EOperation; +import org.eclipse.emf.ecore.EReference; + +import org.gecko.emf.osgi.annotation.provide.EPackage; + +import org.osgi.annotation.versioning.ProviderType; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each operation of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonFactory + * @model kind="package" + * annotation="Version value='1.0'" + * annotation="http://www.eclipse.org/emf/2002/GenModel publicConstructors='true'" + * @generated + */ +@ProviderType +@EPackage(uri = GeoJsonPackage.eNS_URI, genModel = "/model/geojson.genmodel", genModelSourceLocations = {"model/geojson.genmodel","org.eclipse.sensinact.gateway.core.geo-json.model/model/geojson.genmodel"}, ecore="/model/geojson.ecore", ecoreSourceLocations="/model/geojson.ecore") +public interface GeoJsonPackage extends org.eclipse.emf.ecore.EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "geojson"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "https://geojson.org/model/2016"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "geo-json"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + GeoJsonPackage eINSTANCE = org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.CoordinatesImpl Coordinates}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.CoordinatesImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getCoordinates() + * @generated + */ + int COORDINATES = 0; + + /** + * The feature id for the 'Longitude' attribute. + * + * + * @generated + * @ordered + */ + int COORDINATES__LONGITUDE = 0; + + /** + * The feature id for the 'Latitude' attribute. + * + * + * @generated + * @ordered + */ + int COORDINATES__LATITUDE = 1; + + /** + * The feature id for the 'Elevation' attribute. + * + * + * @generated + * @ordered + */ + int COORDINATES__ELEVATION = 2; + + /** + * The number of structural features of the 'Coordinates' class. + * + * + * @generated + * @ordered + */ + int COORDINATES_FEATURE_COUNT = 3; + + /** + * The number of operations of the 'Coordinates' class. + * + * + * @generated + * @ordered + */ + int COORDINATES_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonObjectImpl Object}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonObjectImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getGeoJsonObject() + * @generated + */ + int GEO_JSON_OBJECT = 2; + + /** + * The feature id for the 'Bbox' attribute list. + * + * + * @generated + * @ordered + */ + int GEO_JSON_OBJECT__BBOX = 0; + + /** + * The feature id for the 'Bounding Box' containment reference list. + * + * + * @generated + * @ordered + */ + int GEO_JSON_OBJECT__BOUNDING_BOX = 1; + + /** + * The number of structural features of the 'Object' class. + * + * + * @generated + * @ordered + */ + int GEO_JSON_OBJECT_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Object' class. + * + * + * @generated + * @ordered + */ + int GEO_JSON_OBJECT_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.sensinact.gateway.core.geojson.Geometry Geometry}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.Geometry + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getGeometry() + * @generated + */ + int GEOMETRY = 4; + + /** + * The feature id for the 'Bbox' attribute list. + * + * + * @generated + * @ordered + */ + int GEOMETRY__BBOX = GEO_JSON_OBJECT__BBOX; + + /** + * The feature id for the 'Bounding Box' containment reference list. + * + * + * @generated + * @ordered + */ + int GEOMETRY__BOUNDING_BOX = GEO_JSON_OBJECT__BOUNDING_BOX; + + /** + * The number of structural features of the 'Geometry' class. + * + * + * @generated + * @ordered + */ + int GEOMETRY_FEATURE_COUNT = GEO_JSON_OBJECT_FEATURE_COUNT + 0; + + /** + * The number of operations of the 'Geometry' class. + * + * + * @generated + * @ordered + */ + int GEOMETRY_OPERATION_COUNT = GEO_JSON_OBJECT_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.PointImpl Point}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.PointImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getPoint() + * @generated + */ + int POINT = 1; + + /** + * The feature id for the 'Bbox' attribute list. + * + * + * @generated + * @ordered + */ + int POINT__BBOX = GEOMETRY__BBOX; + + /** + * The feature id for the 'Bounding Box' containment reference list. + * + * + * @generated + * @ordered + */ + int POINT__BOUNDING_BOX = GEOMETRY__BOUNDING_BOX; + + /** + * The feature id for the 'Data' attribute. + * + * + * @generated + * @ordered + */ + int POINT__DATA = GEOMETRY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Coordinates' containment reference. + * + * + * @generated + * @ordered + */ + int POINT__COORDINATES = GEOMETRY_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Point' class. + * + * + * @generated + * @ordered + */ + int POINT_FEATURE_COUNT = GEOMETRY_FEATURE_COUNT + 2; + + /** + * The operation id for the 'Set Data' operation. + * + * + * @generated + * @ordered + */ + int POINT___SET_DATA__DOUBLE = GEOMETRY_OPERATION_COUNT + 0; + + /** + * The number of operations of the 'Point' class. + * + * + * @generated + * @ordered + */ + int POINT_OPERATION_COUNT = GEOMETRY_OPERATION_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.PropertiesEntryImpl Properties Entry}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.PropertiesEntryImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getPropertiesEntry() + * @generated + */ + int PROPERTIES_ENTRY = 3; + + /** + * The feature id for the 'Key' attribute. + * + * + * @generated + * @ordered + */ + int PROPERTIES_ENTRY__KEY = 0; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int PROPERTIES_ENTRY__VALUE = 1; + + /** + * The number of structural features of the 'Properties Entry' class. + * + * + * @generated + * @ordered + */ + int PROPERTIES_ENTRY_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Properties Entry' class. + * + * + * @generated + * @ordered + */ + int PROPERTIES_ENTRY_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.LineStringImpl Line String}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.LineStringImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getLineString() + * @generated + */ + int LINE_STRING = 5; + + /** + * The feature id for the 'Bbox' attribute list. + * + * + * @generated + * @ordered + */ + int LINE_STRING__BBOX = GEOMETRY__BBOX; + + /** + * The feature id for the 'Bounding Box' containment reference list. + * + * + * @generated + * @ordered + */ + int LINE_STRING__BOUNDING_BOX = GEOMETRY__BOUNDING_BOX; + + /** + * The feature id for the 'Data' attribute list. + * + * + * @generated + * @ordered + */ + int LINE_STRING__DATA = GEOMETRY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Coordinates' containment reference list. + * + * + * @generated + * @ordered + */ + int LINE_STRING__COORDINATES = GEOMETRY_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Line String' class. + * + * + * @generated + * @ordered + */ + int LINE_STRING_FEATURE_COUNT = GEOMETRY_FEATURE_COUNT + 2; + + /** + * The number of operations of the 'Line String' class. + * + * + * @generated + * @ordered + */ + int LINE_STRING_OPERATION_COUNT = GEOMETRY_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.SimpleLineStringImpl Simple Line String}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.SimpleLineStringImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getSimpleLineString() + * @generated + */ + int SIMPLE_LINE_STRING = 6; + + /** + * The feature id for the 'Data' attribute list. + * + * + * @generated + * @ordered + */ + int SIMPLE_LINE_STRING__DATA = 0; + + /** + * The feature id for the 'Coordinates' containment reference list. + * + * + * @generated + * @ordered + */ + int SIMPLE_LINE_STRING__COORDINATES = 1; + + /** + * The number of structural features of the 'Simple Line String' class. + * + * + * @generated + * @ordered + */ + int SIMPLE_LINE_STRING_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Simple Line String' class. + * + * + * @generated + * @ordered + */ + int SIMPLE_LINE_STRING_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.FeatureImpl Feature}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.FeatureImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getFeature() + * @generated + */ + int FEATURE = 7; + + /** + * The feature id for the 'Bbox' attribute list. + * + * + * @generated + * @ordered + */ + int FEATURE__BBOX = GEO_JSON_OBJECT__BBOX; + + /** + * The feature id for the 'Bounding Box' containment reference list. + * + * + * @generated + * @ordered + */ + int FEATURE__BOUNDING_BOX = GEO_JSON_OBJECT__BOUNDING_BOX; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int FEATURE__ID = GEO_JSON_OBJECT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Geometry' containment reference. + * + * + * @generated + * @ordered + */ + int FEATURE__GEOMETRY = GEO_JSON_OBJECT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Properties' containment reference. + * + * + * @generated + * @ordered + */ + int FEATURE__PROPERTIES = GEO_JSON_OBJECT_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Feature' class. + * + * + * @generated + * @ordered + */ + int FEATURE_FEATURE_COUNT = GEO_JSON_OBJECT_FEATURE_COUNT + 3; + + /** + * The number of operations of the 'Feature' class. + * + * + * @generated + * @ordered + */ + int FEATURE_OPERATION_COUNT = GEO_JSON_OBJECT_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.FeatureCollectionImpl Feature Collection}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.FeatureCollectionImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getFeatureCollection() + * @generated + */ + int FEATURE_COLLECTION = 8; + + /** + * The feature id for the 'Bbox' attribute list. + * + * + * @generated + * @ordered + */ + int FEATURE_COLLECTION__BBOX = GEO_JSON_OBJECT__BBOX; + + /** + * The feature id for the 'Bounding Box' containment reference list. + * + * + * @generated + * @ordered + */ + int FEATURE_COLLECTION__BOUNDING_BOX = GEO_JSON_OBJECT__BOUNDING_BOX; + + /** + * The feature id for the 'Features' containment reference list. + * + * + * @generated + * @ordered + */ + int FEATURE_COLLECTION__FEATURES = GEO_JSON_OBJECT_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Feature Collection' class. + * + * + * @generated + * @ordered + */ + int FEATURE_COLLECTION_FEATURE_COUNT = GEO_JSON_OBJECT_FEATURE_COUNT + 1; + + /** + * The number of operations of the 'Feature Collection' class. + * + * + * @generated + * @ordered + */ + int FEATURE_COLLECTION_OPERATION_COUNT = GEO_JSON_OBJECT_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.GeometryCollectionImpl Geometry Collection}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeometryCollectionImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getGeometryCollection() + * @generated + */ + int GEOMETRY_COLLECTION = 9; + + /** + * The feature id for the 'Bbox' attribute list. + * + * + * @generated + * @ordered + */ + int GEOMETRY_COLLECTION__BBOX = GEOMETRY__BBOX; + + /** + * The feature id for the 'Bounding Box' containment reference list. + * + * + * @generated + * @ordered + */ + int GEOMETRY_COLLECTION__BOUNDING_BOX = GEOMETRY__BOUNDING_BOX; + + /** + * The feature id for the 'Geometries' containment reference list. + * + * + * @generated + * @ordered + */ + int GEOMETRY_COLLECTION__GEOMETRIES = GEOMETRY_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Geometry Collection' class. + * + * + * @generated + * @ordered + */ + int GEOMETRY_COLLECTION_FEATURE_COUNT = GEOMETRY_FEATURE_COUNT + 1; + + /** + * The number of operations of the 'Geometry Collection' class. + * + * + * @generated + * @ordered + */ + int GEOMETRY_COLLECTION_OPERATION_COUNT = GEOMETRY_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.MultiPointImpl Multi Point}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.MultiPointImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getMultiPoint() + * @generated + */ + int MULTI_POINT = 10; + + /** + * The feature id for the 'Bbox' attribute list. + * + * + * @generated + * @ordered + */ + int MULTI_POINT__BBOX = GEOMETRY__BBOX; + + /** + * The feature id for the 'Bounding Box' containment reference list. + * + * + * @generated + * @ordered + */ + int MULTI_POINT__BOUNDING_BOX = GEOMETRY__BOUNDING_BOX; + + /** + * The feature id for the 'Data' attribute list. + * + * + * @generated + * @ordered + */ + int MULTI_POINT__DATA = GEOMETRY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Coordinates' containment reference list. + * + * + * @generated + * @ordered + */ + int MULTI_POINT__COORDINATES = GEOMETRY_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Multi Point' class. + * + * + * @generated + * @ordered + */ + int MULTI_POINT_FEATURE_COUNT = GEOMETRY_FEATURE_COUNT + 2; + + /** + * The number of operations of the 'Multi Point' class. + * + * + * @generated + * @ordered + */ + int MULTI_POINT_OPERATION_COUNT = GEOMETRY_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.PolygonImpl Polygon}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.PolygonImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getPolygon() + * @generated + */ + int POLYGON = 11; + + /** + * The feature id for the 'Bbox' attribute list. + * + * + * @generated + * @ordered + */ + int POLYGON__BBOX = GEOMETRY__BBOX; + + /** + * The feature id for the 'Bounding Box' containment reference list. + * + * + * @generated + * @ordered + */ + int POLYGON__BOUNDING_BOX = GEOMETRY__BOUNDING_BOX; + + /** + * The feature id for the 'Data' attribute. + * + * + * @generated + * @ordered + */ + int POLYGON__DATA = GEOMETRY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Exterior Ring' containment reference. + * + * + * @generated + * @ordered + */ + int POLYGON__EXTERIOR_RING = GEOMETRY_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Interior Holes' containment reference list. + * + * + * @generated + * @ordered + */ + int POLYGON__INTERIOR_HOLES = GEOMETRY_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Polygon' class. + * + * + * @generated + * @ordered + */ + int POLYGON_FEATURE_COUNT = GEOMETRY_FEATURE_COUNT + 3; + + /** + * The operation id for the 'Set Data' operation. + * + * + * @generated + * @ordered + */ + int POLYGON___SET_DATA__DOUBLE = GEOMETRY_OPERATION_COUNT + 0; + + /** + * The number of operations of the 'Polygon' class. + * + * + * @generated + * @ordered + */ + int POLYGON_OPERATION_COUNT = GEOMETRY_OPERATION_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.RingImpl Ring}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.RingImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getRing() + * @generated + */ + int RING = 12; + + /** + * The feature id for the 'Coordinates' containment reference list. + * + * + * @generated + * @ordered + */ + int RING__COORDINATES = 0; + + /** + * The number of structural features of the 'Ring' class. + * + * + * @generated + * @ordered + */ + int RING_FEATURE_COUNT = 1; + + /** + * The number of operations of the 'Ring' class. + * + * + * @generated + * @ordered + */ + int RING_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.HoleImpl Hole}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.HoleImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getHole() + * @generated + */ + int HOLE = 13; + + /** + * The feature id for the 'Coordinates' containment reference list. + * + * + * @generated + * @ordered + */ + int HOLE__COORDINATES = RING__COORDINATES; + + /** + * The number of structural features of the 'Hole' class. + * + * + * @generated + * @ordered + */ + int HOLE_FEATURE_COUNT = RING_FEATURE_COUNT + 0; + + /** + * The number of operations of the 'Hole' class. + * + * + * @generated + * @ordered + */ + int HOLE_OPERATION_COUNT = RING_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.MultiPolygonImpl Multi Polygon}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.MultiPolygonImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getMultiPolygon() + * @generated + */ + int MULTI_POLYGON = 14; + + /** + * The feature id for the 'Bbox' attribute list. + * + * + * @generated + * @ordered + */ + int MULTI_POLYGON__BBOX = GEOMETRY__BBOX; + + /** + * The feature id for the 'Bounding Box' containment reference list. + * + * + * @generated + * @ordered + */ + int MULTI_POLYGON__BOUNDING_BOX = GEOMETRY__BOUNDING_BOX; + + /** + * The feature id for the 'Data' attribute. + * + * + * @generated + * @ordered + */ + int MULTI_POLYGON__DATA = GEOMETRY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Polygons' containment reference list. + * + * + * @generated + * @ordered + */ + int MULTI_POLYGON__POLYGONS = GEOMETRY_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Multi Polygon' class. + * + * + * @generated + * @ordered + */ + int MULTI_POLYGON_FEATURE_COUNT = GEOMETRY_FEATURE_COUNT + 2; + + /** + * The operation id for the 'Set Data' operation. + * + * + * @generated + * @ordered + */ + int MULTI_POLYGON___SET_DATA__DOUBLE = GEOMETRY_OPERATION_COUNT + 0; + + /** + * The number of operations of the 'Multi Polygon' class. + * + * + * @generated + * @ordered + */ + int MULTI_POLYGON_OPERATION_COUNT = GEOMETRY_OPERATION_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.SimplePolygonImpl Simple Polygon}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.SimplePolygonImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getSimplePolygon() + * @generated + */ + int SIMPLE_POLYGON = 15; + + /** + * The feature id for the 'Data' attribute. + * + * + * @generated + * @ordered + */ + int SIMPLE_POLYGON__DATA = 0; + + /** + * The feature id for the 'Exterior Ring' containment reference. + * + * + * @generated + * @ordered + */ + int SIMPLE_POLYGON__EXTERIOR_RING = 1; + + /** + * The feature id for the 'Interior Holes' containment reference list. + * + * + * @generated + * @ordered + */ + int SIMPLE_POLYGON__INTERIOR_HOLES = 2; + + /** + * The number of structural features of the 'Simple Polygon' class. + * + * + * @generated + * @ordered + */ + int SIMPLE_POLYGON_FEATURE_COUNT = 3; + + /** + * The operation id for the 'Set Data' operation. + * + * + * @generated + * @ordered + */ + int SIMPLE_POLYGON___SET_DATA__DOUBLE = 0; + + /** + * The number of operations of the 'Simple Polygon' class. + * + * + * @generated + * @ordered + */ + int SIMPLE_POLYGON_OPERATION_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.MultiLineStringImpl Multi Line String}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.MultiLineStringImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getMultiLineString() + * @generated + */ + int MULTI_LINE_STRING = 16; + + /** + * The feature id for the 'Bbox' attribute list. + * + * + * @generated + * @ordered + */ + int MULTI_LINE_STRING__BBOX = GEOMETRY__BBOX; + + /** + * The feature id for the 'Bounding Box' containment reference list. + * + * + * @generated + * @ordered + */ + int MULTI_LINE_STRING__BOUNDING_BOX = GEOMETRY__BOUNDING_BOX; + + /** + * The feature id for the 'Data' attribute. + * + * + * @generated + * @ordered + */ + int MULTI_LINE_STRING__DATA = GEOMETRY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Lines Strings' containment reference list. + * + * + * @generated + * @ordered + */ + int MULTI_LINE_STRING__LINES_STRINGS = GEOMETRY_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Multi Line String' class. + * + * + * @generated + * @ordered + */ + int MULTI_LINE_STRING_FEATURE_COUNT = GEOMETRY_FEATURE_COUNT + 2; + + /** + * The operation id for the 'Set Data' operation. + * + * + * @generated + * @ordered + */ + int MULTI_LINE_STRING___SET_DATA__DOUBLE = GEOMETRY_OPERATION_COUNT + 0; + + /** + * The number of operations of the 'Multi Line String' class. + * + * + * @generated + * @ordered + */ + int MULTI_LINE_STRING_OPERATION_COUNT = GEOMETRY_OPERATION_COUNT + 1; + + /** + * The meta object id for the 'Double Array1 D' data type. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getDoubleArray1D() + * @generated + */ + int DOUBLE_ARRAY1_D = 17; + + /** + * The meta object id for the 'Double Array2 D' data type. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getDoubleArray2D() + * @generated + */ + int DOUBLE_ARRAY2_D = 18; + + /** + * The meta object id for the 'Double Array3 D' data type. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getDoubleArray3D() + * @generated + */ + int DOUBLE_ARRAY3_D = 19; + + /** + * The meta object id for the 'Double Array4 D' data type. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getDoubleArray4D() + * @generated + */ + int DOUBLE_ARRAY4_D = 20; + + + /** + * Returns the meta object for class '{@link org.eclipse.sensinact.gateway.core.geojson.Coordinates Coordinates}'. + * + * + * @return the meta object for class 'Coordinates'. + * @see org.eclipse.sensinact.gateway.core.geojson.Coordinates + * @generated + */ + EClass getCoordinates(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.sensinact.gateway.core.geojson.Coordinates#getLongitude Longitude}'. + * + * + * @return the meta object for the attribute 'Longitude'. + * @see org.eclipse.sensinact.gateway.core.geojson.Coordinates#getLongitude() + * @see #getCoordinates() + * @generated + */ + EAttribute getCoordinates_Longitude(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.sensinact.gateway.core.geojson.Coordinates#getLatitude Latitude}'. + * + * + * @return the meta object for the attribute 'Latitude'. + * @see org.eclipse.sensinact.gateway.core.geojson.Coordinates#getLatitude() + * @see #getCoordinates() + * @generated + */ + EAttribute getCoordinates_Latitude(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.sensinact.gateway.core.geojson.Coordinates#getElevation Elevation}'. + * + * + * @return the meta object for the attribute 'Elevation'. + * @see org.eclipse.sensinact.gateway.core.geojson.Coordinates#getElevation() + * @see #getCoordinates() + * @generated + */ + EAttribute getCoordinates_Elevation(); + + /** + * Returns the meta object for class '{@link org.eclipse.sensinact.gateway.core.geojson.Point Point}'. + * + * + * @return the meta object for class 'Point'. + * @see org.eclipse.sensinact.gateway.core.geojson.Point + * @generated + */ + EClass getPoint(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.sensinact.gateway.core.geojson.Point Data}'. + * + * + * @return the meta object for the attribute 'Data'. + * @see org.eclipse.sensinact.gateway.core.geojson.Point + * @see #getPoint() + * @generated + */ + EAttribute getPoint_Data(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.sensinact.gateway.core.geojson.Point#getCoordinates Coordinates}'. + * + * + * @return the meta object for the containment reference 'Coordinates'. + * @see org.eclipse.sensinact.gateway.core.geojson.Point#getCoordinates() + * @see #getPoint() + * @generated + */ + EReference getPoint_Coordinates(); + + /** + * Returns the meta object for the '{@link org.eclipse.sensinact.gateway.core.geojson.Point#setData(java.lang.double[]) Set Data}' operation. + * + * + * @return the meta object for the 'Set Data' operation. + * @see org.eclipse.sensinact.gateway.core.geojson.Point#setData(java.lang.double[]) + * @generated + */ + EOperation getPoint__SetData__double(); + + /** + * Returns the meta object for class '{@link org.eclipse.sensinact.gateway.core.geojson.GeoJsonObject Object}'. + * + * + * @return the meta object for class 'Object'. + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonObject + * @generated + */ + EClass getGeoJsonObject(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.sensinact.gateway.core.geojson.GeoJsonObject Bbox}'. + * + * + * @return the meta object for the attribute list 'Bbox'. + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonObject + * @see #getGeoJsonObject() + * @generated + */ + EAttribute getGeoJsonObject_Bbox(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.sensinact.gateway.core.geojson.GeoJsonObject#getBoundingBox Bounding Box}'. + * + * + * @return the meta object for the containment reference list 'Bounding Box'. + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonObject#getBoundingBox() + * @see #getGeoJsonObject() + * @generated + */ + EReference getGeoJsonObject_BoundingBox(); + + /** + * Returns the meta object for class '{@link java.util.Map.Entry Properties Entry}'. + * + * + * @return the meta object for class 'Properties Entry'. + * @see java.util.Map.Entry + * @model keyDataType="org.eclipse.emf.ecore.EString" keyRequired="true" + * valueDataType="org.eclipse.emf.ecore.EJavaObject" valueRequired="true" + * @generated + */ + EClass getPropertiesEntry(); + + /** + * Returns the meta object for the attribute '{@link java.util.Map.Entry Key}'. + * + * + * @return the meta object for the attribute 'Key'. + * @see java.util.Map.Entry + * @see #getPropertiesEntry() + * @generated + */ + EAttribute getPropertiesEntry_Key(); + + /** + * Returns the meta object for the attribute '{@link java.util.Map.Entry Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see java.util.Map.Entry + * @see #getPropertiesEntry() + * @generated + */ + EAttribute getPropertiesEntry_Value(); + + /** + * Returns the meta object for class '{@link org.eclipse.sensinact.gateway.core.geojson.Geometry Geometry}'. + * + * + * @return the meta object for class 'Geometry'. + * @see org.eclipse.sensinact.gateway.core.geojson.Geometry + * @generated + */ + EClass getGeometry(); + + /** + * Returns the meta object for class '{@link org.eclipse.sensinact.gateway.core.geojson.LineString Line String}'. + * + * + * @return the meta object for class 'Line String'. + * @see org.eclipse.sensinact.gateway.core.geojson.LineString + * @generated + */ + EClass getLineString(); + + /** + * Returns the meta object for class '{@link org.eclipse.sensinact.gateway.core.geojson.SimpleLineString Simple Line String}'. + * + * + * @return the meta object for class 'Simple Line String'. + * @see org.eclipse.sensinact.gateway.core.geojson.SimpleLineString + * @generated + */ + EClass getSimpleLineString(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.sensinact.gateway.core.geojson.SimpleLineString Data}'. + * + * + * @return the meta object for the attribute list 'Data'. + * @see org.eclipse.sensinact.gateway.core.geojson.SimpleLineString + * @see #getSimpleLineString() + * @generated + */ + EAttribute getSimpleLineString_Data(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.sensinact.gateway.core.geojson.SimpleLineString#getCoordinates Coordinates}'. + * + * + * @return the meta object for the containment reference list 'Coordinates'. + * @see org.eclipse.sensinact.gateway.core.geojson.SimpleLineString#getCoordinates() + * @see #getSimpleLineString() + * @generated + */ + EReference getSimpleLineString_Coordinates(); + + /** + * Returns the meta object for class '{@link org.eclipse.sensinact.gateway.core.geojson.Feature Feature}'. + * + * + * @return the meta object for class 'Feature'. + * @see org.eclipse.sensinact.gateway.core.geojson.Feature + * @generated + */ + EClass getFeature(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.sensinact.gateway.core.geojson.Feature#getId Id}'. + * + * + * @return the meta object for the attribute 'Id'. + * @see org.eclipse.sensinact.gateway.core.geojson.Feature#getId() + * @see #getFeature() + * @generated + */ + EAttribute getFeature_Id(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.sensinact.gateway.core.geojson.Feature#getGeometry Geometry}'. + * + * + * @return the meta object for the containment reference 'Geometry'. + * @see org.eclipse.sensinact.gateway.core.geojson.Feature#getGeometry() + * @see #getFeature() + * @generated + */ + EReference getFeature_Geometry(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.sensinact.gateway.core.geojson.Feature#getProperties Properties}'. + * + * + * @return the meta object for the containment reference 'Properties'. + * @see org.eclipse.sensinact.gateway.core.geojson.Feature#getProperties() + * @see #getFeature() + * @generated + */ + EReference getFeature_Properties(); + + /** + * Returns the meta object for class '{@link org.eclipse.sensinact.gateway.core.geojson.FeatureCollection Feature Collection}'. + * + * + * @return the meta object for class 'Feature Collection'. + * @see org.eclipse.sensinact.gateway.core.geojson.FeatureCollection + * @generated + */ + EClass getFeatureCollection(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.sensinact.gateway.core.geojson.FeatureCollection#getFeatures Features}'. + * + * + * @return the meta object for the containment reference list 'Features'. + * @see org.eclipse.sensinact.gateway.core.geojson.FeatureCollection#getFeatures() + * @see #getFeatureCollection() + * @generated + */ + EReference getFeatureCollection_Features(); + + /** + * Returns the meta object for class '{@link org.eclipse.sensinact.gateway.core.geojson.GeometryCollection Geometry Collection}'. + * + * + * @return the meta object for class 'Geometry Collection'. + * @see org.eclipse.sensinact.gateway.core.geojson.GeometryCollection + * @generated + */ + EClass getGeometryCollection(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.sensinact.gateway.core.geojson.GeometryCollection#getGeometries Geometries}'. + * + * + * @return the meta object for the containment reference list 'Geometries'. + * @see org.eclipse.sensinact.gateway.core.geojson.GeometryCollection#getGeometries() + * @see #getGeometryCollection() + * @generated + */ + EReference getGeometryCollection_Geometries(); + + /** + * Returns the meta object for class '{@link org.eclipse.sensinact.gateway.core.geojson.MultiPoint Multi Point}'. + * + * + * @return the meta object for class 'Multi Point'. + * @see org.eclipse.sensinact.gateway.core.geojson.MultiPoint + * @generated + */ + EClass getMultiPoint(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.sensinact.gateway.core.geojson.MultiPoint Data}'. + * + * + * @return the meta object for the attribute list 'Data'. + * @see org.eclipse.sensinact.gateway.core.geojson.MultiPoint + * @see #getMultiPoint() + * @generated + */ + EAttribute getMultiPoint_Data(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.sensinact.gateway.core.geojson.MultiPoint#getCoordinates Coordinates}'. + * + * + * @return the meta object for the containment reference list 'Coordinates'. + * @see org.eclipse.sensinact.gateway.core.geojson.MultiPoint#getCoordinates() + * @see #getMultiPoint() + * @generated + */ + EReference getMultiPoint_Coordinates(); + + /** + * Returns the meta object for class '{@link org.eclipse.sensinact.gateway.core.geojson.Polygon Polygon}'. + * + * + * @return the meta object for class 'Polygon'. + * @see org.eclipse.sensinact.gateway.core.geojson.Polygon + * @generated + */ + EClass getPolygon(); + + /** + * Returns the meta object for class '{@link org.eclipse.sensinact.gateway.core.geojson.Ring Ring}'. + * + * + * @return the meta object for class 'Ring'. + * @see org.eclipse.sensinact.gateway.core.geojson.Ring + * @generated + */ + EClass getRing(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.sensinact.gateway.core.geojson.Ring#getCoordinates Coordinates}'. + * + * + * @return the meta object for the containment reference list 'Coordinates'. + * @see org.eclipse.sensinact.gateway.core.geojson.Ring#getCoordinates() + * @see #getRing() + * @generated + */ + EReference getRing_Coordinates(); + + /** + * Returns the meta object for class '{@link org.eclipse.sensinact.gateway.core.geojson.Hole Hole}'. + * + * + * @return the meta object for class 'Hole'. + * @see org.eclipse.sensinact.gateway.core.geojson.Hole + * @generated + */ + EClass getHole(); + + /** + * Returns the meta object for class '{@link org.eclipse.sensinact.gateway.core.geojson.MultiPolygon Multi Polygon}'. + * + * + * @return the meta object for class 'Multi Polygon'. + * @see org.eclipse.sensinact.gateway.core.geojson.MultiPolygon + * @generated + */ + EClass getMultiPolygon(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.sensinact.gateway.core.geojson.MultiPolygon Data}'. + * + * + * @return the meta object for the attribute 'Data'. + * @see org.eclipse.sensinact.gateway.core.geojson.MultiPolygon + * @see #getMultiPolygon() + * @generated + */ + EAttribute getMultiPolygon_Data(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.sensinact.gateway.core.geojson.MultiPolygon#getPolygons Polygons}'. + * + * + * @return the meta object for the containment reference list 'Polygons'. + * @see org.eclipse.sensinact.gateway.core.geojson.MultiPolygon#getPolygons() + * @see #getMultiPolygon() + * @generated + */ + EReference getMultiPolygon_Polygons(); + + /** + * Returns the meta object for the '{@link org.eclipse.sensinact.gateway.core.geojson.MultiPolygon#setData(java.lang.double[][][][]) Set Data}' operation. + * + * + * @return the meta object for the 'Set Data' operation. + * @see org.eclipse.sensinact.gateway.core.geojson.MultiPolygon#setData(java.lang.double[][][][]) + * @generated + */ + EOperation getMultiPolygon__SetData__double(); + + /** + * Returns the meta object for class '{@link org.eclipse.sensinact.gateway.core.geojson.SimplePolygon Simple Polygon}'. + * + * + * @return the meta object for class 'Simple Polygon'. + * @see org.eclipse.sensinact.gateway.core.geojson.SimplePolygon + * @generated + */ + EClass getSimplePolygon(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.sensinact.gateway.core.geojson.SimplePolygon Data}'. + * + * + * @return the meta object for the attribute 'Data'. + * @see org.eclipse.sensinact.gateway.core.geojson.SimplePolygon + * @see #getSimplePolygon() + * @generated + */ + EAttribute getSimplePolygon_Data(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.sensinact.gateway.core.geojson.SimplePolygon#getExteriorRing Exterior Ring}'. + * + * + * @return the meta object for the containment reference 'Exterior Ring'. + * @see org.eclipse.sensinact.gateway.core.geojson.SimplePolygon#getExteriorRing() + * @see #getSimplePolygon() + * @generated + */ + EReference getSimplePolygon_ExteriorRing(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.sensinact.gateway.core.geojson.SimplePolygon#getInteriorHoles Interior Holes}'. + * + * + * @return the meta object for the containment reference list 'Interior Holes'. + * @see org.eclipse.sensinact.gateway.core.geojson.SimplePolygon#getInteriorHoles() + * @see #getSimplePolygon() + * @generated + */ + EReference getSimplePolygon_InteriorHoles(); + + /** + * Returns the meta object for the '{@link org.eclipse.sensinact.gateway.core.geojson.SimplePolygon#setData(java.lang.double[][][]) Set Data}' operation. + * + * + * @return the meta object for the 'Set Data' operation. + * @see org.eclipse.sensinact.gateway.core.geojson.SimplePolygon#setData(java.lang.double[][][]) + * @generated + */ + EOperation getSimplePolygon__SetData__double(); + + /** + * Returns the meta object for class '{@link org.eclipse.sensinact.gateway.core.geojson.MultiLineString Multi Line String}'. + * + * + * @return the meta object for class 'Multi Line String'. + * @see org.eclipse.sensinact.gateway.core.geojson.MultiLineString + * @generated + */ + EClass getMultiLineString(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.sensinact.gateway.core.geojson.MultiLineString Data}'. + * + * + * @return the meta object for the attribute 'Data'. + * @see org.eclipse.sensinact.gateway.core.geojson.MultiLineString + * @see #getMultiLineString() + * @generated + */ + EAttribute getMultiLineString_Data(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.sensinact.gateway.core.geojson.MultiLineString#getLinesStrings Lines Strings}'. + * + * + * @return the meta object for the containment reference list 'Lines Strings'. + * @see org.eclipse.sensinact.gateway.core.geojson.MultiLineString#getLinesStrings() + * @see #getMultiLineString() + * @generated + */ + EReference getMultiLineString_LinesStrings(); + + /** + * Returns the meta object for the '{@link org.eclipse.sensinact.gateway.core.geojson.MultiLineString#setData(java.lang.double[][][]) Set Data}' operation. + * + * + * @return the meta object for the 'Set Data' operation. + * @see org.eclipse.sensinact.gateway.core.geojson.MultiLineString#setData(java.lang.double[][][]) + * @generated + */ + EOperation getMultiLineString__SetData__double(); + + /** + * Returns the meta object for data type 'Double Array1 D'. + * + * + * @return the meta object for data type 'Double Array1 D'. + * @model instanceClass="java.lang.double[]" + * @generated + */ + EDataType getDoubleArray1D(); + + /** + * Returns the meta object for data type 'Double Array2 D'. + * + * + * @return the meta object for data type 'Double Array2 D'. + * @model instanceClass="java.lang.double[][]" + * @generated + */ + EDataType getDoubleArray2D(); + + /** + * Returns the meta object for data type 'Double Array3 D'. + * + * + * @return the meta object for data type 'Double Array3 D'. + * @model instanceClass="java.lang.double[][][]" + * @generated + */ + EDataType getDoubleArray3D(); + + /** + * Returns the meta object for data type 'Double Array4 D'. + * + * + * @return the meta object for data type 'Double Array4 D'. + * @model instanceClass="java.lang.double[][][][]" + * @generated + */ + EDataType getDoubleArray4D(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + GeoJsonFactory getGeoJsonFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each operation of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.CoordinatesImpl Coordinates}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.CoordinatesImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getCoordinates() + * @generated + */ + EClass COORDINATES = eINSTANCE.getCoordinates(); + + /** + * The meta object literal for the 'Longitude' attribute feature. + * + * + * @generated + */ + EAttribute COORDINATES__LONGITUDE = eINSTANCE.getCoordinates_Longitude(); + + /** + * The meta object literal for the 'Latitude' attribute feature. + * + * + * @generated + */ + EAttribute COORDINATES__LATITUDE = eINSTANCE.getCoordinates_Latitude(); + + /** + * The meta object literal for the 'Elevation' attribute feature. + * + * + * @generated + */ + EAttribute COORDINATES__ELEVATION = eINSTANCE.getCoordinates_Elevation(); + + /** + * The meta object literal for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.PointImpl Point}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.PointImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getPoint() + * @generated + */ + EClass POINT = eINSTANCE.getPoint(); + + /** + * The meta object literal for the 'Data' attribute feature. + * + * + * @generated + */ + EAttribute POINT__DATA = eINSTANCE.getPoint_Data(); + + /** + * The meta object literal for the 'Coordinates' containment reference feature. + * + * + * @generated + */ + EReference POINT__COORDINATES = eINSTANCE.getPoint_Coordinates(); + + /** + * The meta object literal for the 'Set Data' operation. + * + * + * @generated + */ + EOperation POINT___SET_DATA__DOUBLE = eINSTANCE.getPoint__SetData__double(); + + /** + * The meta object literal for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonObjectImpl Object}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonObjectImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getGeoJsonObject() + * @generated + */ + EClass GEO_JSON_OBJECT = eINSTANCE.getGeoJsonObject(); + + /** + * The meta object literal for the 'Bbox' attribute list feature. + * + * + * @generated + */ + EAttribute GEO_JSON_OBJECT__BBOX = eINSTANCE.getGeoJsonObject_Bbox(); + + /** + * The meta object literal for the 'Bounding Box' containment reference list feature. + * + * + * @generated + */ + EReference GEO_JSON_OBJECT__BOUNDING_BOX = eINSTANCE.getGeoJsonObject_BoundingBox(); + + /** + * The meta object literal for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.PropertiesEntryImpl Properties Entry}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.PropertiesEntryImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getPropertiesEntry() + * @generated + */ + EClass PROPERTIES_ENTRY = eINSTANCE.getPropertiesEntry(); + + /** + * The meta object literal for the 'Key' attribute feature. + * + * + * @generated + */ + EAttribute PROPERTIES_ENTRY__KEY = eINSTANCE.getPropertiesEntry_Key(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute PROPERTIES_ENTRY__VALUE = eINSTANCE.getPropertiesEntry_Value(); + + /** + * The meta object literal for the '{@link org.eclipse.sensinact.gateway.core.geojson.Geometry Geometry}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.Geometry + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getGeometry() + * @generated + */ + EClass GEOMETRY = eINSTANCE.getGeometry(); + + /** + * The meta object literal for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.LineStringImpl Line String}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.LineStringImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getLineString() + * @generated + */ + EClass LINE_STRING = eINSTANCE.getLineString(); + + /** + * The meta object literal for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.SimpleLineStringImpl Simple Line String}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.SimpleLineStringImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getSimpleLineString() + * @generated + */ + EClass SIMPLE_LINE_STRING = eINSTANCE.getSimpleLineString(); + + /** + * The meta object literal for the 'Data' attribute list feature. + * + * + * @generated + */ + EAttribute SIMPLE_LINE_STRING__DATA = eINSTANCE.getSimpleLineString_Data(); + + /** + * The meta object literal for the 'Coordinates' containment reference list feature. + * + * + * @generated + */ + EReference SIMPLE_LINE_STRING__COORDINATES = eINSTANCE.getSimpleLineString_Coordinates(); + + /** + * The meta object literal for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.FeatureImpl Feature}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.FeatureImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getFeature() + * @generated + */ + EClass FEATURE = eINSTANCE.getFeature(); + + /** + * The meta object literal for the 'Id' attribute feature. + * + * + * @generated + */ + EAttribute FEATURE__ID = eINSTANCE.getFeature_Id(); + + /** + * The meta object literal for the 'Geometry' containment reference feature. + * + * + * @generated + */ + EReference FEATURE__GEOMETRY = eINSTANCE.getFeature_Geometry(); + + /** + * The meta object literal for the 'Properties' containment reference feature. + * + * + * @generated + */ + EReference FEATURE__PROPERTIES = eINSTANCE.getFeature_Properties(); + + /** + * The meta object literal for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.FeatureCollectionImpl Feature Collection}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.FeatureCollectionImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getFeatureCollection() + * @generated + */ + EClass FEATURE_COLLECTION = eINSTANCE.getFeatureCollection(); + + /** + * The meta object literal for the 'Features' containment reference list feature. + * + * + * @generated + */ + EReference FEATURE_COLLECTION__FEATURES = eINSTANCE.getFeatureCollection_Features(); + + /** + * The meta object literal for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.GeometryCollectionImpl Geometry Collection}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeometryCollectionImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getGeometryCollection() + * @generated + */ + EClass GEOMETRY_COLLECTION = eINSTANCE.getGeometryCollection(); + + /** + * The meta object literal for the 'Geometries' containment reference list feature. + * + * + * @generated + */ + EReference GEOMETRY_COLLECTION__GEOMETRIES = eINSTANCE.getGeometryCollection_Geometries(); + + /** + * The meta object literal for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.MultiPointImpl Multi Point}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.MultiPointImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getMultiPoint() + * @generated + */ + EClass MULTI_POINT = eINSTANCE.getMultiPoint(); + + /** + * The meta object literal for the 'Data' attribute list feature. + * + * + * @generated + */ + EAttribute MULTI_POINT__DATA = eINSTANCE.getMultiPoint_Data(); + + /** + * The meta object literal for the 'Coordinates' containment reference list feature. + * + * + * @generated + */ + EReference MULTI_POINT__COORDINATES = eINSTANCE.getMultiPoint_Coordinates(); + + /** + * The meta object literal for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.PolygonImpl Polygon}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.PolygonImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getPolygon() + * @generated + */ + EClass POLYGON = eINSTANCE.getPolygon(); + + /** + * The meta object literal for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.RingImpl Ring}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.RingImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getRing() + * @generated + */ + EClass RING = eINSTANCE.getRing(); + + /** + * The meta object literal for the 'Coordinates' containment reference list feature. + * + * + * @generated + */ + EReference RING__COORDINATES = eINSTANCE.getRing_Coordinates(); + + /** + * The meta object literal for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.HoleImpl Hole}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.HoleImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getHole() + * @generated + */ + EClass HOLE = eINSTANCE.getHole(); + + /** + * The meta object literal for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.MultiPolygonImpl Multi Polygon}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.MultiPolygonImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getMultiPolygon() + * @generated + */ + EClass MULTI_POLYGON = eINSTANCE.getMultiPolygon(); + + /** + * The meta object literal for the 'Data' attribute feature. + * + * + * @generated + */ + EAttribute MULTI_POLYGON__DATA = eINSTANCE.getMultiPolygon_Data(); + + /** + * The meta object literal for the 'Polygons' containment reference list feature. + * + * + * @generated + */ + EReference MULTI_POLYGON__POLYGONS = eINSTANCE.getMultiPolygon_Polygons(); + + /** + * The meta object literal for the 'Set Data' operation. + * + * + * @generated + */ + EOperation MULTI_POLYGON___SET_DATA__DOUBLE = eINSTANCE.getMultiPolygon__SetData__double(); + + /** + * The meta object literal for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.SimplePolygonImpl Simple Polygon}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.SimplePolygonImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getSimplePolygon() + * @generated + */ + EClass SIMPLE_POLYGON = eINSTANCE.getSimplePolygon(); + + /** + * The meta object literal for the 'Data' attribute feature. + * + * + * @generated + */ + EAttribute SIMPLE_POLYGON__DATA = eINSTANCE.getSimplePolygon_Data(); + + /** + * The meta object literal for the 'Exterior Ring' containment reference feature. + * + * + * @generated + */ + EReference SIMPLE_POLYGON__EXTERIOR_RING = eINSTANCE.getSimplePolygon_ExteriorRing(); + + /** + * The meta object literal for the 'Interior Holes' containment reference list feature. + * + * + * @generated + */ + EReference SIMPLE_POLYGON__INTERIOR_HOLES = eINSTANCE.getSimplePolygon_InteriorHoles(); + + /** + * The meta object literal for the 'Set Data' operation. + * + * + * @generated + */ + EOperation SIMPLE_POLYGON___SET_DATA__DOUBLE = eINSTANCE.getSimplePolygon__SetData__double(); + + /** + * The meta object literal for the '{@link org.eclipse.sensinact.gateway.core.geojson.impl.MultiLineStringImpl Multi Line String}' class. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.MultiLineStringImpl + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getMultiLineString() + * @generated + */ + EClass MULTI_LINE_STRING = eINSTANCE.getMultiLineString(); + + /** + * The meta object literal for the 'Data' attribute feature. + * + * + * @generated + */ + EAttribute MULTI_LINE_STRING__DATA = eINSTANCE.getMultiLineString_Data(); + + /** + * The meta object literal for the 'Lines Strings' containment reference list feature. + * + * + * @generated + */ + EReference MULTI_LINE_STRING__LINES_STRINGS = eINSTANCE.getMultiLineString_LinesStrings(); + + /** + * The meta object literal for the 'Set Data' operation. + * + * + * @generated + */ + EOperation MULTI_LINE_STRING___SET_DATA__DOUBLE = eINSTANCE.getMultiLineString__SetData__double(); + + /** + * The meta object literal for the 'Double Array1 D' data type. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getDoubleArray1D() + * @generated + */ + EDataType DOUBLE_ARRAY1_D = eINSTANCE.getDoubleArray1D(); + + /** + * The meta object literal for the 'Double Array2 D' data type. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getDoubleArray2D() + * @generated + */ + EDataType DOUBLE_ARRAY2_D = eINSTANCE.getDoubleArray2D(); + + /** + * The meta object literal for the 'Double Array3 D' data type. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getDoubleArray3D() + * @generated + */ + EDataType DOUBLE_ARRAY3_D = eINSTANCE.getDoubleArray3D(); + + /** + * The meta object literal for the 'Double Array4 D' data type. + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl#getDoubleArray4D() + * @generated + */ + EDataType DOUBLE_ARRAY4_D = eINSTANCE.getDoubleArray4D(); + + } + +} //GeoJsonPackage diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Geometry.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Geometry.java new file mode 100644 index 00000000..8ea07a78 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Geometry.java @@ -0,0 +1,19 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson; + +import org.osgi.annotation.versioning.ProviderType; + +/** + * + * A representation of the model object 'Geometry'. + * + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getGeometry() + * @model interface="true" abstract="true" + * @generated + */ +@ProviderType +public interface Geometry extends GeoJsonObject { +} // Geometry diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/GeometryCollection.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/GeometryCollection.java new file mode 100644 index 00000000..22486383 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/GeometryCollection.java @@ -0,0 +1,45 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson; + +import org.eclipse.emf.common.util.EList; + +import org.osgi.annotation.versioning.ProviderType; + +/** + * + * A representation of the model object 'Geometry Collection'. + * + * + * + * A GeoJSON geometry collection object as defined in + * the GeoJSON + * specification + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.GeometryCollection#getGeometries Geometries}
  • + *
+ * + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getGeometryCollection() + * @model + * @generated + */ +@ProviderType +public interface GeometryCollection extends Geometry { + /** + * Returns the value of the 'Geometries' containment reference list. + * The list contents are of type {@link org.eclipse.sensinact.gateway.core.geojson.Geometry}. + * + * + * @return the value of the 'Geometries' containment reference list. + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getGeometryCollection_Geometries() + * @model containment="true" + * @generated + */ + EList getGeometries(); + +} // GeometryCollection diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Hole.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Hole.java new file mode 100644 index 00000000..8cd19398 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Hole.java @@ -0,0 +1,23 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson; + +import org.osgi.annotation.versioning.ProviderType; + +/** + * + * A representation of the model object 'Hole'. + * + * + * + * Represents a List of Coordinates that follow the right-hand rule and run clockwise. + * + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getHole() + * @model + * @generated + */ +@ProviderType +public interface Hole extends Ring { +} // Hole diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/LineString.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/LineString.java new file mode 100644 index 00000000..75ac2c03 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/LineString.java @@ -0,0 +1,24 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson; + +import org.osgi.annotation.versioning.ProviderType; + +/** + * + * A representation of the model object 'Line String'. + * + * + * + * A GeoJSON line string object as defined in + * the GeoJSON specification + * + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getLineString() + * @model + * @generated + */ +@ProviderType +public interface LineString extends Geometry, SimpleLineString { +} // LineString diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/MultiLineString.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/MultiLineString.java new file mode 100644 index 00000000..dda8b003 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/MultiLineString.java @@ -0,0 +1,47 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson; + +import org.eclipse.emf.common.util.EList; + +import org.osgi.annotation.versioning.ProviderType; + +/** + * + * A representation of the model object 'Multi Line String'. + * + * + * + * A GeoJSON Polygone object as defined in + * the GeoJSON specification + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.MultiLineString#getLinesStrings Lines Strings}
  • + *
+ * + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getMultiLineString() + * @model features="data" + * dataDataType="org.eclipse.sensinact.gateway.core.geojson.DoubleArray3D" dataVolatile="true" dataSuppressedGetVisibility="true" dataSuppressedSetVisibility="true" dataSuppressedUnsetVisibility="true" + * dataExtendedMetaData="name='coordinates'" + * dataAnnotation="http://www.eclipse.org/emf/2002/GenModel get='double[][][] result = new double[getLinesStrings().size()][][];\nfor (int i = 0; i < getLinesStrings().size(); i++) {\n\tSimpleLineStringImpl line = (SimpleLineStringImpl) getLinesStrings().get(i);\n\tresult[i] = line.getData().toArray(new double[line.getCoordinates().size()][]);\n}\nreturn result;'" + * @generated + */ +@ProviderType +public interface MultiLineString extends Geometry { + /** + * Returns the value of the 'Lines Strings' containment reference list. + * The list contents are of type {@link org.eclipse.sensinact.gateway.core.geojson.SimpleLineString}. + * + * + * @return the value of the 'Lines Strings' containment reference list. + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getMultiLineString_LinesStrings() + * @model containment="true" + * @generated + */ + EList getLinesStrings(); + +} // MultiLineString diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/MultiPoint.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/MultiPoint.java new file mode 100644 index 00000000..eb925d8c --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/MultiPoint.java @@ -0,0 +1,47 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson; + +import org.eclipse.emf.common.util.EList; + +import org.osgi.annotation.versioning.ProviderType; + +/** + * + * A representation of the model object 'Multi Point'. + * + * + * + * A GeoJSON multi point object as defined in + * the GeoJSON specification + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.MultiPoint#getCoordinates Coordinates}
  • + *
+ * + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getMultiPoint() + * @model features="data" + * dataDataType="org.eclipse.sensinact.gateway.core.geojson.DoubleArray1D" dataMany="true" dataVolatile="true" dataSuppressedGetVisibility="true" dataSuppressedSetVisibility="true" dataSuppressedUnsetVisibility="true" + * dataExtendedMetaData="name='coordinates'" + * dataAnnotation="http://www.eclipse.org/emf/2002/GenModel get='return new org.eclipse.sensinact.gateway.core.geojson.util.GenericConvertingList<double[], Coordinates>(getCoordinates(), org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper::toCoordinates, org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper::convertCoordinates);'" + * @generated + */ +@ProviderType +public interface MultiPoint extends Geometry { + /** + * Returns the value of the 'Coordinates' containment reference list. + * The list contents are of type {@link org.eclipse.sensinact.gateway.core.geojson.Coordinates}. + * + * + * @return the value of the 'Coordinates' containment reference list. + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getMultiPoint_Coordinates() + * @model containment="true" transient="true" + * @generated + */ + EList getCoordinates(); + +} // MultiPoint diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/MultiPolygon.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/MultiPolygon.java new file mode 100644 index 00000000..cca45f1b --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/MultiPolygon.java @@ -0,0 +1,47 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson; + +import org.eclipse.emf.common.util.EList; + +import org.osgi.annotation.versioning.ProviderType; + +/** + * + * A representation of the model object 'Multi Polygon'. + * + * + * + * A GeoJSON Polygone object as defined in + * the GeoJSON specification + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.MultiPolygon#getPolygons Polygons}
  • + *
+ * + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getMultiPolygon() + * @model features="data" + * dataDataType="org.eclipse.sensinact.gateway.core.geojson.DoubleArray4D" dataVolatile="true" dataSuppressedGetVisibility="true" dataSuppressedSetVisibility="true" dataSuppressedUnsetVisibility="true" + * dataExtendedMetaData="name='coordinates'" + * dataAnnotation="http://www.eclipse.org/emf/2002/GenModel get='double[][][][] result = new double[getPolygons().size()][][][];\nfor (int i = 0; i < getPolygons().size(); i++) {\n\tSimplePolygonImpl polygon = (SimplePolygonImpl) getPolygons().get(i);\n\tresult[i] = polygon.getData();\n}\nreturn result;'" + * @generated + */ +@ProviderType +public interface MultiPolygon extends Geometry { + /** + * Returns the value of the 'Polygons' containment reference list. + * The list contents are of type {@link org.eclipse.sensinact.gateway.core.geojson.SimplePolygon}. + * + * + * @return the value of the 'Polygons' containment reference list. + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getMultiPolygon_Polygons() + * @model containment="true" + * @generated + */ + EList getPolygons(); + +} // MultiPolygon diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Point.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Point.java new file mode 100644 index 00000000..21fb5a6b --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Point.java @@ -0,0 +1,56 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson; + +import org.osgi.annotation.versioning.ProviderType; + +/** + * + * A representation of the model object 'Point'. + * + * + * + * A GeoJSON point object as defined in + * the GeoJSON + * specification + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.Point#getCoordinates Coordinates}
  • + *
+ * + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getPoint() + * @model features="data" + * dataDataType="org.eclipse.sensinact.gateway.core.geojson.DoubleArray1D" dataVolatile="true" dataSuppressedGetVisibility="true" dataSuppressedSetVisibility="true" dataSuppressedIsSetVisibility="true" dataSuppressedUnsetVisibility="true" + * dataExtendedMetaData="name='coordinates'" + * dataAnnotation="http://www.eclipse.org/emf/2002/GenModel get='return org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper.convertCoordinates(getCoordinates());'" + * @generated + */ +@ProviderType +public interface Point extends Geometry { + /** + * Returns the value of the 'Coordinates' containment reference. + * + * + * @return the value of the 'Coordinates' containment reference. + * @see #setCoordinates(Coordinates) + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getPoint_Coordinates() + * @model containment="true" transient="true" + * @generated + */ + Coordinates getCoordinates(); + + /** + * Sets the value of the '{@link org.eclipse.sensinact.gateway.core.geojson.Point#getCoordinates Coordinates}' containment reference. + * + * + * @param value the new value of the 'Coordinates' containment reference. + * @see #getCoordinates() + * @generated + */ + void setCoordinates(Coordinates value); + +} // Point diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Polygon.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Polygon.java new file mode 100644 index 00000000..5427cb6e --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Polygon.java @@ -0,0 +1,24 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson; + +import org.osgi.annotation.versioning.ProviderType; + +/** + * + * A representation of the model object 'Polygon'. + * + * + * + * A GeoJSON Polygone object as defined in + * the GeoJSON specification + * + * + * + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getPolygon() + * @model + * @generated + */ +@ProviderType +public interface Polygon extends Geometry, SimplePolygon { +} // Polygon diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Ring.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Ring.java new file mode 100644 index 00000000..92aad158 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/Ring.java @@ -0,0 +1,45 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +import org.osgi.annotation.versioning.ProviderType; + +/** + * + * A representation of the model object 'Ring'. + * + * + * + * Represents a List of Coordinates that follow the right-hand rule and run counterclockwise + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.Ring#getCoordinates Coordinates}
  • + *
+ * + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getRing() + * @model + * @generated + */ +@ProviderType +public interface Ring extends EObject { + /** + * Returns the value of the 'Coordinates' containment reference list. + * The list contents are of type {@link org.eclipse.sensinact.gateway.core.geojson.Coordinates}. + * + * + * @return the value of the 'Coordinates' containment reference list. + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getRing_Coordinates() + * @model containment="true" transient="true" + * @generated + */ + EList getCoordinates(); + +} // Ring diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/SimpleLineString.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/SimpleLineString.java new file mode 100644 index 00000000..a29705cf --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/SimpleLineString.java @@ -0,0 +1,44 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +import org.osgi.annotation.versioning.ProviderType; + +/** + * + * A representation of the model object 'Simple Line String'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.SimpleLineString#getCoordinates Coordinates}
  • + *
+ * + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getSimpleLineString() + * @model features="data" + * dataDataType="org.eclipse.sensinact.gateway.core.geojson.DoubleArray1D" dataMany="true" dataVolatile="true" dataSuppressedGetVisibility="true" dataSuppressedSetVisibility="true" dataSuppressedUnsetVisibility="true" + * dataExtendedMetaData="name='coordinates'" + * dataAnnotation="http://www.eclipse.org/emf/2002/GenModel get='return new org.eclipse.sensinact.gateway.core.geojson.util.GenericConvertingList<double[], Coordinates>(getCoordinates(), org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper::toCoordinates, org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper::convertCoordinates);'" + * @generated + */ +@ProviderType +public interface SimpleLineString extends EObject { + /** + * Returns the value of the 'Coordinates' containment reference list. + * The list contents are of type {@link org.eclipse.sensinact.gateway.core.geojson.Coordinates}. + * + * + * @return the value of the 'Coordinates' containment reference list. + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getSimpleLineString_Coordinates() + * @model containment="true" transient="true" + * @generated + */ + EList getCoordinates(); + +} // SimpleLineString diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/SimplePolygon.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/SimplePolygon.java new file mode 100644 index 00000000..1280b2b0 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/SimplePolygon.java @@ -0,0 +1,72 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +import org.osgi.annotation.versioning.ProviderType; + +/** + * + * A representation of the model object 'Simple Polygon'. + * + * + * + * A GeoJSON Polygone object as defined in + * the GeoJSON specification + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.SimplePolygon#getExteriorRing Exterior Ring}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.SimplePolygon#getInteriorHoles Interior Holes}
  • + *
+ * + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getSimplePolygon() + * @model features="data" + * dataDataType="org.eclipse.sensinact.gateway.core.geojson.DoubleArray3D" dataVolatile="true" dataSuppressedGetVisibility="true" dataSuppressedSetVisibility="true" dataSuppressedUnsetVisibility="true" + * dataExtendedMetaData="name='coordinates'" + * dataAnnotation="http://www.eclipse.org/emf/2002/GenModel get='double[][][] result = new double[1 + getInteriorHoles().size()][][];\nresult[0] = org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper.convertRing(getExteriorRing());\nfor (int i = 0; i < getInteriorHoles().size(); i++) {\n\tHole hole = getInteriorHoles().get(i);\n\tresult[i +1 ] = org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper.convertRing(hole);\n}\nreturn result;'" + * @generated + */ +@ProviderType +public interface SimplePolygon extends EObject { + /** + * Returns the value of the 'Exterior Ring' containment reference. + * + * + * @return the value of the 'Exterior Ring' containment reference. + * @see #setExteriorRing(Ring) + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getSimplePolygon_ExteriorRing() + * @model containment="true" transient="true" + * @generated + */ + Ring getExteriorRing(); + + /** + * Sets the value of the '{@link org.eclipse.sensinact.gateway.core.geojson.SimplePolygon#getExteriorRing Exterior Ring}' containment reference. + * + * + * @param value the new value of the 'Exterior Ring' containment reference. + * @see #getExteriorRing() + * @generated + */ + void setExteriorRing(Ring value); + + /** + * Returns the value of the 'Interior Holes' containment reference list. + * The list contents are of type {@link org.eclipse.sensinact.gateway.core.geojson.Hole}. + * + * + * @return the value of the 'Interior Holes' containment reference list. + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#getSimplePolygon_InteriorHoles() + * @model containment="true" transient="true" + * @generated + */ + EList getInteriorHoles(); + +} // SimplePolygon diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/configuration/GeoJsonConfigurationComponent.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/configuration/GeoJsonConfigurationComponent.java new file mode 100644 index 00000000..bca3c543 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/configuration/GeoJsonConfigurationComponent.java @@ -0,0 +1,124 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson.configuration; + +import java.util.Hashtable; + +import org.eclipse.emf.ecore.EFactory; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonFactory; +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage; + +import org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonPackageImpl; + +import org.gecko.emf.osgi.configurator.EPackageConfigurator; + +import org.osgi.annotation.bundle.Capability; + +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceRegistration; + +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Deactivate; + +import org.osgi.service.condition.Condition; +/** + * The PackageConfiguration for the model. + * The package will be registered into a OSGi base model registry. + * + * @generated + */ +@Component(name = "GeoJsonConfigurator") +@Capability( namespace = "osgi.service", attribute = { "objectClass:List=\"org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonResourceFactoryImpl, org.eclipse.emf.ecore.resource.Resource$Factory\"" , "uses:=\"org.eclipse.emf.ecore.resource,org.eclipse.sensinact.gateway.core.geojson.util\"" }) +@Capability( namespace = "osgi.service", attribute = { "objectClass:List=\"org.eclipse.sensinact.gateway.core.geojson.GeoJsonFactory, org.eclipse.emf.ecore.EFactory\"" , "uses:=\"org.eclipse.emf.ecore,org.eclipse.sensinact.gateway.core.geojson\"" }) +@Capability( namespace = "osgi.service", attribute = { "objectClass:List=\"org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage, org.eclipse.emf.ecore.EPackage\"" , "uses:=\"org.eclipse.emf.ecore,org.eclipse.sensinact.gateway.core.geojson\"" }) +@Capability( namespace = "osgi.service", attribute = { "objectClass:List=\"org.gecko.emf.osgi.configurator.EPackageConfigurator\"" , "uses:=\"org.eclipse.emf.ecore,org.eclipse.sensinact.gateway.core.geojson\"" }) +@Capability( namespace = "osgi.service", attribute = { "objectClass:List=\"org.osgi.service.condition.Condition\"" , "uses:=org.osgi.service.condition" }) +public class GeoJsonConfigurationComponent { + + private ServiceRegistration packageRegistration = null; + private ServiceRegistration ePackageConfiguratorRegistration = null; + private ServiceRegistration eFactoryRegistration = null; + private ServiceRegistration conditionRegistration = null; + + /** + * Activates the Configuration Component. + * + * @generated + */ + @Activate + public void activate(BundleContext ctx) { + GeoJsonPackage ePackage = GeoJsonPackageImpl.eINSTANCE; + + + GeoJsonEPackageConfigurator packageConfigurator = registerEPackageConfiguratorService(ePackage, ctx); + registerEPackageService(ePackage, packageConfigurator, ctx); + registerEFactoryService(ePackage, packageConfigurator, ctx); + registerConditionService(packageConfigurator, ctx); + } + + /** + * Registers the GeoJsonEPackageConfigurator as a service. + * + * @generated + */ + private GeoJsonEPackageConfigurator registerEPackageConfiguratorService(GeoJsonPackage ePackage, BundleContext ctx){ + GeoJsonEPackageConfigurator packageConfigurator = new GeoJsonEPackageConfigurator(ePackage); + // register the EPackageConfigurator + Hashtable properties = new Hashtable(); + properties.putAll(packageConfigurator.getServiceProperties()); + ePackageConfiguratorRegistration = ctx.registerService(EPackageConfigurator.class, packageConfigurator, properties); + + return packageConfigurator; + } + + + /** + * Registers the GeoJsonPackage as a service. + * + * @generated + */ + private void registerEPackageService(GeoJsonPackage ePackage, GeoJsonEPackageConfigurator packageConfigurator, BundleContext ctx){ + Hashtable properties = new Hashtable(); + properties.putAll(packageConfigurator.getServiceProperties()); + String[] serviceClasses = new String[] {GeoJsonPackage.class.getName(), EPackage.class.getName()}; + packageRegistration = ctx.registerService(serviceClasses, ePackage, properties); + } + + /** + * Registers the GeoJsonFactory as a service. + * + * @generated + */ + private void registerEFactoryService(GeoJsonPackage ePackage, GeoJsonEPackageConfigurator packageConfigurator, BundleContext ctx){ + Hashtable properties = new Hashtable(); + properties.putAll(packageConfigurator.getServiceProperties()); + String[] serviceClasses = new String[] {GeoJsonFactory.class.getName(), EFactory.class.getName()}; + eFactoryRegistration = ctx.registerService(serviceClasses, ePackage.getGeoJsonFactory(), properties); + } + + private void registerConditionService(GeoJsonEPackageConfigurator packageConfigurator, BundleContext ctx){ + // register the EPackage + Hashtable properties = new Hashtable(); + properties.putAll(packageConfigurator.getServiceProperties()); + properties.put(Condition.CONDITION_ID, GeoJsonPackage.eNS_URI); + conditionRegistration = ctx.registerService(Condition.class, Condition.INSTANCE, properties); + } + + /** + * Deactivates and unregisters everything. + * + * @generated + */ + @Deactivate + public void deactivate() { + conditionRegistration.unregister(); + eFactoryRegistration.unregister(); + packageRegistration.unregister(); + + ePackageConfiguratorRegistration.unregister(); + EPackage.Registry.INSTANCE.remove(GeoJsonPackage.eNS_URI); + } +} diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/configuration/GeoJsonEPackageConfigurator.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/configuration/GeoJsonEPackageConfigurator.java new file mode 100644 index 00000000..f30a3b4b --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/configuration/GeoJsonEPackageConfigurator.java @@ -0,0 +1,62 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson.configuration; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage; + +import org.gecko.emf.osgi.configurator.EPackageConfigurator; + +import org.gecko.emf.osgi.constants.EMFNamespaces; + +/** + * + * The EPackageConfiguration and ResourceFactoryConfigurator for the model. + * The package will be registered into a OSGi base model registry. + * + * @see EPackageConfigurator + * @generated + */ +public class GeoJsonEPackageConfigurator implements EPackageConfigurator { + + private GeoJsonPackage ePackage; + + protected GeoJsonEPackageConfigurator(GeoJsonPackage ePackage){ + this.ePackage = ePackage; + } + + /** + * (non-Javadoc) + * @see org.gecko.emf.osgi.EPackageRegistryConfigurator#configureEPackage(org.eclipse.emf.ecore.EPackage.Registry) + * @generated + */ + @Override + public void configureEPackage(org.eclipse.emf.ecore.EPackage.Registry registry) { + registry.put(GeoJsonPackage.eNS_URI, ePackage); + } + + /** + * (non-Javadoc) + * @see org.gecko.emf.osgi.EPackageRegistryConfigurator#unconfigureEPackage(org.eclipse.emf.ecore.EPackage.Registry) + * @generated + */ + @Override + public void unconfigureEPackage(org.eclipse.emf.ecore.EPackage.Registry registry) { + registry.remove(GeoJsonPackage.eNS_URI); + } + + /** + * A method providing the Properties the services around this Model should be registered with. + * @generated + */ + public Map getServiceProperties() { + Map properties = new HashMap(); + properties.put(EMFNamespaces.EMF_MODEL_NAME, GeoJsonPackage.eNAME); + properties.put(EMFNamespaces.EMF_MODEL_NSURI, GeoJsonPackage.eNS_URI); + properties.put(EMFNamespaces.EMF_MODEL_FILE_EXT, "geojson"); + properties.put(EMFNamespaces.EMF_MODEL_VERSION, "1.0"); + return properties; + } +} \ No newline at end of file diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/CoordinatesImpl.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/CoordinatesImpl.java new file mode 100644 index 00000000..0ccba5b4 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/CoordinatesImpl.java @@ -0,0 +1,277 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson.impl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.sensinact.gateway.core.geojson.Coordinates; +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage; + +/** + * + * An implementation of the model object 'Coordinates'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.CoordinatesImpl#getLongitude Longitude}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.CoordinatesImpl#getLatitude Latitude}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.CoordinatesImpl#getElevation Elevation}
  • + *
+ * + * @generated + */ +public class CoordinatesImpl extends MinimalEObjectImpl.Container implements Coordinates { + /** + * The default value of the '{@link #getLongitude() Longitude}' attribute. + * + * + * @see #getLongitude() + * @generated + * @ordered + */ + protected static final double LONGITUDE_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getLongitude() Longitude}' attribute. + * + * + * @see #getLongitude() + * @generated + * @ordered + */ + protected double longitude = LONGITUDE_EDEFAULT; + + /** + * The default value of the '{@link #getLatitude() Latitude}' attribute. + * + * + * @see #getLatitude() + * @generated + * @ordered + */ + protected static final double LATITUDE_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getLatitude() Latitude}' attribute. + * + * + * @see #getLatitude() + * @generated + * @ordered + */ + protected double latitude = LATITUDE_EDEFAULT; + + /** + * The default value of the '{@link #getElevation() Elevation}' attribute. + * + * + * @see #getElevation() + * @generated + * @ordered + */ + protected static final double ELEVATION_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getElevation() Elevation}' attribute. + * + * + * @see #getElevation() + * @generated + * @ordered + */ + protected double elevation = ELEVATION_EDEFAULT; + + /** + * + * + * @generated + */ + public CoordinatesImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return GeoJsonPackage.Literals.COORDINATES; + } + + /** + * + * + * @generated + */ + @Override + public double getLongitude() { + return longitude; + } + + /** + * + * + * @generated + */ + @Override + public void setLongitude(double newLongitude) { + double oldLongitude = longitude; + longitude = newLongitude; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GeoJsonPackage.COORDINATES__LONGITUDE, oldLongitude, longitude)); + } + + /** + * + * + * @generated + */ + @Override + public double getLatitude() { + return latitude; + } + + /** + * + * + * @generated + */ + @Override + public void setLatitude(double newLatitude) { + double oldLatitude = latitude; + latitude = newLatitude; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GeoJsonPackage.COORDINATES__LATITUDE, oldLatitude, latitude)); + } + + /** + * + * + * @generated + */ + @Override + public double getElevation() { + return elevation; + } + + /** + * + * + * @generated + */ + @Override + public void setElevation(double newElevation) { + double oldElevation = elevation; + elevation = newElevation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GeoJsonPackage.COORDINATES__ELEVATION, oldElevation, elevation)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GeoJsonPackage.COORDINATES__LONGITUDE: + return getLongitude(); + case GeoJsonPackage.COORDINATES__LATITUDE: + return getLatitude(); + case GeoJsonPackage.COORDINATES__ELEVATION: + return getElevation(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GeoJsonPackage.COORDINATES__LONGITUDE: + setLongitude((Double)newValue); + return; + case GeoJsonPackage.COORDINATES__LATITUDE: + setLatitude((Double)newValue); + return; + case GeoJsonPackage.COORDINATES__ELEVATION: + setElevation((Double)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GeoJsonPackage.COORDINATES__LONGITUDE: + setLongitude(LONGITUDE_EDEFAULT); + return; + case GeoJsonPackage.COORDINATES__LATITUDE: + setLatitude(LATITUDE_EDEFAULT); + return; + case GeoJsonPackage.COORDINATES__ELEVATION: + setElevation(ELEVATION_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GeoJsonPackage.COORDINATES__LONGITUDE: + return longitude != LONGITUDE_EDEFAULT; + case GeoJsonPackage.COORDINATES__LATITUDE: + return latitude != LATITUDE_EDEFAULT; + case GeoJsonPackage.COORDINATES__ELEVATION: + return elevation != ELEVATION_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (longitude: "); + result.append(longitude); + result.append(", latitude: "); + result.append(latitude); + result.append(", elevation: "); + result.append(elevation); + result.append(')'); + return result.toString(); + } + +} //CoordinatesImpl diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/FeatureCollectionImpl.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/FeatureCollectionImpl.java new file mode 100644 index 00000000..1954d8bf --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/FeatureCollectionImpl.java @@ -0,0 +1,151 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import org.eclipse.sensinact.gateway.core.geojson.Feature; +import org.eclipse.sensinact.gateway.core.geojson.FeatureCollection; +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage; + +/** + * + * An implementation of the model object 'Feature Collection'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.FeatureCollectionImpl#getFeatures Features}
  • + *
+ * + * @generated + */ +public class FeatureCollectionImpl extends GeoJsonObjectImpl implements FeatureCollection { + /** + * The cached value of the '{@link #getFeatures() Features}' containment reference list. + * + * + * @see #getFeatures() + * @generated + * @ordered + */ + protected EList features; + + /** + * + * + * @generated + */ + public FeatureCollectionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return GeoJsonPackage.Literals.FEATURE_COLLECTION; + } + + /** + * + * + * @generated + */ + @Override + public EList getFeatures() { + if (features == null) { + features = new EObjectContainmentEList(Feature.class, this, GeoJsonPackage.FEATURE_COLLECTION__FEATURES); + } + return features; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case GeoJsonPackage.FEATURE_COLLECTION__FEATURES: + return ((InternalEList)getFeatures()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GeoJsonPackage.FEATURE_COLLECTION__FEATURES: + return getFeatures(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GeoJsonPackage.FEATURE_COLLECTION__FEATURES: + getFeatures().clear(); + getFeatures().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GeoJsonPackage.FEATURE_COLLECTION__FEATURES: + getFeatures().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GeoJsonPackage.FEATURE_COLLECTION__FEATURES: + return features != null && !features.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //FeatureCollectionImpl diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/FeatureImpl.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/FeatureImpl.java new file mode 100644 index 00000000..9bedac80 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/FeatureImpl.java @@ -0,0 +1,316 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.sensinact.gateway.core.geojson.Feature; +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage; +import org.eclipse.sensinact.gateway.core.geojson.Geometry; + +/** + * + * An implementation of the model object 'Feature'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.FeatureImpl#getId Id}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.FeatureImpl#getGeometry Geometry}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.FeatureImpl#getProperties Properties}
  • + *
+ * + * @generated + */ +public class FeatureImpl extends GeoJsonObjectImpl implements Feature { + /** + * The default value of the '{@link #getId() Id}' attribute. + * + * + * @see #getId() + * @generated + * @ordered + */ + protected static final String ID_EDEFAULT = null; + + /** + * The cached value of the '{@link #getId() Id}' attribute. + * + * + * @see #getId() + * @generated + * @ordered + */ + protected String id = ID_EDEFAULT; + + /** + * The cached value of the '{@link #getGeometry() Geometry}' containment reference. + * + * + * @see #getGeometry() + * @generated + * @ordered + */ + protected Geometry geometry; + + /** + * The cached value of the '{@link #getProperties() Properties}' containment reference. + * + * + * @see #getProperties() + * @generated + * @ordered + */ + protected EObject properties; + + /** + * + * + * @generated + */ + public FeatureImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return GeoJsonPackage.Literals.FEATURE; + } + + /** + * + * + * @generated + */ + @Override + public String getId() { + return id; + } + + /** + * + * + * @generated + */ + @Override + public void setId(String newId) { + String oldId = id; + id = newId; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GeoJsonPackage.FEATURE__ID, oldId, id)); + } + + /** + * + * + * @generated + */ + @Override + public Geometry getGeometry() { + return geometry; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetGeometry(Geometry newGeometry, NotificationChain msgs) { + Geometry oldGeometry = geometry; + geometry = newGeometry; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GeoJsonPackage.FEATURE__GEOMETRY, oldGeometry, newGeometry); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setGeometry(Geometry newGeometry) { + if (newGeometry != geometry) { + NotificationChain msgs = null; + if (geometry != null) + msgs = ((InternalEObject)geometry).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GeoJsonPackage.FEATURE__GEOMETRY, null, msgs); + if (newGeometry != null) + msgs = ((InternalEObject)newGeometry).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GeoJsonPackage.FEATURE__GEOMETRY, null, msgs); + msgs = basicSetGeometry(newGeometry, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GeoJsonPackage.FEATURE__GEOMETRY, newGeometry, newGeometry)); + } + + /** + * + * + * @generated + */ + @Override + public EObject getProperties() { + return properties; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetProperties(EObject newProperties, NotificationChain msgs) { + EObject oldProperties = properties; + properties = newProperties; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GeoJsonPackage.FEATURE__PROPERTIES, oldProperties, newProperties); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setProperties(EObject newProperties) { + if (newProperties != properties) { + NotificationChain msgs = null; + if (properties != null) + msgs = ((InternalEObject)properties).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GeoJsonPackage.FEATURE__PROPERTIES, null, msgs); + if (newProperties != null) + msgs = ((InternalEObject)newProperties).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GeoJsonPackage.FEATURE__PROPERTIES, null, msgs); + msgs = basicSetProperties(newProperties, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GeoJsonPackage.FEATURE__PROPERTIES, newProperties, newProperties)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case GeoJsonPackage.FEATURE__GEOMETRY: + return basicSetGeometry(null, msgs); + case GeoJsonPackage.FEATURE__PROPERTIES: + return basicSetProperties(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GeoJsonPackage.FEATURE__ID: + return getId(); + case GeoJsonPackage.FEATURE__GEOMETRY: + return getGeometry(); + case GeoJsonPackage.FEATURE__PROPERTIES: + return getProperties(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GeoJsonPackage.FEATURE__ID: + setId((String)newValue); + return; + case GeoJsonPackage.FEATURE__GEOMETRY: + setGeometry((Geometry)newValue); + return; + case GeoJsonPackage.FEATURE__PROPERTIES: + setProperties((EObject)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GeoJsonPackage.FEATURE__ID: + setId(ID_EDEFAULT); + return; + case GeoJsonPackage.FEATURE__GEOMETRY: + setGeometry((Geometry)null); + return; + case GeoJsonPackage.FEATURE__PROPERTIES: + setProperties((EObject)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GeoJsonPackage.FEATURE__ID: + return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); + case GeoJsonPackage.FEATURE__GEOMETRY: + return geometry != null; + case GeoJsonPackage.FEATURE__PROPERTIES: + return properties != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (id: "); + result.append(id); + result.append(')'); + return result.toString(); + } + +} //FeatureImpl diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/GeoJsonFactoryImpl.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/GeoJsonFactoryImpl.java new file mode 100644 index 00000000..b631a486 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/GeoJsonFactoryImpl.java @@ -0,0 +1,473 @@ +/** + */ +package org.eclipse.sensinact.gateway.core.geojson.impl; + +import java.util.Map.Entry; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +import org.eclipse.sensinact.gateway.core.geojson.*; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class GeoJsonFactoryImpl extends EFactoryImpl implements GeoJsonFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static GeoJsonFactory init() { + try { + GeoJsonFactory theGeoJsonFactory = (GeoJsonFactory)EPackage.Registry.INSTANCE.getEFactory(GeoJsonPackage.eNS_URI); + if (theGeoJsonFactory != null) { + return theGeoJsonFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new GeoJsonFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public GeoJsonFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case GeoJsonPackage.COORDINATES: return createCoordinates(); + case GeoJsonPackage.POINT: return createPoint(); + case GeoJsonPackage.GEO_JSON_OBJECT: return createGeoJsonObject(); + case GeoJsonPackage.PROPERTIES_ENTRY: return (EObject)createPropertiesEntry(); + case GeoJsonPackage.LINE_STRING: return createLineString(); + case GeoJsonPackage.SIMPLE_LINE_STRING: return createSimpleLineString(); + case GeoJsonPackage.FEATURE: return createFeature(); + case GeoJsonPackage.FEATURE_COLLECTION: return createFeatureCollection(); + case GeoJsonPackage.GEOMETRY_COLLECTION: return createGeometryCollection(); + case GeoJsonPackage.MULTI_POINT: return createMultiPoint(); + case GeoJsonPackage.POLYGON: return createPolygon(); + case GeoJsonPackage.RING: return createRing(); + case GeoJsonPackage.HOLE: return createHole(); + case GeoJsonPackage.MULTI_POLYGON: return createMultiPolygon(); + case GeoJsonPackage.SIMPLE_POLYGON: return createSimplePolygon(); + case GeoJsonPackage.MULTI_LINE_STRING: return createMultiLineString(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public Object createFromString(EDataType eDataType, String initialValue) { + switch (eDataType.getClassifierID()) { + case GeoJsonPackage.DOUBLE_ARRAY1_D: + return createDoubleArray1DFromString(eDataType, initialValue); + case GeoJsonPackage.DOUBLE_ARRAY2_D: + return createDoubleArray2DFromString(eDataType, initialValue); + case GeoJsonPackage.DOUBLE_ARRAY3_D: + return createDoubleArray3DFromString(eDataType, initialValue); + case GeoJsonPackage.DOUBLE_ARRAY4_D: + return createDoubleArray4DFromString(eDataType, initialValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public String convertToString(EDataType eDataType, Object instanceValue) { + switch (eDataType.getClassifierID()) { + case GeoJsonPackage.DOUBLE_ARRAY1_D: + return convertDoubleArray1DToString(eDataType, instanceValue); + case GeoJsonPackage.DOUBLE_ARRAY2_D: + return convertDoubleArray2DToString(eDataType, instanceValue); + case GeoJsonPackage.DOUBLE_ARRAY3_D: + return convertDoubleArray3DToString(eDataType, instanceValue); + case GeoJsonPackage.DOUBLE_ARRAY4_D: + return convertDoubleArray4DToString(eDataType, instanceValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public Coordinates createCoordinates() { + CoordinatesImpl coordinates = new CoordinatesImpl(); + return coordinates; + } + + /** + * + * + * @generated + */ + @Override + public Point createPoint() { + PointImpl point = new PointImpl(); + return point; + } + + /** + * + * + * @generated + */ + @Override + public GeoJsonObject createGeoJsonObject() { + GeoJsonObjectImpl geoJsonObject = new GeoJsonObjectImpl(); + return geoJsonObject; + } + + /** + * + * + * @generated + */ + public Entry createPropertiesEntry() { + PropertiesEntryImpl propertiesEntry = new PropertiesEntryImpl(); + return propertiesEntry; + } + + /** + * + * + * @generated + */ + @Override + public LineString createLineString() { + LineStringImpl lineString = new LineStringImpl(); + return lineString; + } + + /** + * + * + * @generated + */ + @Override + public SimpleLineString createSimpleLineString() { + SimpleLineStringImpl simpleLineString = new SimpleLineStringImpl(); + return simpleLineString; + } + + /** + * + * + * @generated + */ + @Override + public Feature createFeature() { + FeatureImpl feature = new FeatureImpl(); + return feature; + } + + /** + * + * + * @generated + */ + @Override + public FeatureCollection createFeatureCollection() { + FeatureCollectionImpl featureCollection = new FeatureCollectionImpl(); + return featureCollection; + } + + /** + * + * + * @generated + */ + @Override + public GeometryCollection createGeometryCollection() { + GeometryCollectionImpl geometryCollection = new GeometryCollectionImpl(); + return geometryCollection; + } + + /** + * + * + * @generated + */ + @Override + public MultiPoint createMultiPoint() { + MultiPointImpl multiPoint = new MultiPointImpl(); + return multiPoint; + } + + /** + * + * + * @generated + */ + @Override + public Polygon createPolygon() { + PolygonImpl polygon = new PolygonImpl(); + return polygon; + } + + /** + * + * + * @generated + */ + @Override + public Ring createRing() { + RingImpl ring = new RingImpl(); + return ring; + } + + /** + * + * + * @generated + */ + @Override + public Hole createHole() { + HoleImpl hole = new HoleImpl(); + return hole; + } + + /** + * + * + * @generated + */ + @Override + public MultiPolygon createMultiPolygon() { + MultiPolygonImpl multiPolygon = new MultiPolygonImpl(); + return multiPolygon; + } + + /** + * + * + * @generated + */ + @Override + public SimplePolygon createSimplePolygon() { + SimplePolygonImpl simplePolygon = new SimplePolygonImpl(); + return simplePolygon; + } + + /** + * + * + * @generated + */ + @Override + public MultiLineString createMultiLineString() { + MultiLineStringImpl multiLineString = new MultiLineStringImpl(); + return multiLineString; + } + + /** + * + * + * @generated + */ + @Override + public double[] createDoubleArray1D(String literal) { + return (double[])super.createFromString(literal); + } + + /** + * + * + * @generated + */ + public double[] createDoubleArray1DFromString(EDataType eDataType, String initialValue) { + return createDoubleArray1D(initialValue); + } + + /** + * + * + * @generated + */ + @Override + public String convertDoubleArray1D(double[] instanceValue) { + return super.convertToString(instanceValue); + } + + /** + * + * + * @generated + */ + public String convertDoubleArray1DToString(EDataType eDataType, Object instanceValue) { + return convertDoubleArray1D((double[])instanceValue); + } + + /** + * + * + * @generated + */ + @Override + public double[][] createDoubleArray2D(String literal) { + return (double[][])super.createFromString(literal); + } + + /** + * + * + * @generated + */ + public double[][] createDoubleArray2DFromString(EDataType eDataType, String initialValue) { + return createDoubleArray2D(initialValue); + } + + /** + * + * + * @generated + */ + @Override + public String convertDoubleArray2D(double[][] instanceValue) { + return super.convertToString(instanceValue); + } + + /** + * + * + * @generated + */ + public String convertDoubleArray2DToString(EDataType eDataType, Object instanceValue) { + return convertDoubleArray2D((double[][])instanceValue); + } + + /** + * + * + * @generated + */ + @Override + public double[][][] createDoubleArray3D(String literal) { + return (double[][][])super.createFromString(literal); + } + + /** + * + * + * @generated + */ + public double[][][] createDoubleArray3DFromString(EDataType eDataType, String initialValue) { + return createDoubleArray3D(initialValue); + } + + /** + * + * + * @generated + */ + @Override + public String convertDoubleArray3D(double[][][] instanceValue) { + return super.convertToString(instanceValue); + } + + /** + * + * + * @generated + */ + public String convertDoubleArray3DToString(EDataType eDataType, Object instanceValue) { + return convertDoubleArray3D((double[][][])instanceValue); + } + + /** + * + * + * @generated + */ + @Override + public double[][][][] createDoubleArray4D(String literal) { + return (double[][][][])super.createFromString(literal); + } + + /** + * + * + * @generated + */ + public double[][][][] createDoubleArray4DFromString(EDataType eDataType, String initialValue) { + return createDoubleArray4D(initialValue); + } + + /** + * + * + * @generated + */ + @Override + public String convertDoubleArray4D(double[][][][] instanceValue) { + return super.convertToString(instanceValue); + } + + /** + * + * + * @generated + */ + public String convertDoubleArray4DToString(EDataType eDataType, Object instanceValue) { + return convertDoubleArray4D((double[][][][])instanceValue); + } + + /** + * + * + * @generated + */ + @Override + public GeoJsonPackage getGeoJsonPackage() { + return (GeoJsonPackage)getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static GeoJsonPackage getPackage() { + return GeoJsonPackage.eINSTANCE; + } + +} //GeoJsonFactoryImpl diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/GeoJsonObjectImpl.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/GeoJsonObjectImpl.java new file mode 100644 index 00000000..d8ef662c --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/GeoJsonObjectImpl.java @@ -0,0 +1,174 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import org.eclipse.sensinact.gateway.core.geojson.Coordinates; +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonObject; +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage; + +/** + * + * An implementation of the model object 'Object'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonObjectImpl#getBbox Bbox}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.GeoJsonObjectImpl#getBoundingBox Bounding Box}
  • + *
+ * + * @generated + */ +public class GeoJsonObjectImpl extends MinimalEObjectImpl.Container implements GeoJsonObject { + /** + * The cached value of the '{@link #getBoundingBox() Bounding Box}' containment reference list. + * + * + * @see #getBoundingBox() + * @generated + * @ordered + */ + protected EList boundingBox; + + /** + * + * + * @generated + */ + public GeoJsonObjectImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return GeoJsonPackage.Literals.GEO_JSON_OBJECT; + } + + /** + * + * + * @generated + */ + public EList getBbox() { + return new org.eclipse.sensinact.gateway.core.geojson.util.GenericConvertingList(getBoundingBox(), org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper::toCoordinates, org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper::convertCoordinates); + } + + /** + * + * + * @generated + */ + @Override + public EList getBoundingBox() { + if (boundingBox == null) { + boundingBox = new EObjectContainmentEList(Coordinates.class, this, GeoJsonPackage.GEO_JSON_OBJECT__BOUNDING_BOX); + } + return boundingBox; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case GeoJsonPackage.GEO_JSON_OBJECT__BOUNDING_BOX: + return ((InternalEList)getBoundingBox()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GeoJsonPackage.GEO_JSON_OBJECT__BBOX: + return getBbox(); + case GeoJsonPackage.GEO_JSON_OBJECT__BOUNDING_BOX: + return getBoundingBox(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GeoJsonPackage.GEO_JSON_OBJECT__BBOX: + getBbox().clear(); + getBbox().addAll((Collection)newValue); + return; + case GeoJsonPackage.GEO_JSON_OBJECT__BOUNDING_BOX: + getBoundingBox().clear(); + getBoundingBox().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GeoJsonPackage.GEO_JSON_OBJECT__BBOX: + getBbox().clear(); + return; + case GeoJsonPackage.GEO_JSON_OBJECT__BOUNDING_BOX: + getBoundingBox().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GeoJsonPackage.GEO_JSON_OBJECT__BBOX: + return !getBbox().isEmpty(); + case GeoJsonPackage.GEO_JSON_OBJECT__BOUNDING_BOX: + return boundingBox != null && !boundingBox.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //GeoJsonObjectImpl diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/GeoJsonPackageImpl.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/GeoJsonPackageImpl.java new file mode 100644 index 00000000..313d24db --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/GeoJsonPackageImpl.java @@ -0,0 +1,1234 @@ +/** + */ +package org.eclipse.sensinact.gateway.core.geojson.impl; + +import java.util.Map.Entry; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EOperation; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +import org.eclipse.sensinact.gateway.core.geojson.Coordinates; +import org.eclipse.sensinact.gateway.core.geojson.Feature; +import org.eclipse.sensinact.gateway.core.geojson.FeatureCollection; +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonFactory; +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonObject; +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage; +import org.eclipse.sensinact.gateway.core.geojson.Geometry; +import org.eclipse.sensinact.gateway.core.geojson.GeometryCollection; +import org.eclipse.sensinact.gateway.core.geojson.Hole; +import org.eclipse.sensinact.gateway.core.geojson.LineString; +import org.eclipse.sensinact.gateway.core.geojson.MultiLineString; +import org.eclipse.sensinact.gateway.core.geojson.MultiPoint; +import org.eclipse.sensinact.gateway.core.geojson.MultiPolygon; +import org.eclipse.sensinact.gateway.core.geojson.Point; +import org.eclipse.sensinact.gateway.core.geojson.Polygon; +import org.eclipse.sensinact.gateway.core.geojson.Ring; +import org.eclipse.sensinact.gateway.core.geojson.SimpleLineString; +import org.eclipse.sensinact.gateway.core.geojson.SimplePolygon; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class GeoJsonPackageImpl extends EPackageImpl implements GeoJsonPackage { + /** + * + * + * @generated + */ + private EClass coordinatesEClass = null; + + /** + * + * + * @generated + */ + private EClass pointEClass = null; + + /** + * + * + * @generated + */ + private EClass geoJsonObjectEClass = null; + + /** + * + * + * @generated + */ + private EClass propertiesEntryEClass = null; + + /** + * + * + * @generated + */ + private EClass geometryEClass = null; + + /** + * + * + * @generated + */ + private EClass lineStringEClass = null; + + /** + * + * + * @generated + */ + private EClass simpleLineStringEClass = null; + + /** + * + * + * @generated + */ + private EClass featureEClass = null; + + /** + * + * + * @generated + */ + private EClass featureCollectionEClass = null; + + /** + * + * + * @generated + */ + private EClass geometryCollectionEClass = null; + + /** + * + * + * @generated + */ + private EClass multiPointEClass = null; + + /** + * + * + * @generated + */ + private EClass polygonEClass = null; + + /** + * + * + * @generated + */ + private EClass ringEClass = null; + + /** + * + * + * @generated + */ + private EClass holeEClass = null; + + /** + * + * + * @generated + */ + private EClass multiPolygonEClass = null; + + /** + * + * + * @generated + */ + private EClass simplePolygonEClass = null; + + /** + * + * + * @generated + */ + private EClass multiLineStringEClass = null; + + /** + * + * + * @generated + */ + private EDataType doubleArray1DEDataType = null; + + /** + * + * + * @generated + */ + private EDataType doubleArray2DEDataType = null; + + /** + * + * + * @generated + */ + private EDataType doubleArray3DEDataType = null; + + /** + * + * + * @generated + */ + private EDataType doubleArray4DEDataType = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage#eNS_URI + * @see #init() + * @generated + */ + private GeoJsonPackageImpl() { + super(eNS_URI, GeoJsonFactory.eINSTANCE); + } + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

This method is used to initialize {@link GeoJsonPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static GeoJsonPackage init() { + if (isInited) return (GeoJsonPackage)EPackage.Registry.INSTANCE.getEPackage(GeoJsonPackage.eNS_URI); + + // Obtain or create and register package + Object registeredGeoJsonPackage = EPackage.Registry.INSTANCE.get(eNS_URI); + GeoJsonPackageImpl theGeoJsonPackage = registeredGeoJsonPackage instanceof GeoJsonPackageImpl ? (GeoJsonPackageImpl)registeredGeoJsonPackage : new GeoJsonPackageImpl(); + + isInited = true; + + // Create package meta-data objects + theGeoJsonPackage.createPackageContents(); + + // Initialize created meta-data + theGeoJsonPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theGeoJsonPackage.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(GeoJsonPackage.eNS_URI, theGeoJsonPackage); + return theGeoJsonPackage; + } + + /** + * + * + * @generated + */ + @Override + public EClass getCoordinates() { + return coordinatesEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCoordinates_Longitude() { + return (EAttribute)coordinatesEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCoordinates_Latitude() { + return (EAttribute)coordinatesEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCoordinates_Elevation() { + return (EAttribute)coordinatesEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getPoint() { + return pointEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getPoint_Data() { + return (EAttribute)pointEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getPoint_Coordinates() { + return (EReference)pointEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EOperation getPoint__SetData__double() { + return pointEClass.getEOperations().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getGeoJsonObject() { + return geoJsonObjectEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getGeoJsonObject_Bbox() { + return (EAttribute)geoJsonObjectEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getGeoJsonObject_BoundingBox() { + return (EReference)geoJsonObjectEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getPropertiesEntry() { + return propertiesEntryEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getPropertiesEntry_Key() { + return (EAttribute)propertiesEntryEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getPropertiesEntry_Value() { + return (EAttribute)propertiesEntryEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getGeometry() { + return geometryEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getLineString() { + return lineStringEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getSimpleLineString() { + return simpleLineStringEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getSimpleLineString_Data() { + return (EAttribute)simpleLineStringEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getSimpleLineString_Coordinates() { + return (EReference)simpleLineStringEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getFeature() { + return featureEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getFeature_Id() { + return (EAttribute)featureEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getFeature_Geometry() { + return (EReference)featureEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getFeature_Properties() { + return (EReference)featureEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getFeatureCollection() { + return featureCollectionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getFeatureCollection_Features() { + return (EReference)featureCollectionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getGeometryCollection() { + return geometryCollectionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getGeometryCollection_Geometries() { + return (EReference)geometryCollectionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getMultiPoint() { + return multiPointEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getMultiPoint_Data() { + return (EAttribute)multiPointEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getMultiPoint_Coordinates() { + return (EReference)multiPointEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getPolygon() { + return polygonEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getRing() { + return ringEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getRing_Coordinates() { + return (EReference)ringEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getHole() { + return holeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getMultiPolygon() { + return multiPolygonEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getMultiPolygon_Data() { + return (EAttribute)multiPolygonEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getMultiPolygon_Polygons() { + return (EReference)multiPolygonEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EOperation getMultiPolygon__SetData__double() { + return multiPolygonEClass.getEOperations().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getSimplePolygon() { + return simplePolygonEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getSimplePolygon_Data() { + return (EAttribute)simplePolygonEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getSimplePolygon_ExteriorRing() { + return (EReference)simplePolygonEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getSimplePolygon_InteriorHoles() { + return (EReference)simplePolygonEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EOperation getSimplePolygon__SetData__double() { + return simplePolygonEClass.getEOperations().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getMultiLineString() { + return multiLineStringEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getMultiLineString_Data() { + return (EAttribute)multiLineStringEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getMultiLineString_LinesStrings() { + return (EReference)multiLineStringEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EOperation getMultiLineString__SetData__double() { + return multiLineStringEClass.getEOperations().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EDataType getDoubleArray1D() { + return doubleArray1DEDataType; + } + + /** + * + * + * @generated + */ + @Override + public EDataType getDoubleArray2D() { + return doubleArray2DEDataType; + } + + /** + * + * + * @generated + */ + @Override + public EDataType getDoubleArray3D() { + return doubleArray3DEDataType; + } + + /** + * + * + * @generated + */ + @Override + public EDataType getDoubleArray4D() { + return doubleArray4DEDataType; + } + + /** + * + * + * @generated + */ + @Override + public GeoJsonFactory getGeoJsonFactory() { + return (GeoJsonFactory)getEFactoryInstance(); + } + + /** + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void createPackageContents() { + if (isCreated) return; + isCreated = true; + + // Create classes and their features + coordinatesEClass = createEClass(COORDINATES); + createEAttribute(coordinatesEClass, COORDINATES__LONGITUDE); + createEAttribute(coordinatesEClass, COORDINATES__LATITUDE); + createEAttribute(coordinatesEClass, COORDINATES__ELEVATION); + + pointEClass = createEClass(POINT); + createEAttribute(pointEClass, POINT__DATA); + createEReference(pointEClass, POINT__COORDINATES); + createEOperation(pointEClass, POINT___SET_DATA__DOUBLE); + + geoJsonObjectEClass = createEClass(GEO_JSON_OBJECT); + createEAttribute(geoJsonObjectEClass, GEO_JSON_OBJECT__BBOX); + createEReference(geoJsonObjectEClass, GEO_JSON_OBJECT__BOUNDING_BOX); + + propertiesEntryEClass = createEClass(PROPERTIES_ENTRY); + createEAttribute(propertiesEntryEClass, PROPERTIES_ENTRY__KEY); + createEAttribute(propertiesEntryEClass, PROPERTIES_ENTRY__VALUE); + + geometryEClass = createEClass(GEOMETRY); + + lineStringEClass = createEClass(LINE_STRING); + + simpleLineStringEClass = createEClass(SIMPLE_LINE_STRING); + createEAttribute(simpleLineStringEClass, SIMPLE_LINE_STRING__DATA); + createEReference(simpleLineStringEClass, SIMPLE_LINE_STRING__COORDINATES); + + featureEClass = createEClass(FEATURE); + createEAttribute(featureEClass, FEATURE__ID); + createEReference(featureEClass, FEATURE__GEOMETRY); + createEReference(featureEClass, FEATURE__PROPERTIES); + + featureCollectionEClass = createEClass(FEATURE_COLLECTION); + createEReference(featureCollectionEClass, FEATURE_COLLECTION__FEATURES); + + geometryCollectionEClass = createEClass(GEOMETRY_COLLECTION); + createEReference(geometryCollectionEClass, GEOMETRY_COLLECTION__GEOMETRIES); + + multiPointEClass = createEClass(MULTI_POINT); + createEAttribute(multiPointEClass, MULTI_POINT__DATA); + createEReference(multiPointEClass, MULTI_POINT__COORDINATES); + + polygonEClass = createEClass(POLYGON); + + ringEClass = createEClass(RING); + createEReference(ringEClass, RING__COORDINATES); + + holeEClass = createEClass(HOLE); + + multiPolygonEClass = createEClass(MULTI_POLYGON); + createEAttribute(multiPolygonEClass, MULTI_POLYGON__DATA); + createEReference(multiPolygonEClass, MULTI_POLYGON__POLYGONS); + createEOperation(multiPolygonEClass, MULTI_POLYGON___SET_DATA__DOUBLE); + + simplePolygonEClass = createEClass(SIMPLE_POLYGON); + createEAttribute(simplePolygonEClass, SIMPLE_POLYGON__DATA); + createEReference(simplePolygonEClass, SIMPLE_POLYGON__EXTERIOR_RING); + createEReference(simplePolygonEClass, SIMPLE_POLYGON__INTERIOR_HOLES); + createEOperation(simplePolygonEClass, SIMPLE_POLYGON___SET_DATA__DOUBLE); + + multiLineStringEClass = createEClass(MULTI_LINE_STRING); + createEAttribute(multiLineStringEClass, MULTI_LINE_STRING__DATA); + createEReference(multiLineStringEClass, MULTI_LINE_STRING__LINES_STRINGS); + createEOperation(multiLineStringEClass, MULTI_LINE_STRING___SET_DATA__DOUBLE); + + // Create data types + doubleArray1DEDataType = createEDataType(DOUBLE_ARRAY1_D); + doubleArray2DEDataType = createEDataType(DOUBLE_ARRAY2_D); + doubleArray3DEDataType = createEDataType(DOUBLE_ARRAY3_D); + doubleArray4DEDataType = createEDataType(DOUBLE_ARRAY4_D); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + pointEClass.getESuperTypes().add(this.getGeometry()); + geometryEClass.getESuperTypes().add(this.getGeoJsonObject()); + lineStringEClass.getESuperTypes().add(this.getGeometry()); + lineStringEClass.getESuperTypes().add(this.getSimpleLineString()); + featureEClass.getESuperTypes().add(this.getGeoJsonObject()); + featureCollectionEClass.getESuperTypes().add(this.getGeoJsonObject()); + geometryCollectionEClass.getESuperTypes().add(this.getGeometry()); + multiPointEClass.getESuperTypes().add(this.getGeometry()); + polygonEClass.getESuperTypes().add(this.getGeometry()); + polygonEClass.getESuperTypes().add(this.getSimplePolygon()); + holeEClass.getESuperTypes().add(this.getRing()); + multiPolygonEClass.getESuperTypes().add(this.getGeometry()); + multiLineStringEClass.getESuperTypes().add(this.getGeometry()); + + // Initialize classes, features, and operations; add parameters + initEClass(coordinatesEClass, Coordinates.class, "Coordinates", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getCoordinates_Longitude(), ecorePackage.getEDouble(), "longitude", null, 1, 1, Coordinates.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getCoordinates_Latitude(), ecorePackage.getEDouble(), "latitude", null, 1, 1, Coordinates.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getCoordinates_Elevation(), ecorePackage.getEDouble(), "elevation", "0.0d", 0, 1, Coordinates.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(pointEClass, Point.class, "Point", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getPoint_Data(), this.getDoubleArray1D(), "data", null, 0, 1, Point.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getPoint_Coordinates(), this.getCoordinates(), null, "coordinates", null, 0, 1, Point.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + EOperation op = initEOperation(getPoint__SetData__double(), null, "setData", 0, 1, IS_UNIQUE, IS_ORDERED); + addEParameter(op, this.getDoubleArray1D(), "data", 0, 1, IS_UNIQUE, IS_ORDERED); + + initEClass(geoJsonObjectEClass, GeoJsonObject.class, "GeoJsonObject", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getGeoJsonObject_Bbox(), this.getDoubleArray1D(), "bbox", null, 0, -1, GeoJsonObject.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getGeoJsonObject_BoundingBox(), this.getCoordinates(), null, "boundingBox", null, 0, -1, GeoJsonObject.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(propertiesEntryEClass, Entry.class, "PropertiesEntry", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getPropertiesEntry_Key(), ecorePackage.getEString(), "key", null, 1, 1, Entry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getPropertiesEntry_Value(), ecorePackage.getEJavaObject(), "value", null, 1, 1, Entry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(geometryEClass, Geometry.class, "Geometry", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(lineStringEClass, LineString.class, "LineString", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(simpleLineStringEClass, SimpleLineString.class, "SimpleLineString", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getSimpleLineString_Data(), this.getDoubleArray1D(), "data", null, 0, -1, SimpleLineString.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getSimpleLineString_Coordinates(), this.getCoordinates(), null, "coordinates", null, 0, -1, SimpleLineString.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(featureEClass, Feature.class, "Feature", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getFeature_Id(), ecorePackage.getEString(), "id", null, 1, 1, Feature.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getFeature_Geometry(), this.getGeometry(), null, "geometry", null, 0, 1, Feature.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getFeature_Properties(), ecorePackage.getEObject(), null, "properties", null, 0, 1, Feature.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(featureCollectionEClass, FeatureCollection.class, "FeatureCollection", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getFeatureCollection_Features(), this.getFeature(), null, "features", null, 0, -1, FeatureCollection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(geometryCollectionEClass, GeometryCollection.class, "GeometryCollection", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getGeometryCollection_Geometries(), this.getGeometry(), null, "geometries", null, 0, -1, GeometryCollection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(multiPointEClass, MultiPoint.class, "MultiPoint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getMultiPoint_Data(), this.getDoubleArray1D(), "data", null, 0, -1, MultiPoint.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getMultiPoint_Coordinates(), this.getCoordinates(), null, "coordinates", null, 0, -1, MultiPoint.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(polygonEClass, Polygon.class, "Polygon", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(ringEClass, Ring.class, "Ring", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getRing_Coordinates(), this.getCoordinates(), null, "coordinates", null, 0, -1, Ring.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(holeEClass, Hole.class, "Hole", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(multiPolygonEClass, MultiPolygon.class, "MultiPolygon", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getMultiPolygon_Data(), this.getDoubleArray4D(), "data", null, 0, 1, MultiPolygon.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getMultiPolygon_Polygons(), this.getSimplePolygon(), null, "polygons", null, 0, -1, MultiPolygon.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + op = initEOperation(getMultiPolygon__SetData__double(), null, "setData", 0, 1, IS_UNIQUE, IS_ORDERED); + addEParameter(op, this.getDoubleArray4D(), "data", 0, 1, IS_UNIQUE, IS_ORDERED); + + initEClass(simplePolygonEClass, SimplePolygon.class, "SimplePolygon", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getSimplePolygon_Data(), this.getDoubleArray3D(), "data", null, 0, 1, SimplePolygon.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getSimplePolygon_ExteriorRing(), this.getRing(), null, "exteriorRing", null, 0, 1, SimplePolygon.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getSimplePolygon_InteriorHoles(), this.getHole(), null, "interiorHoles", null, 0, -1, SimplePolygon.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + op = initEOperation(getSimplePolygon__SetData__double(), null, "setData", 0, 1, IS_UNIQUE, IS_ORDERED); + addEParameter(op, this.getDoubleArray3D(), "data", 0, 1, IS_UNIQUE, IS_ORDERED); + + initEClass(multiLineStringEClass, MultiLineString.class, "MultiLineString", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getMultiLineString_Data(), this.getDoubleArray3D(), "data", null, 0, 1, MultiLineString.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getMultiLineString_LinesStrings(), this.getSimpleLineString(), null, "linesStrings", null, 0, -1, MultiLineString.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + op = initEOperation(getMultiLineString__SetData__double(), null, "setData", 0, 1, IS_UNIQUE, IS_ORDERED); + addEParameter(op, this.getDoubleArray3D(), "data", 0, 1, IS_UNIQUE, IS_ORDERED); + + // Initialize data types + initEDataType(doubleArray1DEDataType, double[].class, "DoubleArray1D", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + initEDataType(doubleArray2DEDataType, double[][].class, "DoubleArray2D", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + initEDataType(doubleArray3DEDataType, double[][][].class, "DoubleArray3D", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + initEDataType(doubleArray4DEDataType, double[][][][].class, "DoubleArray4D", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + + // Create resource + createResource(eNS_URI); + + // Create annotations + // Version + createVersionAnnotations(); + // http://www.eclipse.org/emf/2002/GenModel + createGenModelAnnotations(); + // http:///org/eclipse/emf/ecore/util/ExtendedMetaData + createExtendedMetaDataAnnotations(); + } + + /** + * Initializes the annotations for Version. + * + * + * @generated + */ + protected void createVersionAnnotations() { + String source = "Version"; + addAnnotation + (this, + source, + new String[] { + "value", "1.0" + }); + } + + /** + * Initializes the annotations for http://www.eclipse.org/emf/2002/GenModel. + * + * + * @generated + */ + protected void createGenModelAnnotations() { + String source = "http://www.eclipse.org/emf/2002/GenModel"; + addAnnotation + (this, + source, + new String[] { + "publicConstructors", "true" + }); + addAnnotation + (pointEClass, + source, + new String[] { + "documentation", "A GeoJSON point object as defined in\nthe GeoJSON\nspecification" + }); + addAnnotation + (getPoint__SetData__double(), + source, + new String[] { + "body", "setCoordinates(org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper.toCoordinates(data));", + "suppressedVisibility", "true" + }); + addAnnotation + (getPoint_Data(), + source, + new String[] { + "suppressedGetVisibility", "true", + "suppressedIsSetVisibility", "true", + "suppressedSetVisibility", "true", + "suppressedUnsetVisibility", "true", + "get", "return org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper.convertCoordinates(getCoordinates());" + }); + addAnnotation + (getGeoJsonObject_Bbox(), + source, + new String[] { + "suppressedGetVisibility", "true", + "suppressedIsSetVisibility", "false", + "suppressedSetVisibility", "true", + "suppressedUnsetVisibility", "true", + "get", "return new org.eclipse.sensinact.gateway.core.geojson.util.GenericConvertingList(getBoundingBox(), org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper::toCoordinates, org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper::convertCoordinates);" + }); + addAnnotation + (lineStringEClass, + source, + new String[] { + "documentation", " A GeoJSON line string object as defined in\nthe GeoJSON specification" + }); + addAnnotation + (getSimpleLineString_Data(), + source, + new String[] { + "suppressedGetVisibility", "true", + "suppressedIsSetVisibility", "false", + "suppressedSetVisibility", "true", + "suppressedUnsetVisibility", "true", + "get", "return new org.eclipse.sensinact.gateway.core.geojson.util.GenericConvertingList(getCoordinates(), org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper::toCoordinates, org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper::convertCoordinates);" + }); + addAnnotation + (geometryCollectionEClass, + source, + new String[] { + "documentation", "A GeoJSON geometry collection object as defined in\nthe GeoJSON\nspecification" + }); + addAnnotation + (multiPointEClass, + source, + new String[] { + "documentation", " A GeoJSON multi point object as defined in\nthe GeoJSON specification" + }); + addAnnotation + (getMultiPoint_Data(), + source, + new String[] { + "suppressedGetVisibility", "true", + "suppressedIsSetVisibility", "false", + "suppressedSetVisibility", "true", + "suppressedUnsetVisibility", "true", + "get", "return new org.eclipse.sensinact.gateway.core.geojson.util.GenericConvertingList(getCoordinates(), org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper::toCoordinates, org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper::convertCoordinates);" + }); + addAnnotation + (polygonEClass, + source, + new String[] { + "documentation", " A GeoJSON Polygone object as defined in\nthe GeoJSON specification" + }); + addAnnotation + (ringEClass, + source, + new String[] { + "documentation", "Represents a List of Coordinates that follow the right-hand rule and run counterclockwise" + }); + addAnnotation + (holeEClass, + source, + new String[] { + "documentation", "Represents a List of Coordinates that follow the right-hand rule and run clockwise." + }); + addAnnotation + (multiPolygonEClass, + source, + new String[] { + "documentation", " A GeoJSON Polygone object as defined in\nthe GeoJSON specification" + }); + addAnnotation + (getMultiPolygon__SetData__double(), + source, + new String[] { + "body", "for (int i = 0; i < data.length; i++) {\n\tdouble[][][] d = data[i];\n\tSimplePolygonImpl polygon = (SimplePolygonImpl) org.eclipse.sensinact.gateway.core.geojson.GeoJsonFactory.eINSTANCE.createSimplePolygon();\n\tpolygon.setData(d);\n\tgetPolygons().add(polygon);\n}", + "suppressedVisibility", "true" + }); + addAnnotation + (getMultiPolygon_Data(), + source, + new String[] { + "suppressedGetVisibility", "true", + "suppressedIsSetVisibility", "false", + "suppressedSetVisibility", "true", + "suppressedUnsetVisibility", "true", + "get", "double[][][][] result = new double[getPolygons().size()][][][];\nfor (int i = 0; i < getPolygons().size(); i++) {\n\tSimplePolygonImpl polygon = (SimplePolygonImpl) getPolygons().get(i);\n\tresult[i] = polygon.getData();\n}\nreturn result;" + }); + addAnnotation + (simplePolygonEClass, + source, + new String[] { + "documentation", " A GeoJSON Polygone object as defined in\nthe GeoJSON specification" + }); + addAnnotation + (getSimplePolygon__SetData__double(), + source, + new String[] { + "body", "for (int i = 0; i < data.length; i++) {\n\tdouble[][] d = data[i];\n\tif(i == 0) {\n\t\tsetExteriorRing(org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper.toRing(d));\n\t} else {\n\t\tgetInteriorHoles().add(org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper.toHole(d));\n\t}\n}", + "suppressedVisibility", "true" + }); + addAnnotation + (getSimplePolygon_Data(), + source, + new String[] { + "suppressedGetVisibility", "true", + "suppressedIsSetVisibility", "false", + "suppressedSetVisibility", "true", + "suppressedUnsetVisibility", "true", + "get", "double[][][] result = new double[1 + getInteriorHoles().size()][][];\nresult[0] = org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper.convertRing(getExteriorRing());\nfor (int i = 0; i < getInteriorHoles().size(); i++) {\n\tHole hole = getInteriorHoles().get(i);\n\tresult[i +1 ] = org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper.convertRing(hole);\n}\nreturn result;" + }); + addAnnotation + (multiLineStringEClass, + source, + new String[] { + "documentation", " A GeoJSON Polygone object as defined in\nthe GeoJSON specification" + }); + addAnnotation + (getMultiLineString__SetData__double(), + source, + new String[] { + "body", "for (int i = 0; i < data.length; i++) {\n\tdouble[][] d = data[i];\n\tSimpleLineStringImpl line = (SimpleLineStringImpl) org.eclipse.sensinact.gateway.core.geojson.GeoJsonFactory.eINSTANCE.createSimpleLineString();\n\tfor (double[] e : d) {\n\t\tline.getData().add(e);\n\t}\n}", + "suppressedVisibility", "true" + }); + addAnnotation + (getMultiLineString_Data(), + source, + new String[] { + "suppressedGetVisibility", "true", + "suppressedIsSetVisibility", "false", + "suppressedSetVisibility", "true", + "suppressedUnsetVisibility", "true", + "get", "double[][][] result = new double[getLinesStrings().size()][][];\nfor (int i = 0; i < getLinesStrings().size(); i++) {\n\tSimpleLineStringImpl line = (SimpleLineStringImpl) getLinesStrings().get(i);\n\tresult[i] = line.getData().toArray(new double[line.getCoordinates().size()][]);\n}\nreturn result;" + }); + } + + /** + * Initializes the annotations for http:///org/eclipse/emf/ecore/util/ExtendedMetaData. + * + * + * @generated + */ + protected void createExtendedMetaDataAnnotations() { + String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; + addAnnotation + (getPoint_Data(), + source, + new String[] { + "name", "coordinates" + }); + addAnnotation + (getGeoJsonObject_Bbox(), + source, + new String[] { + "name", "bbox" + }); + addAnnotation + (getSimpleLineString_Data(), + source, + new String[] { + "name", "coordinates" + }); + addAnnotation + (getMultiPoint_Data(), + source, + new String[] { + "name", "coordinates" + }); + addAnnotation + (getMultiPolygon_Data(), + source, + new String[] { + "name", "coordinates" + }); + addAnnotation + (getSimplePolygon_Data(), + source, + new String[] { + "name", "coordinates" + }); + addAnnotation + (getMultiLineString_Data(), + source, + new String[] { + "name", "coordinates" + }); + } + +} //GeoJsonPackageImpl diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/GeometryCollectionImpl.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/GeometryCollectionImpl.java new file mode 100644 index 00000000..4de28ca2 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/GeometryCollectionImpl.java @@ -0,0 +1,151 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage; +import org.eclipse.sensinact.gateway.core.geojson.Geometry; +import org.eclipse.sensinact.gateway.core.geojson.GeometryCollection; + +/** + * + * An implementation of the model object 'Geometry Collection'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.GeometryCollectionImpl#getGeometries Geometries}
  • + *
+ * + * @generated + */ +public class GeometryCollectionImpl extends GeoJsonObjectImpl implements GeometryCollection { + /** + * The cached value of the '{@link #getGeometries() Geometries}' containment reference list. + * + * + * @see #getGeometries() + * @generated + * @ordered + */ + protected EList geometries; + + /** + * + * + * @generated + */ + public GeometryCollectionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return GeoJsonPackage.Literals.GEOMETRY_COLLECTION; + } + + /** + * + * + * @generated + */ + @Override + public EList getGeometries() { + if (geometries == null) { + geometries = new EObjectContainmentEList(Geometry.class, this, GeoJsonPackage.GEOMETRY_COLLECTION__GEOMETRIES); + } + return geometries; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case GeoJsonPackage.GEOMETRY_COLLECTION__GEOMETRIES: + return ((InternalEList)getGeometries()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GeoJsonPackage.GEOMETRY_COLLECTION__GEOMETRIES: + return getGeometries(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GeoJsonPackage.GEOMETRY_COLLECTION__GEOMETRIES: + getGeometries().clear(); + getGeometries().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GeoJsonPackage.GEOMETRY_COLLECTION__GEOMETRIES: + getGeometries().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GeoJsonPackage.GEOMETRY_COLLECTION__GEOMETRIES: + return geometries != null && !geometries.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //GeometryCollectionImpl diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/HoleImpl.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/HoleImpl.java new file mode 100644 index 00000000..40dfbf17 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/HoleImpl.java @@ -0,0 +1,37 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson.impl; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage; +import org.eclipse.sensinact.gateway.core.geojson.Hole; + +/** + * + * An implementation of the model object 'Hole'. + * + * + * @generated + */ +public class HoleImpl extends RingImpl implements Hole { + /** + * + * + * @generated + */ + public HoleImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return GeoJsonPackage.Literals.HOLE; + } + +} //HoleImpl diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/LineStringImpl.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/LineStringImpl.java new file mode 100644 index 00000000..60249d95 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/LineStringImpl.java @@ -0,0 +1,207 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import org.eclipse.sensinact.gateway.core.geojson.Coordinates; +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage; +import org.eclipse.sensinact.gateway.core.geojson.LineString; +import org.eclipse.sensinact.gateway.core.geojson.SimpleLineString; + +/** + * + * An implementation of the model object 'Line String'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.LineStringImpl#getData Data}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.LineStringImpl#getCoordinates Coordinates}
  • + *
+ * + * @generated + */ +public class LineStringImpl extends GeoJsonObjectImpl implements LineString { + /** + * The cached value of the '{@link #getCoordinates() Coordinates}' containment reference list. + * + * + * @see #getCoordinates() + * @generated + * @ordered + */ + protected EList coordinates; + + /** + * + * + * @generated + */ + public LineStringImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return GeoJsonPackage.Literals.LINE_STRING; + } + + /** + * + * + * @generated + */ + public EList getData() { + return new org.eclipse.sensinact.gateway.core.geojson.util.GenericConvertingList(getCoordinates(), org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper::toCoordinates, org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper::convertCoordinates); + } + + /** + * + * + * @generated + */ + @Override + public EList getCoordinates() { + if (coordinates == null) { + coordinates = new EObjectContainmentEList(Coordinates.class, this, GeoJsonPackage.LINE_STRING__COORDINATES); + } + return coordinates; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case GeoJsonPackage.LINE_STRING__COORDINATES: + return ((InternalEList)getCoordinates()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GeoJsonPackage.LINE_STRING__DATA: + return getData(); + case GeoJsonPackage.LINE_STRING__COORDINATES: + return getCoordinates(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GeoJsonPackage.LINE_STRING__DATA: + getData().clear(); + getData().addAll((Collection)newValue); + return; + case GeoJsonPackage.LINE_STRING__COORDINATES: + getCoordinates().clear(); + getCoordinates().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GeoJsonPackage.LINE_STRING__DATA: + getData().clear(); + return; + case GeoJsonPackage.LINE_STRING__COORDINATES: + getCoordinates().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GeoJsonPackage.LINE_STRING__DATA: + return !getData().isEmpty(); + case GeoJsonPackage.LINE_STRING__COORDINATES: + return coordinates != null && !coordinates.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == SimpleLineString.class) { + switch (derivedFeatureID) { + case GeoJsonPackage.LINE_STRING__DATA: return GeoJsonPackage.SIMPLE_LINE_STRING__DATA; + case GeoJsonPackage.LINE_STRING__COORDINATES: return GeoJsonPackage.SIMPLE_LINE_STRING__COORDINATES; + default: return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == SimpleLineString.class) { + switch (baseFeatureID) { + case GeoJsonPackage.SIMPLE_LINE_STRING__DATA: return GeoJsonPackage.LINE_STRING__DATA; + case GeoJsonPackage.SIMPLE_LINE_STRING__COORDINATES: return GeoJsonPackage.LINE_STRING__COORDINATES; + default: return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + +} //LineStringImpl diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/MultiLineStringImpl.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/MultiLineStringImpl.java new file mode 100644 index 00000000..963b9280 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/MultiLineStringImpl.java @@ -0,0 +1,201 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage; +import org.eclipse.sensinact.gateway.core.geojson.MultiLineString; +import org.eclipse.sensinact.gateway.core.geojson.SimpleLineString; + +/** + * + * An implementation of the model object 'Multi Line String'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.MultiLineStringImpl#getData Data}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.MultiLineStringImpl#getLinesStrings Lines Strings}
  • + *
+ * + * @generated + */ +public class MultiLineStringImpl extends GeoJsonObjectImpl implements MultiLineString { + /** + * The default value of the '{@link #getData() Data}' attribute. + * + * + * @see #getData() + * @generated + * @ordered + */ + protected static final double[][][] DATA_EDEFAULT = null; + + /** + * The cached value of the '{@link #getLinesStrings() Lines Strings}' containment reference list. + * + * + * @see #getLinesStrings() + * @generated + * @ordered + */ + protected EList linesStrings; + + /** + * + * + * @generated + */ + public MultiLineStringImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return GeoJsonPackage.Literals.MULTI_LINE_STRING; + } + + /** + * + * + * @generated + */ + public double[][][] getData() { + double[][][] result = new double[getLinesStrings().size()][][]; + for (int i = 0; i < getLinesStrings().size(); i++) { + SimpleLineStringImpl line = (SimpleLineStringImpl) getLinesStrings().get(i); + result[i] = line.getData().toArray(new double[line.getCoordinates().size()][]); + } + return result; + } + + /** + * + * + * @generated + */ + public void setData(double[][][] data) { + for (int i = 0; i < data.length; i++) { + double[][] d = data[i]; + SimpleLineStringImpl line = (SimpleLineStringImpl) org.eclipse.sensinact.gateway.core.geojson.GeoJsonFactory.eINSTANCE.createSimpleLineString(); + for (double[] e : d) { + line.getData().add(e); + } + } + } + + /** + * + * + * @generated + */ + @Override + public EList getLinesStrings() { + if (linesStrings == null) { + linesStrings = new EObjectContainmentEList(SimpleLineString.class, this, GeoJsonPackage.MULTI_LINE_STRING__LINES_STRINGS); + } + return linesStrings; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case GeoJsonPackage.MULTI_LINE_STRING__LINES_STRINGS: + return ((InternalEList)getLinesStrings()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GeoJsonPackage.MULTI_LINE_STRING__DATA: + return getData(); + case GeoJsonPackage.MULTI_LINE_STRING__LINES_STRINGS: + return getLinesStrings(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GeoJsonPackage.MULTI_LINE_STRING__DATA: + setData((double[][][])newValue); + return; + case GeoJsonPackage.MULTI_LINE_STRING__LINES_STRINGS: + getLinesStrings().clear(); + getLinesStrings().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GeoJsonPackage.MULTI_LINE_STRING__DATA: + setData(DATA_EDEFAULT); + return; + case GeoJsonPackage.MULTI_LINE_STRING__LINES_STRINGS: + getLinesStrings().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GeoJsonPackage.MULTI_LINE_STRING__DATA: + return DATA_EDEFAULT == null ? getData() != null : !DATA_EDEFAULT.equals(getData()); + case GeoJsonPackage.MULTI_LINE_STRING__LINES_STRINGS: + return linesStrings != null && !linesStrings.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //MultiLineStringImpl diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/MultiPointImpl.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/MultiPointImpl.java new file mode 100644 index 00000000..2358a956 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/MultiPointImpl.java @@ -0,0 +1,172 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import org.eclipse.sensinact.gateway.core.geojson.Coordinates; +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage; +import org.eclipse.sensinact.gateway.core.geojson.MultiPoint; + +/** + * + * An implementation of the model object 'Multi Point'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.MultiPointImpl#getData Data}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.MultiPointImpl#getCoordinates Coordinates}
  • + *
+ * + * @generated + */ +public class MultiPointImpl extends GeoJsonObjectImpl implements MultiPoint { + /** + * The cached value of the '{@link #getCoordinates() Coordinates}' containment reference list. + * + * + * @see #getCoordinates() + * @generated + * @ordered + */ + protected EList coordinates; + + /** + * + * + * @generated + */ + public MultiPointImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return GeoJsonPackage.Literals.MULTI_POINT; + } + + /** + * + * + * @generated + */ + public EList getData() { + return new org.eclipse.sensinact.gateway.core.geojson.util.GenericConvertingList(getCoordinates(), org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper::toCoordinates, org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper::convertCoordinates); + } + + /** + * + * + * @generated + */ + @Override + public EList getCoordinates() { + if (coordinates == null) { + coordinates = new EObjectContainmentEList(Coordinates.class, this, GeoJsonPackage.MULTI_POINT__COORDINATES); + } + return coordinates; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case GeoJsonPackage.MULTI_POINT__COORDINATES: + return ((InternalEList)getCoordinates()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GeoJsonPackage.MULTI_POINT__DATA: + return getData(); + case GeoJsonPackage.MULTI_POINT__COORDINATES: + return getCoordinates(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GeoJsonPackage.MULTI_POINT__DATA: + getData().clear(); + getData().addAll((Collection)newValue); + return; + case GeoJsonPackage.MULTI_POINT__COORDINATES: + getCoordinates().clear(); + getCoordinates().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GeoJsonPackage.MULTI_POINT__DATA: + getData().clear(); + return; + case GeoJsonPackage.MULTI_POINT__COORDINATES: + getCoordinates().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GeoJsonPackage.MULTI_POINT__DATA: + return !getData().isEmpty(); + case GeoJsonPackage.MULTI_POINT__COORDINATES: + return coordinates != null && !coordinates.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //MultiPointImpl diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/MultiPolygonImpl.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/MultiPolygonImpl.java new file mode 100644 index 00000000..30237171 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/MultiPolygonImpl.java @@ -0,0 +1,200 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage; +import org.eclipse.sensinact.gateway.core.geojson.MultiPolygon; +import org.eclipse.sensinact.gateway.core.geojson.SimplePolygon; + +/** + * + * An implementation of the model object 'Multi Polygon'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.MultiPolygonImpl#getData Data}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.MultiPolygonImpl#getPolygons Polygons}
  • + *
+ * + * @generated + */ +public class MultiPolygonImpl extends GeoJsonObjectImpl implements MultiPolygon { + /** + * The default value of the '{@link #getData() Data}' attribute. + * + * + * @see #getData() + * @generated + * @ordered + */ + protected static final double[][][][] DATA_EDEFAULT = null; + + /** + * The cached value of the '{@link #getPolygons() Polygons}' containment reference list. + * + * + * @see #getPolygons() + * @generated + * @ordered + */ + protected EList polygons; + + /** + * + * + * @generated + */ + public MultiPolygonImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return GeoJsonPackage.Literals.MULTI_POLYGON; + } + + /** + * + * + * @generated + */ + public double[][][][] getData() { + double[][][][] result = new double[getPolygons().size()][][][]; + for (int i = 0; i < getPolygons().size(); i++) { + SimplePolygonImpl polygon = (SimplePolygonImpl) getPolygons().get(i); + result[i] = polygon.getData(); + } + return result; + } + + /** + * + * + * @generated + */ + public void setData(double[][][][] data) { + for (int i = 0; i < data.length; i++) { + double[][][] d = data[i]; + SimplePolygonImpl polygon = (SimplePolygonImpl) org.eclipse.sensinact.gateway.core.geojson.GeoJsonFactory.eINSTANCE.createSimplePolygon(); + polygon.setData(d); + getPolygons().add(polygon); + } + } + + /** + * + * + * @generated + */ + @Override + public EList getPolygons() { + if (polygons == null) { + polygons = new EObjectContainmentEList(SimplePolygon.class, this, GeoJsonPackage.MULTI_POLYGON__POLYGONS); + } + return polygons; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case GeoJsonPackage.MULTI_POLYGON__POLYGONS: + return ((InternalEList)getPolygons()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GeoJsonPackage.MULTI_POLYGON__DATA: + return getData(); + case GeoJsonPackage.MULTI_POLYGON__POLYGONS: + return getPolygons(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GeoJsonPackage.MULTI_POLYGON__DATA: + setData((double[][][][])newValue); + return; + case GeoJsonPackage.MULTI_POLYGON__POLYGONS: + getPolygons().clear(); + getPolygons().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GeoJsonPackage.MULTI_POLYGON__DATA: + setData(DATA_EDEFAULT); + return; + case GeoJsonPackage.MULTI_POLYGON__POLYGONS: + getPolygons().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GeoJsonPackage.MULTI_POLYGON__DATA: + return DATA_EDEFAULT == null ? getData() != null : !DATA_EDEFAULT.equals(getData()); + case GeoJsonPackage.MULTI_POLYGON__POLYGONS: + return polygons != null && !polygons.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //MultiPolygonImpl diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/PointImpl.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/PointImpl.java new file mode 100644 index 00000000..b0641287 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/PointImpl.java @@ -0,0 +1,216 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.sensinact.gateway.core.geojson.Coordinates; +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage; +import org.eclipse.sensinact.gateway.core.geojson.Point; + +/** + * + * An implementation of the model object 'Point'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.PointImpl#getData Data}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.PointImpl#getCoordinates Coordinates}
  • + *
+ * + * @generated + */ +public class PointImpl extends GeoJsonObjectImpl implements Point { + /** + * The default value of the '{@link #getData() Data}' attribute. + * + * + * @see #getData() + * @generated + * @ordered + */ + protected static final double[] DATA_EDEFAULT = null; + + /** + * The cached value of the '{@link #getCoordinates() Coordinates}' containment reference. + * + * + * @see #getCoordinates() + * @generated + * @ordered + */ + protected Coordinates coordinates; + + /** + * + * + * @generated + */ + public PointImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return GeoJsonPackage.Literals.POINT; + } + + /** + * + * + * @generated + */ + public double[] getData() { + return org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper.convertCoordinates(getCoordinates()); + } + + /** + * + * + * @generated + */ + public void setData(double[] data) { + setCoordinates(org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper.toCoordinates(data)); + } + + /** + * + * + * @generated + */ + @Override + public Coordinates getCoordinates() { + return coordinates; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCoordinates(Coordinates newCoordinates, NotificationChain msgs) { + Coordinates oldCoordinates = coordinates; + coordinates = newCoordinates; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GeoJsonPackage.POINT__COORDINATES, oldCoordinates, newCoordinates); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setCoordinates(Coordinates newCoordinates) { + if (newCoordinates != coordinates) { + NotificationChain msgs = null; + if (coordinates != null) + msgs = ((InternalEObject)coordinates).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GeoJsonPackage.POINT__COORDINATES, null, msgs); + if (newCoordinates != null) + msgs = ((InternalEObject)newCoordinates).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GeoJsonPackage.POINT__COORDINATES, null, msgs); + msgs = basicSetCoordinates(newCoordinates, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GeoJsonPackage.POINT__COORDINATES, newCoordinates, newCoordinates)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case GeoJsonPackage.POINT__COORDINATES: + return basicSetCoordinates(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GeoJsonPackage.POINT__DATA: + return getData(); + case GeoJsonPackage.POINT__COORDINATES: + return getCoordinates(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GeoJsonPackage.POINT__DATA: + setData((double[])newValue); + return; + case GeoJsonPackage.POINT__COORDINATES: + setCoordinates((Coordinates)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GeoJsonPackage.POINT__DATA: + setData(DATA_EDEFAULT); + return; + case GeoJsonPackage.POINT__COORDINATES: + setCoordinates((Coordinates)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GeoJsonPackage.POINT__DATA: + return DATA_EDEFAULT == null ? getData() != null : !DATA_EDEFAULT.equals(getData()); + case GeoJsonPackage.POINT__COORDINATES: + return coordinates != null; + } + return super.eIsSet(featureID); + } + +} //PointImpl diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/PolygonImpl.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/PolygonImpl.java new file mode 100644 index 00000000..9d2ba7a1 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/PolygonImpl.java @@ -0,0 +1,312 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage; +import org.eclipse.sensinact.gateway.core.geojson.Hole; +import org.eclipse.sensinact.gateway.core.geojson.Polygon; +import org.eclipse.sensinact.gateway.core.geojson.Ring; +import org.eclipse.sensinact.gateway.core.geojson.SimplePolygon; + +/** + * + * An implementation of the model object 'Polygon'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.PolygonImpl#getData Data}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.PolygonImpl#getExteriorRing Exterior Ring}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.PolygonImpl#getInteriorHoles Interior Holes}
  • + *
+ * + * @generated + */ +public class PolygonImpl extends GeoJsonObjectImpl implements Polygon { + /** + * The default value of the '{@link #getData() Data}' attribute. + * + * + * @see #getData() + * @generated + * @ordered + */ + protected static final double[][][] DATA_EDEFAULT = null; + + /** + * The cached value of the '{@link #getExteriorRing() Exterior Ring}' containment reference. + * + * + * @see #getExteriorRing() + * @generated + * @ordered + */ + protected Ring exteriorRing; + + /** + * The cached value of the '{@link #getInteriorHoles() Interior Holes}' containment reference list. + * + * + * @see #getInteriorHoles() + * @generated + * @ordered + */ + protected EList interiorHoles; + + /** + * + * + * @generated + */ + public PolygonImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return GeoJsonPackage.Literals.POLYGON; + } + + /** + * + * + * @generated + */ + public double[][][] getData() { + double[][][] result = new double[1 + getInteriorHoles().size()][][]; + result[0] = org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper.convertRing(getExteriorRing()); + for (int i = 0; i < getInteriorHoles().size(); i++) { + Hole hole = getInteriorHoles().get(i); + result[i +1 ] = org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper.convertRing(hole); + } + return result; + } + + /** + * + * + * @generated + */ + public void setData(double[][][] data) { + for (int i = 0; i < data.length; i++) { + double[][] d = data[i]; + if(i == 0) { + setExteriorRing(org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper.toRing(d)); + } else { + getInteriorHoles().add(org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper.toHole(d)); + } + } + } + + /** + * + * + * @generated + */ + @Override + public Ring getExteriorRing() { + return exteriorRing; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetExteriorRing(Ring newExteriorRing, NotificationChain msgs) { + Ring oldExteriorRing = exteriorRing; + exteriorRing = newExteriorRing; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GeoJsonPackage.POLYGON__EXTERIOR_RING, oldExteriorRing, newExteriorRing); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setExteriorRing(Ring newExteriorRing) { + if (newExteriorRing != exteriorRing) { + NotificationChain msgs = null; + if (exteriorRing != null) + msgs = ((InternalEObject)exteriorRing).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GeoJsonPackage.POLYGON__EXTERIOR_RING, null, msgs); + if (newExteriorRing != null) + msgs = ((InternalEObject)newExteriorRing).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GeoJsonPackage.POLYGON__EXTERIOR_RING, null, msgs); + msgs = basicSetExteriorRing(newExteriorRing, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GeoJsonPackage.POLYGON__EXTERIOR_RING, newExteriorRing, newExteriorRing)); + } + + /** + * + * + * @generated + */ + @Override + public EList getInteriorHoles() { + if (interiorHoles == null) { + interiorHoles = new EObjectContainmentEList(Hole.class, this, GeoJsonPackage.POLYGON__INTERIOR_HOLES); + } + return interiorHoles; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case GeoJsonPackage.POLYGON__EXTERIOR_RING: + return basicSetExteriorRing(null, msgs); + case GeoJsonPackage.POLYGON__INTERIOR_HOLES: + return ((InternalEList)getInteriorHoles()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GeoJsonPackage.POLYGON__DATA: + return getData(); + case GeoJsonPackage.POLYGON__EXTERIOR_RING: + return getExteriorRing(); + case GeoJsonPackage.POLYGON__INTERIOR_HOLES: + return getInteriorHoles(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GeoJsonPackage.POLYGON__DATA: + setData((double[][][])newValue); + return; + case GeoJsonPackage.POLYGON__EXTERIOR_RING: + setExteriorRing((Ring)newValue); + return; + case GeoJsonPackage.POLYGON__INTERIOR_HOLES: + getInteriorHoles().clear(); + getInteriorHoles().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GeoJsonPackage.POLYGON__DATA: + setData(DATA_EDEFAULT); + return; + case GeoJsonPackage.POLYGON__EXTERIOR_RING: + setExteriorRing((Ring)null); + return; + case GeoJsonPackage.POLYGON__INTERIOR_HOLES: + getInteriorHoles().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GeoJsonPackage.POLYGON__DATA: + return DATA_EDEFAULT == null ? getData() != null : !DATA_EDEFAULT.equals(getData()); + case GeoJsonPackage.POLYGON__EXTERIOR_RING: + return exteriorRing != null; + case GeoJsonPackage.POLYGON__INTERIOR_HOLES: + return interiorHoles != null && !interiorHoles.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == SimplePolygon.class) { + switch (derivedFeatureID) { + case GeoJsonPackage.POLYGON__DATA: return GeoJsonPackage.SIMPLE_POLYGON__DATA; + case GeoJsonPackage.POLYGON__EXTERIOR_RING: return GeoJsonPackage.SIMPLE_POLYGON__EXTERIOR_RING; + case GeoJsonPackage.POLYGON__INTERIOR_HOLES: return GeoJsonPackage.SIMPLE_POLYGON__INTERIOR_HOLES; + default: return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == SimplePolygon.class) { + switch (baseFeatureID) { + case GeoJsonPackage.SIMPLE_POLYGON__DATA: return GeoJsonPackage.POLYGON__DATA; + case GeoJsonPackage.SIMPLE_POLYGON__EXTERIOR_RING: return GeoJsonPackage.POLYGON__EXTERIOR_RING; + case GeoJsonPackage.SIMPLE_POLYGON__INTERIOR_HOLES: return GeoJsonPackage.POLYGON__INTERIOR_HOLES; + default: return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + +} //PolygonImpl diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/PropertiesEntryImpl.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/PropertiesEntryImpl.java new file mode 100644 index 00000000..b1a16cc7 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/PropertiesEntryImpl.java @@ -0,0 +1,304 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson.impl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.BasicEMap; +import org.eclipse.emf.common.util.EMap; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage; + +/** + * + * An implementation of the model object 'Properties Entry'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.PropertiesEntryImpl#getTypedKey Key}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.PropertiesEntryImpl#getTypedValue Value}
  • + *
+ * + * @generated + */ +public class PropertiesEntryImpl extends MinimalEObjectImpl.Container implements BasicEMap.Entry { + /** + * The default value of the '{@link #getTypedKey() Key}' attribute. + * + * + * @see #getTypedKey() + * @generated + * @ordered + */ + protected static final String KEY_EDEFAULT = null; + + /** + * The cached value of the '{@link #getTypedKey() Key}' attribute. + * + * + * @see #getTypedKey() + * @generated + * @ordered + */ + protected String key = KEY_EDEFAULT; + + /** + * The default value of the '{@link #getTypedValue() Value}' attribute. + * + * + * @see #getTypedValue() + * @generated + * @ordered + */ + protected static final Object VALUE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getTypedValue() Value}' attribute. + * + * + * @see #getTypedValue() + * @generated + * @ordered + */ + protected Object value = VALUE_EDEFAULT; + + /** + * + * + * @generated + */ + public PropertiesEntryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return GeoJsonPackage.Literals.PROPERTIES_ENTRY; + } + + /** + * + * + * @generated + */ + public String getTypedKey() { + return key; + } + + /** + * + * + * @generated + */ + public void setTypedKey(String newKey) { + String oldKey = key; + key = newKey; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GeoJsonPackage.PROPERTIES_ENTRY__KEY, oldKey, key)); + } + + /** + * + * + * @generated + */ + public Object getTypedValue() { + return value; + } + + /** + * + * + * @generated + */ + public void setTypedValue(Object newValue) { + Object oldValue = value; + value = newValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GeoJsonPackage.PROPERTIES_ENTRY__VALUE, oldValue, value)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GeoJsonPackage.PROPERTIES_ENTRY__KEY: + return getTypedKey(); + case GeoJsonPackage.PROPERTIES_ENTRY__VALUE: + return getTypedValue(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GeoJsonPackage.PROPERTIES_ENTRY__KEY: + setTypedKey((String)newValue); + return; + case GeoJsonPackage.PROPERTIES_ENTRY__VALUE: + setTypedValue(newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GeoJsonPackage.PROPERTIES_ENTRY__KEY: + setTypedKey(KEY_EDEFAULT); + return; + case GeoJsonPackage.PROPERTIES_ENTRY__VALUE: + setTypedValue(VALUE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GeoJsonPackage.PROPERTIES_ENTRY__KEY: + return KEY_EDEFAULT == null ? key != null : !KEY_EDEFAULT.equals(key); + case GeoJsonPackage.PROPERTIES_ENTRY__VALUE: + return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (key: "); + result.append(key); + result.append(", value: "); + result.append(value); + result.append(')'); + return result.toString(); + } + + /** + * + * + * @generated + */ + protected int hash = -1; + + /** + * + * + * @generated + */ + @Override + public int getHash() { + if (hash == -1) { + Object theKey = getKey(); + hash = (theKey == null ? 0 : theKey.hashCode()); + } + return hash; + } + + /** + * + * + * @generated + */ + @Override + public void setHash(int hash) { + this.hash = hash; + } + + /** + * + * + * @generated + */ + @Override + public String getKey() { + return getTypedKey(); + } + + /** + * + * + * @generated + */ + @Override + public void setKey(String key) { + setTypedKey(key); + } + + /** + * + * + * @generated + */ + @Override + public Object getValue() { + return getTypedValue(); + } + + /** + * + * + * @generated + */ + @Override + public Object setValue(Object value) { + Object oldValue = getValue(); + setTypedValue(value); + return oldValue; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + public EMap getEMap() { + EObject container = eContainer(); + return container == null ? null : (EMap)container.eGet(eContainmentFeature()); + } + +} //PropertiesEntryImpl diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/RingImpl.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/RingImpl.java new file mode 100644 index 00000000..369419cf --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/RingImpl.java @@ -0,0 +1,153 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import org.eclipse.sensinact.gateway.core.geojson.Coordinates; +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage; +import org.eclipse.sensinact.gateway.core.geojson.Ring; + +/** + * + * An implementation of the model object 'Ring'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.RingImpl#getCoordinates Coordinates}
  • + *
+ * + * @generated + */ +public class RingImpl extends MinimalEObjectImpl.Container implements Ring { + /** + * The cached value of the '{@link #getCoordinates() Coordinates}' containment reference list. + * + * + * @see #getCoordinates() + * @generated + * @ordered + */ + protected EList coordinates; + + /** + * + * + * @generated + */ + public RingImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return GeoJsonPackage.Literals.RING; + } + + /** + * + * + * @generated + */ + @Override + public EList getCoordinates() { + if (coordinates == null) { + coordinates = new EObjectContainmentEList(Coordinates.class, this, GeoJsonPackage.RING__COORDINATES); + } + return coordinates; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case GeoJsonPackage.RING__COORDINATES: + return ((InternalEList)getCoordinates()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GeoJsonPackage.RING__COORDINATES: + return getCoordinates(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GeoJsonPackage.RING__COORDINATES: + getCoordinates().clear(); + getCoordinates().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GeoJsonPackage.RING__COORDINATES: + getCoordinates().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GeoJsonPackage.RING__COORDINATES: + return coordinates != null && !coordinates.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //RingImpl diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/SimpleLineStringImpl.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/SimpleLineStringImpl.java new file mode 100644 index 00000000..f8586260 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/SimpleLineStringImpl.java @@ -0,0 +1,174 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import org.eclipse.sensinact.gateway.core.geojson.Coordinates; +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage; +import org.eclipse.sensinact.gateway.core.geojson.SimpleLineString; + +/** + * + * An implementation of the model object 'Simple Line String'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.SimpleLineStringImpl#getData Data}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.SimpleLineStringImpl#getCoordinates Coordinates}
  • + *
+ * + * @generated + */ +public class SimpleLineStringImpl extends MinimalEObjectImpl.Container implements SimpleLineString { + /** + * The cached value of the '{@link #getCoordinates() Coordinates}' containment reference list. + * + * + * @see #getCoordinates() + * @generated + * @ordered + */ + protected EList coordinates; + + /** + * + * + * @generated + */ + public SimpleLineStringImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return GeoJsonPackage.Literals.SIMPLE_LINE_STRING; + } + + /** + * + * + * @generated + */ + public EList getData() { + return new org.eclipse.sensinact.gateway.core.geojson.util.GenericConvertingList(getCoordinates(), org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper::toCoordinates, org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper::convertCoordinates); + } + + /** + * + * + * @generated + */ + @Override + public EList getCoordinates() { + if (coordinates == null) { + coordinates = new EObjectContainmentEList(Coordinates.class, this, GeoJsonPackage.SIMPLE_LINE_STRING__COORDINATES); + } + return coordinates; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case GeoJsonPackage.SIMPLE_LINE_STRING__COORDINATES: + return ((InternalEList)getCoordinates()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GeoJsonPackage.SIMPLE_LINE_STRING__DATA: + return getData(); + case GeoJsonPackage.SIMPLE_LINE_STRING__COORDINATES: + return getCoordinates(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GeoJsonPackage.SIMPLE_LINE_STRING__DATA: + getData().clear(); + getData().addAll((Collection)newValue); + return; + case GeoJsonPackage.SIMPLE_LINE_STRING__COORDINATES: + getCoordinates().clear(); + getCoordinates().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GeoJsonPackage.SIMPLE_LINE_STRING__DATA: + getData().clear(); + return; + case GeoJsonPackage.SIMPLE_LINE_STRING__COORDINATES: + getCoordinates().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GeoJsonPackage.SIMPLE_LINE_STRING__DATA: + return !getData().isEmpty(); + case GeoJsonPackage.SIMPLE_LINE_STRING__COORDINATES: + return coordinates != null && !coordinates.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //SimpleLineStringImpl diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/SimplePolygonImpl.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/SimplePolygonImpl.java new file mode 100644 index 00000000..e308470c --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/SimplePolygonImpl.java @@ -0,0 +1,276 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage; +import org.eclipse.sensinact.gateway.core.geojson.Hole; +import org.eclipse.sensinact.gateway.core.geojson.Ring; +import org.eclipse.sensinact.gateway.core.geojson.SimplePolygon; + +/** + * + * An implementation of the model object 'Simple Polygon'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.SimplePolygonImpl#getData Data}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.SimplePolygonImpl#getExteriorRing Exterior Ring}
  • + *
  • {@link org.eclipse.sensinact.gateway.core.geojson.impl.SimplePolygonImpl#getInteriorHoles Interior Holes}
  • + *
+ * + * @generated + */ +public class SimplePolygonImpl extends MinimalEObjectImpl.Container implements SimplePolygon { + /** + * The default value of the '{@link #getData() Data}' attribute. + * + * + * @see #getData() + * @generated + * @ordered + */ + protected static final double[][][] DATA_EDEFAULT = null; + + /** + * The cached value of the '{@link #getExteriorRing() Exterior Ring}' containment reference. + * + * + * @see #getExteriorRing() + * @generated + * @ordered + */ + protected Ring exteriorRing; + + /** + * The cached value of the '{@link #getInteriorHoles() Interior Holes}' containment reference list. + * + * + * @see #getInteriorHoles() + * @generated + * @ordered + */ + protected EList interiorHoles; + + /** + * + * + * @generated + */ + public SimplePolygonImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return GeoJsonPackage.Literals.SIMPLE_POLYGON; + } + + /** + * + * + * @generated + */ + public double[][][] getData() { + double[][][] result = new double[1 + getInteriorHoles().size()][][]; + result[0] = org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper.convertRing(getExteriorRing()); + for (int i = 0; i < getInteriorHoles().size(); i++) { + Hole hole = getInteriorHoles().get(i); + result[i +1 ] = org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper.convertRing(hole); + } + return result; + } + + /** + * + * + * @generated + */ + public void setData(double[][][] data) { + for (int i = 0; i < data.length; i++) { + double[][] d = data[i]; + if(i == 0) { + setExteriorRing(org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper.toRing(d)); + } else { + getInteriorHoles().add(org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonHelper.toHole(d)); + } + } + } + + /** + * + * + * @generated + */ + @Override + public Ring getExteriorRing() { + return exteriorRing; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetExteriorRing(Ring newExteriorRing, NotificationChain msgs) { + Ring oldExteriorRing = exteriorRing; + exteriorRing = newExteriorRing; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GeoJsonPackage.SIMPLE_POLYGON__EXTERIOR_RING, oldExteriorRing, newExteriorRing); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setExteriorRing(Ring newExteriorRing) { + if (newExteriorRing != exteriorRing) { + NotificationChain msgs = null; + if (exteriorRing != null) + msgs = ((InternalEObject)exteriorRing).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GeoJsonPackage.SIMPLE_POLYGON__EXTERIOR_RING, null, msgs); + if (newExteriorRing != null) + msgs = ((InternalEObject)newExteriorRing).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GeoJsonPackage.SIMPLE_POLYGON__EXTERIOR_RING, null, msgs); + msgs = basicSetExteriorRing(newExteriorRing, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GeoJsonPackage.SIMPLE_POLYGON__EXTERIOR_RING, newExteriorRing, newExteriorRing)); + } + + /** + * + * + * @generated + */ + @Override + public EList getInteriorHoles() { + if (interiorHoles == null) { + interiorHoles = new EObjectContainmentEList(Hole.class, this, GeoJsonPackage.SIMPLE_POLYGON__INTERIOR_HOLES); + } + return interiorHoles; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case GeoJsonPackage.SIMPLE_POLYGON__EXTERIOR_RING: + return basicSetExteriorRing(null, msgs); + case GeoJsonPackage.SIMPLE_POLYGON__INTERIOR_HOLES: + return ((InternalEList)getInteriorHoles()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GeoJsonPackage.SIMPLE_POLYGON__DATA: + return getData(); + case GeoJsonPackage.SIMPLE_POLYGON__EXTERIOR_RING: + return getExteriorRing(); + case GeoJsonPackage.SIMPLE_POLYGON__INTERIOR_HOLES: + return getInteriorHoles(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GeoJsonPackage.SIMPLE_POLYGON__DATA: + setData((double[][][])newValue); + return; + case GeoJsonPackage.SIMPLE_POLYGON__EXTERIOR_RING: + setExteriorRing((Ring)newValue); + return; + case GeoJsonPackage.SIMPLE_POLYGON__INTERIOR_HOLES: + getInteriorHoles().clear(); + getInteriorHoles().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GeoJsonPackage.SIMPLE_POLYGON__DATA: + setData(DATA_EDEFAULT); + return; + case GeoJsonPackage.SIMPLE_POLYGON__EXTERIOR_RING: + setExteriorRing((Ring)null); + return; + case GeoJsonPackage.SIMPLE_POLYGON__INTERIOR_HOLES: + getInteriorHoles().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GeoJsonPackage.SIMPLE_POLYGON__DATA: + return DATA_EDEFAULT == null ? getData() != null : !DATA_EDEFAULT.equals(getData()); + case GeoJsonPackage.SIMPLE_POLYGON__EXTERIOR_RING: + return exteriorRing != null; + case GeoJsonPackage.SIMPLE_POLYGON__INTERIOR_HOLES: + return interiorHoles != null && !interiorHoles.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //SimplePolygonImpl diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/package-info.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/package-info.java new file mode 100644 index 00000000..c5a39d84 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/impl/package-info.java @@ -0,0 +1,5 @@ +/* + */ +@org.osgi.annotation.bundle.Export +@org.osgi.annotation.versioning.Version("1.0") +package org.eclipse.sensinact.gateway.core.geojson.impl; \ No newline at end of file diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/package-info.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/package-info.java new file mode 100644 index 00000000..13884fcd --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src-gen/org/eclipse/sensinact/gateway/core/geojson/package-info.java @@ -0,0 +1,5 @@ +/* + */ +@org.osgi.annotation.bundle.Export +@org.osgi.annotation.versioning.Version("1.0") +package org.eclipse.sensinact.gateway.core.geojson; \ No newline at end of file diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src/org/eclipse/sensinact/gateway/core/geojson/util/GenericConvertingList.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src/org/eclipse/sensinact/gateway/core/geojson/util/GenericConvertingList.java new file mode 100644 index 00000000..40e62b2c --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src/org/eclipse/sensinact/gateway/core/geojson/util/GenericConvertingList.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) 2012 - 2024 Data In Motion and others. + * All rights reserved. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Data In Motion - initial API and implementation + */ +package org.eclipse.sensinact.gateway.core.geojson.util; + +import java.util.Collection; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; + +import org.eclipse.emf.common.util.AbstractEList; +import org.eclipse.emf.common.util.EList; + +/** + * + * @author Juergen Albert + * @since 29 Nov 2024 + */ +public class GenericConvertingList extends AbstractEList{ + + + private EList backingList; + private Function tToE; + private Function eToT; + + /** + * Creates a new instance. + */ + public GenericConvertingList(EList backingList, Function tToE, Function eToT) { + this.backingList = backingList; + this.tToE = tToE; + this.eToT = eToT; + } + + + /* + * (non-Javadoc) + * @see java.util.List#size() + */ + @Override + public int size() { + return backingList.size(); + } + + /* + * (non-Javadoc) + * @see org.eclipse.emf.common.util.AbstractEList#primitiveGet(int) + */ + @Override + protected T primitiveGet(int index) { + return eToT.apply(backingList.get(index)); + } + + /* + * (non-Javadoc) + * @see org.eclipse.emf.common.util.AbstractEList#setUnique(int, java.lang.Object) + */ + @Override + public T setUnique(int index, T object) { + E set = backingList.set(index, tToE.apply(object)); + return set == null ? null : eToT.apply(set); + } + + /* + * (non-Javadoc) + * @see org.eclipse.emf.common.util.AbstractEList#addUnique(java.lang.Object) + */ + @Override + public void addUnique(T object) { + backingList.add(tToE.apply(object)); + } + + /* + * (non-Javadoc) + * @see org.eclipse.emf.common.util.AbstractEList#addUnique(int, java.lang.Object) + */ + @Override + public void addUnique(int index, T object) { + backingList.add(index, tToE.apply(object)); + } + + /* + * (non-Javadoc) + * @see org.eclipse.emf.common.util.AbstractEList#addAllUnique(java.util.Collection) + */ + @Override + public boolean addAllUnique(Collection collection) { + Collection convert = collection.stream().map(tToE).collect(Collectors.toList()); + return backingList.addAll(convert); + } + + /* + * (non-Javadoc) + * @see org.eclipse.emf.common.util.AbstractEList#addAllUnique(int, java.util.Collection) + */ + @Override + public boolean addAllUnique(int index, Collection collection) { + Collection convert = collection.stream().map(tToE).collect(Collectors.toList()); + return backingList.addAll(index, convert); + } + + /* + * (non-Javadoc) + * @see org.eclipse.emf.common.util.AbstractEList#addAllUnique(java.lang.Object[], int, int) + */ + @Override + public boolean addAllUnique(Object[] objects, int start, int end) { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * @see org.eclipse.emf.common.util.AbstractEList#addAllUnique(int, java.lang.Object[], int, int) + */ + @Override + public boolean addAllUnique(int index, Object[] objects, int start, int end) { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * @see org.eclipse.emf.common.util.AbstractEList#remove(int) + */ + @Override + public T remove(int index) { + E removed = backingList.remove(index); + return removed == null ? null : eToT.apply(removed); + } + + /* + * (non-Javadoc) + * @see org.eclipse.emf.common.util.AbstractEList#move(int, int) + */ + @Override + public T move(int targetIndex, int sourceIndex) { + E moved = backingList.move(targetIndex, sourceIndex); + return moved == null ? null : eToT.apply(moved); + } + + /* + * (non-Javadoc) + * @see org.eclipse.emf.common.util.AbstractEList#basicList() + */ + @Override + protected List basicList() { + return backingList.stream().map(eToT).collect(Collectors.toList()); + } + + /* + * (non-Javadoc) + * @see java.util.AbstractList#get(int) + */ + @Override + public T get(int index) { + E get = backingList.get(index); + return get == null ? null : eToT.apply(get); + } + +} diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src/org/eclipse/sensinact/gateway/core/geojson/util/GeoJsonHelper.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src/org/eclipse/sensinact/gateway/core/geojson/util/GeoJsonHelper.java new file mode 100644 index 00000000..f1a7c8a3 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src/org/eclipse/sensinact/gateway/core/geojson/util/GeoJsonHelper.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) 2012 - 2024 Data In Motion and others. + * All rights reserved. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Data In Motion - initial API and implementation + */ +package org.eclipse.sensinact.gateway.core.geojson.util; + +import org.eclipse.sensinact.gateway.core.geojson.Coordinates; +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonFactory; +import org.eclipse.sensinact.gateway.core.geojson.Hole; +import org.eclipse.sensinact.gateway.core.geojson.Ring; +import org.eclipse.sensinact.gateway.core.geojson.impl.CoordinatesImpl; + +/** + * + * @author Juergen Albert + * @since 29 Nov 2024 + */ +public class GeoJsonHelper { + + public static double[] convertCoordinates(Coordinates coordinates) { + return convertCoordinates(coordinates, false); + } + + + public static double[] convertCoordinates(Coordinates coordinates, boolean ignoreElevation) { + if(coordinates == null) { + return new double[0]; + } + double[] array = Double.isNaN(coordinates.getElevation()) || ignoreElevation ? new double[] { coordinates.getLongitude(), coordinates.getLatitude()} + : new double[] { coordinates.getLongitude(), coordinates.getLatitude(), coordinates.getElevation() }; + return array; + } + + public static Coordinates toCoordinates(double[] data) { + if(data == null) { + return null; + } + Coordinates c = new CoordinatesImpl(); + c.setLongitude(data[0]); + c.setLatitude(data[1]); + if (data.length >= 3) { + c.setElevation(data[2]); + } + return c; + } + + public static double[][] convertRing(Ring ring) { + if(ring == null) { + return new double[0][0]; + } + boolean ringClosed = checkRingClosed(ring); + int size = ringClosed ? ring.getCoordinates().size() : ring.getCoordinates().size() + 1; + double[][] result = new double[size][2]; + + for (int i = 0; i < ring.getCoordinates().size(); i++) { + Coordinates coordinates = ring.getCoordinates().get(i); + result[i] = convertCoordinates(coordinates, true); + } + if(!ringClosed) { + Coordinates coordinates = ring.getCoordinates().get(0); + result[ring.getCoordinates().size()] = convertCoordinates(coordinates, true); + } + + return result; + } + + private static boolean checkRingClosed(Ring ring) { + Coordinates start = ring.getCoordinates().get(0); + Coordinates end = ring.getCoordinates().get(ring.getCoordinates().size() -1 ); + return start.getLatitude() == end.getLatitude() && start.getLongitude() == end.getLongitude(); + } + + + public static Ring toRing(double[][] data) { + if(data == null) { + return null; + } + Ring ring = GeoJsonFactory.eINSTANCE.createRing(); + for (int i = 0; i < data.length; i++) { + ring.getCoordinates().add(toCoordinates(data[i])); + } + return ring; + } + + public static Hole toHole(double[][] data) { + if(data == null) { + return null; + } + Hole hole = GeoJsonFactory.eINSTANCE.createHole(); + for (int i = 0; i < data.length; i++) { + hole.getCoordinates().add(toCoordinates(data[i])); + } + return hole; + } +} diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src/org/eclipse/sensinact/gateway/core/geojson/util/GeoJsonResourceFactoryImpl.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src/org/eclipse/sensinact/gateway/core/geojson/util/GeoJsonResourceFactoryImpl.java new file mode 100644 index 00000000..175f8417 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src/org/eclipse/sensinact/gateway/core/geojson/util/GeoJsonResourceFactoryImpl.java @@ -0,0 +1,66 @@ +/* + */ +package org.eclipse.sensinact.gateway.core.geojson.util; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.emf.common.util.URI; + +import org.eclipse.emf.ecore.resource.Resource; + +import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; + +import org.eclipse.sensinact.gateway.core.geojson.GeoJsonPackage; + +import org.gecko.emf.osgi.constants.EMFNamespaces; +import org.osgi.service.component.annotations.Component; + +/** + * + * The Resource Factory associated with the package. + * + * @see org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonResourceImpl + * @generated + */ +@Component(property = { + EMFNamespaces.EMF_CONFIGURATOR_NAME + "=" + GeoJsonPackage.eNAME, + EMFNamespaces.EMF_MODEL_FILE_EXT + "=" + "geojson", + EMFNamespaces.EMF_MODEL_VERSION + "=" + "1.0" +}) +public class GeoJsonResourceFactoryImpl extends ResourceFactoryImpl { + /** + * Creates an instance of the resource factory. + * + * + * @generated + */ + public GeoJsonResourceFactoryImpl() { + super(); + } + + /** + * Creates an instance of the resource. + * + * + * @generated + */ + @Override + public Resource createResource(URI uri) { + Resource result = new GeoJsonResourceImpl(uri); + return result; + } + + /** + * A method providing the Properties the services around this ResourceFactory should be registered with. + * @generated + */ + public Map getServiceProperties() { + Map properties = new HashMap(); + properties.put(EMFNamespaces.EMF_CONFIGURATOR_NAME, GeoJsonPackage.eNAME); + properties.put(EMFNamespaces.EMF_MODEL_FILE_EXT, "geojson"); + properties.put(EMFNamespaces.EMF_MODEL_VERSION, "1.0"); + return properties; + } + +} //GeoJsonResourceFactoryImpl diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src/org/eclipse/sensinact/gateway/core/geojson/util/GeoJsonResourceImpl.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src/org/eclipse/sensinact/gateway/core/geojson/util/GeoJsonResourceImpl.java new file mode 100644 index 00000000..4974f853 --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src/org/eclipse/sensinact/gateway/core/geojson/util/GeoJsonResourceImpl.java @@ -0,0 +1,40 @@ +/** + */ +package org.eclipse.sensinact.gateway.core.geojson.util; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emfcloud.jackson.annotations.EcoreTypeInfo; +import org.gecko.emf.json.configuration.ConfigurableJsonResource; +import org.gecko.emf.json.constants.EMFJs; + +/** + * + * The Resource associated with the package. + * + * @see org.eclipse.sensinact.gateway.core.geojson.util.GeoJsonResourceFactoryImpl + * @generated + */ +public class GeoJsonResourceImpl extends ConfigurableJsonResource { + + private static Map GEOJSON_DEFAULT_OPTIONS = new HashMap<>(); + static { + GEOJSON_DEFAULT_OPTIONS.put(EMFJs.OPTION_SERIALIZE_DEFAULT_VALUE, true); + GEOJSON_DEFAULT_OPTIONS.put(EMFJs.OPTION_TYPE_FIELD, "type"); + GEOJSON_DEFAULT_OPTIONS.put(EMFJs.OPTION_TYPE_USE, EcoreTypeInfo.USE.NAME); + } + + /** + * Creates an instance of the resource. + * + * + * @param uri the URI of the new resource. + * @generated + */ + public GeoJsonResourceImpl(URI uri) { + super(uri, new ConfigurableJsonResource(uri).configureMapper(GEOJSON_DEFAULT_OPTIONS)); + } + +} //GeoJsonResourceImpl diff --git a/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src/org/eclipse/sensinact/gateway/core/geojson/util/package-info.java b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src/org/eclipse/sensinact/gateway/core/geojson/util/package-info.java new file mode 100644 index 00000000..2d26085e --- /dev/null +++ b/backend/org.eclipse.sensinact.gateway.core.geo-json.model/src/org/eclipse/sensinact/gateway/core/geojson/util/package-info.java @@ -0,0 +1,5 @@ +/* + */ +@org.osgi.annotation.bundle.Export +@org.osgi.annotation.versioning.Version("1.0") +package org.eclipse.sensinact.gateway.core.geojson.util; \ No newline at end of file