• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java AnyScalarPropertyType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.opengis.swe.x101.AnyScalarPropertyType的典型用法代码示例。如果您正苦于以下问题:Java AnyScalarPropertyType类的具体用法?Java AnyScalarPropertyType怎么用?Java AnyScalarPropertyType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AnyScalarPropertyType类属于net.opengis.swe.x101包,在下文中一共展示了AnyScalarPropertyType类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addMetadataField

import net.opengis.swe.x101.AnyScalarPropertyType; //导入依赖的package包/类
private void addMetadataField(SimpleDataRecordType xbSimpleDataRecord, String name, String definition,
        String value) {
    AnyScalarPropertyType xbField = xbSimpleDataRecord.addNewField();
    if (name != null) {
        xbField.setName(name);
    }        
    Text xbText = xbField.addNewText();
    if (definition != null) {
        xbText.setDefinition(definition);
    }
    if (value == null) {
        value = "unknown";
    }
    xbText.setValue(value);        
}
 
开发者ID:ioos,项目名称:i52n-sos,代码行数:16,代码来源:IoosSensorMLEncoderv101.java


示例2: should_add_service_metadata

import net.opengis.swe.x101.AnyScalarPropertyType; //导入依赖的package包/类
@Test
public void should_add_service_metadata() throws OwsExceptionReport{
    SensorMLDocument xbSensorMLDoc = encodeSensorML(getBlankSensorML());
    Capabilities xbServiceMetadataCapabilities = findCapabilities(xbSensorMLDoc.getSensorML().getCapabilitiesArray(),
            IoosSosConstants.IOOS_SERVICE_METADATA);
    assertNotNull(xbServiceMetadataCapabilities.getAbstractDataRecord());
    assertThat(xbServiceMetadataCapabilities.getAbstractDataRecord(), instanceOf(SimpleDataRecordType.class));
    SimpleDataRecordType xbSimpleDataRecord = (SimpleDataRecordType) xbServiceMetadataCapabilities.getAbstractDataRecord();
    
    AnyScalarPropertyType xbTemplateVersionField = findField(xbSimpleDataRecord, IoosSosConstants.IOOS_TEMPLATE_VERSION);
    Text xbTemplateVersionText = xbTemplateVersionField.getText();
    assertEquals(xbTemplateVersionText.getDefinition(), IoosSosConstants.IOOS_VERSION_DEFINITION);

    findField(xbSimpleDataRecord, IoosSosConstants.SOFTWARE_VERSION);
}
 
开发者ID:ioos,项目名称:i52n-sos,代码行数:16,代码来源:IoosSensorMLEncoderv101Test.java


示例3: findField

import net.opengis.swe.x101.AnyScalarPropertyType; //导入依赖的package包/类
private AnyScalarPropertyType findField(SimpleDataRecordType xbSimpleDataRecord, String fieldName){
    for (AnyScalarPropertyType xbField : xbSimpleDataRecord.getFieldArray()){
        if (xbField.getName().equals(fieldName)) {
            return xbField;
        }
    }
    fail(String.format("Couldn't find field '%s'", fieldName));
    return null;
}
 
开发者ID:ioos,项目名称:i52n-sos,代码行数:10,代码来源:IoosSensorMLEncoderv101Test.java


示例4: getPhenomenonAndUomFromScalar

import net.opengis.swe.x101.AnyScalarPropertyType; //导入依赖的package包/类
/**
 * Parse the phenomenon and UOM from an {@link AnyScalarPropertyType}
 */
private Map<String, Object> getPhenomenonAndUomFromScalar(AnyScalarPropertyType scalar) throws TransformationException {

	Map<String, Object> result = new HashMap<String, Object>();
	result.put(IS_TIME_BOOLEAN_KEY, false);
	result.put(IS_UCUM_BOOLEAN_KEY, false);
	result.put(POSITION_INT_KEY, -1);

	String phen;
	String uom;

	if (scalar.isSetBoolean()) {
		phen = scalar.getBoolean().getDefinition().replaceAll(":", "__").replaceAll("\\.", "_");
		uom = "";
	} else if (scalar.isSetQuantity()) {
		phen = scalar.getQuantity().getDefinition().replaceAll(":", "__").replaceAll("\\.", "_");
		uom = getUom(scalar.getQuantity().getUom(), result);
	} else if (scalar.isSetCount()) {
		phen = scalar.getCount().getDefinition().replaceAll(":", "__").replaceAll("\\.", "_");
		uom = "";
	} else if (scalar.isSetTime()) {
		phen = scalar.getTime().getDefinition().replaceAll(":", "__").replaceAll("\\.", "_");
		uom = getUom(scalar.getTime().getUom(), result);
		result.put(IS_TIME_BOOLEAN_KEY, true);
	} else if (scalar.isSetText()) {
		uom = "";
		phen = scalar.getText().getDefinition().replaceAll(":", "__").replaceAll("\\.", "_");
	} else if(scalar.isSetCategory()) {
		uom = "";
		phen = scalar.getCategory().getDefinition().replaceAll(":", "__").replaceAll("\\.", "_");
	} else {
		return null;
	}

	result.put(PHENOMENON_STRING_KEY, phen);
	result.put(UOM_STRING_KEY, uom);

	return result;
}
 
开发者ID:52North,项目名称:epos,代码行数:42,代码来源:OMParser.java


示例5: getPhenomenonAndUomFromScalar

import net.opengis.swe.x101.AnyScalarPropertyType; //导入依赖的package包/类
/**
 * Parse the phenomenon and UOM from an {@link AnyScalarPropertyType}
 */
private Map<String, Object> getPhenomenonAndUomFromScalar(AnyScalarPropertyType scalar) throws Exception {

	Map<String, Object> result = new HashMap<String, Object>();
	result.put(IS_TIME_BOOLEAN_KEY, false);
	result.put(IS_UCUM_BOOLEAN_KEY, false);
	result.put(POSITION_INT_KEY, -1);

	String phen;
	String uom;

	if (scalar.isSetBoolean()) {
		phen = scalar.getBoolean().getDefinition().replaceAll(":", "__").replaceAll("\\.", "_");
		uom = "";
	} else if (scalar.isSetQuantity()) {
		phen = scalar.getQuantity().getDefinition().replaceAll(":", "__").replaceAll("\\.", "_");
		uom = getUom(scalar.getQuantity().getUom(), result);
	} else if (scalar.isSetCount()) {
		phen = scalar.getCount().getDefinition().replaceAll(":", "__").replaceAll("\\.", "_");
		uom = "";
	} else if (scalar.isSetTime()) {
		phen = scalar.getTime().getDefinition().replaceAll(":", "__").replaceAll("\\.", "_");
		uom = getUom(scalar.getTime().getUom(), result);
		result.put(IS_TIME_BOOLEAN_KEY, true);
	} else if (scalar.isSetText()) {
		uom = "";
		phen = scalar.getText().getDefinition().replaceAll(":", "__").replaceAll("\\.", "_");
	} else if(scalar.isSetCategory()) {
		uom = "";
		phen = scalar.getCategory().getDefinition().replaceAll(":", "__").replaceAll("\\.", "_");
	} else {
		return null;
	}

	result.put(PHENOMENON_STRING_KEY, phen);
	result.put(UOM_STRING_KEY, uom);

	return result;
}
 
开发者ID:52North,项目名称:SES,代码行数:42,代码来源:OMParser.java


示例6: shouldSetOfferings

import net.opengis.swe.x101.AnyScalarPropertyType; //导入依赖的package包/类
@Test public void
shouldSetOfferings()
{
	final Capabilities offering = getCapabilitiesByName("offerings");
	final AnyScalarPropertyType field = ((SimpleDataRecordType)offering.getAbstractDataRecord()).getFieldArray(0);
	assertThat(field.getName(),is(offeringName));
	assertThat(field.isSetText(),is(true));
	assertThat(field.getText().getDefinition(), is("urn:ogc:def:identifier:OGC:1.0:offeringID"));
	assertThat(field.getText().getValue(), is(offeringUri));
}
 
开发者ID:52North,项目名称:sos-importer,代码行数:11,代码来源:DescriptionBuilderTest.java


示例7: createRestSensor

import net.opengis.swe.x101.AnyScalarPropertyType; //导入依赖的package包/类
/**
 * Creating example sensor with id <tt>sensorId</tt> and offering
 * <tt>offeringId</tt> observing <tt>test-observable-property</tt> with type
 * <tt>http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement</tt>
 * with feature
 * <tt>http://www.opengis.net/def/samplingFeatureType/OGC-OM/2.0/SF_SamplingPoint</tt>
 */
protected String createRestSensor(final String sensorId, final String offeringId) {
    final SensorDocument restSensor = SensorDocument.Factory.newInstance();
    final SystemType system =
            (SystemType) restSensor
                    .addNewSensor()
                    .addNewProcess()
                    .substitute(new QName("http://www.opengis.net/sensorML/1.0.1", "System", "sml"),
                            SystemType.type);
    system.setIdentificationArray(createIdentifications(sensorId, offeringId));
    system.setInputs(createInputList("test-observable-property"));
    system.setOutputs(createOutputList("test-observable-property"));
    // capabilities
    Capabilities capabilities = system.addNewCapabilities();
    capabilities.setName("InsertionMetadata");
    SimpleDataRecordType dataRecord =
            (SimpleDataRecordType) capabilities.addNewAbstractDataRecord().substitute(
                    new QName("http://www.opengis.net/swe/1.0.1", "SimpleDataRecord", "swe"),
                    SimpleDataRecordType.type);
    AnyScalarPropertyType field1 = dataRecord.addNewField();
    field1.setName("sos:ObservationType");
    field1.addNewText().setValue("http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement");
    AnyScalarPropertyType field2 = dataRecord.addNewField();
    field2.setName("sos:FeatureOfInterestType");
    field2.addNewText().setValue("http://www.opengis.net/def/samplingFeatureType/OGC-OM/2.0/SF_SamplingPoint");
    Position position = system.addNewPosition();
    position.setName("test-sensor-position");
    position.setVector(createCoordinates(52.0, 7.5, 42.0, "http://www.opengis.net/def/crs/EPSG/0/4326"));
    position.setName("test-sensor-position");
    // .setIdentifier(sensorId);
    return restSensor.xmlText();
}
 
开发者ID:52North,项目名称:SOS-Test-Suite,代码行数:39,代码来源:RestBindingTest.java



注:本文中的net.opengis.swe.x101.AnyScalarPropertyType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FinalVoxelDimensions类代码示例发布时间:2022-05-22
下一篇:
Java ArtifactResponse类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap