use of org.n52.shetland.ogc.gml.CodeWithAuthority in project arctic-sea by 52North.
the class TrajectoryObservation method cloneTemplate.
@Override
public OmObservation cloneTemplate() {
SamplingFeature sf = new SamplingFeature(new CodeWithAuthority(""));
sf.setFeatureType(SfConstants.SAMPLING_FEAT_TYPE_SF_SAMPLING_CURVE);
getObservationConstellation().setFeatureOfInterest(sf);
if (isSetSpatialFilteringProfileParameter()) {
removeSpatialFilteringProfileParameter();
}
return cloneTemplate(new TrajectoryObservation());
}
use of org.n52.shetland.ogc.gml.CodeWithAuthority in project arctic-sea by 52North.
the class FeatureCollectionTest method should_remove_member_from_feature_collection.
@Test
public final void should_remove_member_from_feature_collection() {
final FeatureCollection features = new FeatureCollection();
final String feature1Id = "feature-1";
final SamplingFeature feature1 = new SamplingFeature(new CodeWithAuthority(feature1Id));
features.addMember(feature1);
final String feature2Id = "feature-2";
final SamplingFeature feature2 = new SamplingFeature(new CodeWithAuthority(feature2Id));
features.addMember(feature2);
final SamplingFeature removedFeature = (SamplingFeature) features.removeMember(feature2Id);
assertThat(removedFeature, is(equalTo(feature2)));
assertThat(features.getMembers().size(), is(1));
assertThat(features.getMembers().containsKey(feature2Id), is(FALSE));
assertThat(features.getMembers().containsValue(feature2), is(FALSE));
assertThat(features.getMembers().containsKey(feature1Id), is(TRUE));
assertThat(features.getMembers().containsValue(feature1), is(TRUE));
}
use of org.n52.shetland.ogc.gml.CodeWithAuthority in project arctic-sea by 52North.
the class SamplingFeatureComplexTest method should_set_role_correct.
@Test
public void should_set_role_correct() {
final String role = "test-role";
final SamplingFeatureComplex sfc = new SamplingFeatureComplex(role, new SamplingFeature(new CodeWithAuthority("test-feature")));
assertThat(sfc.getRelatedSamplingFeatureRole(), is(role));
}
use of org.n52.shetland.ogc.gml.CodeWithAuthority in project arctic-sea by 52North.
the class SamplingFeatureTest method isSetRelatedSamplingFeatures_should_return_false_if_not_set.
@Test
public final void isSetRelatedSamplingFeatures_should_return_false_if_not_set() {
final SamplingFeature feature = new SamplingFeature(null);
assertThat(feature.isSetRelatedSamplingFeatures(), is(FALSE));
feature.addRelatedSamplingFeature(new SamplingFeatureComplex("test-role", new SamplingFeature(new CodeWithAuthority("test-feature"))));
assertThat(feature.isSetRelatedSamplingFeatures(), is(TRUE));
feature.setRelatedSamplingFeatures(null);
assertThat(feature.isSetRelatedSamplingFeatures(), is(FALSE));
feature.setRelatedSamplingFeatures(Lists.<SamplingFeatureComplex>newArrayList());
assertThat(feature.isSetRelatedSamplingFeatures(), is(FALSE));
}
use of org.n52.shetland.ogc.gml.CodeWithAuthority in project arctic-sea by 52North.
the class SamplingFeatureTest method setRelatedSamplingFeatures_should_set_all_elements_and_reset_if_set_before.
@Test
public final void setRelatedSamplingFeatures_should_set_all_elements_and_reset_if_set_before() {
final SamplingFeature feature = new SamplingFeature(null);
final SamplingFeatureComplex relatedSamplingFeature = new SamplingFeatureComplex("test-role", new SamplingFeature(new CodeWithAuthority("test-feature")));
final SamplingFeatureComplex relatedSamplingFeature2 = new SamplingFeatureComplex("test-role", new SamplingFeature(new CodeWithAuthority("test-feature-2")));
List<SamplingFeatureComplex> list = Lists.newArrayList(relatedSamplingFeature, relatedSamplingFeature2);
feature.setRelatedSamplingFeatures(list);
validate(feature, relatedSamplingFeature, relatedSamplingFeature2);
final SamplingFeatureComplex relatedSamplingFeature3 = new SamplingFeatureComplex("test-role", new SamplingFeature(new CodeWithAuthority("test-feature-3")));
final SamplingFeatureComplex relatedSamplingFeature4 = new SamplingFeatureComplex("test-role", new SamplingFeature(new CodeWithAuthority("test-feature-4")));
list = Lists.newArrayList(relatedSamplingFeature3, relatedSamplingFeature4);
feature.setRelatedSamplingFeatures(list);
validate(feature, relatedSamplingFeature3, relatedSamplingFeature4);
}
Aggregations