Search in sources :

Example 1 with PropertyNameType

use of org.geosdi.geoplatform.xml.filter.v110.PropertyNameType in project ddf by codice.

the class WfsFilterDelegate method createPropertyNameType.

private JAXBElement<PropertyNameType> createPropertyNameType(String propertyNameValue) {
    JAXBElement<PropertyNameType> propertyNameType = filterObjectFactory.createPropertyName(new PropertyNameType());
    propertyNameType.getValue().setContent(propertyNameValue);
    return propertyNameType;
}
Also used : PropertyNameType(ogc.schema.opengis.filter.v_1_0_0.PropertyNameType)

Example 2 with PropertyNameType

use of org.geosdi.geoplatform.xml.filter.v110.PropertyNameType in project geotoolkit by Geomatys.

the class SEforSLD110Test method testLineSymbolizer.

@Test
public void testLineSymbolizer() throws JAXBException {
    final Unmarshaller UNMARSHALLER = POOL.acquireUnmarshaller();
    final Marshaller MARSHALLER = POOL.acquireMarshaller();
    // Read test
    Object obj = UNMARSHALLER.unmarshal(FILE_SE_SYMBOL_LINE);
    assertNotNull(obj);
    JAXBElement<org.geotoolkit.se.xml.v110.LineSymbolizerType> jax = (JAXBElement<org.geotoolkit.se.xml.v110.LineSymbolizerType>) obj;
    LineSymbolizer lineSymbol = TRANSFORMER_GT.visit(jax.getValue());
    assertNotNull(lineSymbol);
    assertEquals("the_geom", lineSymbol.getGeometryPropertyName());
    assertEquals(Units.METRE, lineSymbol.getUnitOfMeasure());
    assertNotNull(lineSymbol.getStroke());
    assertEquals(floatValue(lineSymbol.getStroke().getWidth()), 13f, DELTA);
    assertEquals(floatValue(lineSymbol.getStroke().getOpacity()), 0.4f, DELTA);
    assertEquals(stringValue(lineSymbol.getStroke().getLineJoin()), "bevel");
    assertEquals(stringValue(lineSymbol.getStroke().getLineCap()), "butt");
    assertEquals(floatValue(lineSymbol.getStroke().getDashOffset()), 2.3f, DELTA);
    assertEquals(colorValue(lineSymbol.getStroke().getColor()), ObjectConverters.convert("#FF0000", Color.class));
    // Write test
    JAXBElement<org.geotoolkit.se.xml.v110.LineSymbolizerType> pvt = TRANSFORMER_OGC.visit(lineSymbol, null);
    assertNotNull(pvt);
    assertEquals(new PropertyNameType("the_geom"), ((JAXBElement) pvt.getValue().getGeometry().getContent().get(0)).getValue());
    assertNotNull(pvt.getValue().getStroke());
    MARSHALLER.marshal(pvt, TEST_FILE_SE_SYMBOL_LINE);
    POOL.recycle(MARSHALLER);
    POOL.recycle(UNMARSHALLER);
}
Also used : Marshaller(javax.xml.bind.Marshaller) Color(java.awt.Color) JAXBElement(javax.xml.bind.JAXBElement) LineSymbolizer(org.opengis.style.LineSymbolizer) Unmarshaller(javax.xml.bind.Unmarshaller) PropertyNameType(org.geotoolkit.ogc.xml.v110.PropertyNameType) Test(org.junit.Test)

Example 3 with PropertyNameType

use of org.geosdi.geoplatform.xml.filter.v110.PropertyNameType in project geotoolkit by Geomatys.

the class FilterFactoryImpl method equal.

@Override
public BinaryComparisonOperator<Object> equal(final Expression<Object, ?> expr1, final Expression<Object, ?> expr2) {
    LiteralType lit = null;
    PropertyNameType propName = null;
    if (expr1 instanceof PropertyNameType) {
        propName = (PropertyNameType) expr1;
    } else if (expr2 instanceof PropertyNameType) {
        propName = (PropertyNameType) expr2;
    }
    if (expr1 instanceof LiteralType) {
        lit = (LiteralType) expr1;
    } else if (expr2 instanceof LiteralType) {
        lit = (LiteralType) expr2;
    }
    return new PropertyIsEqualToType(lit, propName, null);
}
Also used : PropertyIsEqualToType(org.geotoolkit.ogc.xml.v110.PropertyIsEqualToType) LiteralType(org.geotoolkit.ogc.xml.v110.LiteralType) PropertyNameType(org.geotoolkit.ogc.xml.v110.PropertyNameType)

Example 4 with PropertyNameType

use of org.geosdi.geoplatform.xml.filter.v110.PropertyNameType in project geotoolkit by Geomatys.

the class FilterFactoryImpl method begins.

@Override
public TemporalOperator<Object> begins(final Expression<Object, ?> expr1, final Expression<Object, ?> expr2) {
    Object temporal = null;
    PropertyNameType propName = null;
    if (expr1 instanceof PropertyNameType) {
        propName = (PropertyNameType) expr1;
        temporal = expr2;
    } else if (expr2 instanceof PropertyNameType) {
        propName = (PropertyNameType) expr2;
        temporal = expr1;
    }
    return new TimeBeginsType(propName.getXPath(), temporal);
}
Also used : TimeBeginsType(org.geotoolkit.ogc.xml.v110.TimeBeginsType) PropertyNameType(org.geotoolkit.ogc.xml.v110.PropertyNameType)

Example 5 with PropertyNameType

use of org.geosdi.geoplatform.xml.filter.v110.PropertyNameType in project geotoolkit by Geomatys.

the class FilterFactoryImpl method anyInteracts.

@Override
public TemporalOperator<Object> anyInteracts(final Expression<Object, ?> expr1, final Expression<Object, ?> expr2) {
    Object temporal = null;
    PropertyNameType propName = null;
    if (expr1 instanceof PropertyNameType) {
        propName = (PropertyNameType) expr1;
        temporal = expr2;
    } else if (expr2 instanceof PropertyNameType) {
        propName = (PropertyNameType) expr2;
        temporal = expr1;
    }
    return new TimeAnyInteractsType(propName.getXPath(), temporal);
}
Also used : TimeAnyInteractsType(org.geotoolkit.ogc.xml.v110.TimeAnyInteractsType) PropertyNameType(org.geotoolkit.ogc.xml.v110.PropertyNameType)

Aggregations

PropertyNameType (org.geotoolkit.ogc.xml.v110.PropertyNameType)62 JAXBElement (javax.xml.bind.JAXBElement)46 LiteralType (org.geotoolkit.ogc.xml.v110.LiteralType)38 Test (org.junit.Test)38 Unmarshaller (javax.xml.bind.Unmarshaller)37 Marshaller (javax.xml.bind.Marshaller)36 ValueReference (org.opengis.filter.ValueReference)36 Literal (org.opengis.filter.Literal)30 Filter (org.opengis.filter.Filter)26 PropertyNameType (org.geotoolkit.ogc.xml.v100.PropertyNameType)20 BinaryComparisonOperator (org.opengis.filter.BinaryComparisonOperator)20 LiteralType (org.geotoolkit.ogc.xml.v100.LiteralType)16 FilterType (org.geotoolkit.ogc.xml.v110.FilterType)16 PropertyNameType (net.opengis.filter.v_1_1_0.PropertyNameType)13 FilterType (org.geotoolkit.ogc.xml.v100.FilterType)12 Expression (org.opengis.filter.Expression)12 ComparisonOpsType (org.geotoolkit.ogc.xml.v100.ComparisonOpsType)10 BinaryComparisonOpType (org.geotoolkit.ogc.xml.v100.BinaryComparisonOpType)9 BinaryComparisonOpType (org.geotoolkit.ogc.xml.v110.BinaryComparisonOpType)9 ComparisonOpsType (org.geotoolkit.ogc.xml.v110.ComparisonOpsType)9