Search in sources :

Example 1 with PropertyNameType

use of net.opengis.filter.v_1_1_0.PropertyNameType in project ddf by codice.

the class CswFilterFactory method createDistanceBufferType.

@SuppressWarnings("unchecked")
private DistanceBufferType createDistanceBufferType(PropertyNameType propertyName, JAXBElement<? extends AbstractGeometryType> geometry, DistanceType distance) {
    DistanceBufferType distanceBuffer = new DistanceBufferType();
    distanceBuffer.setDistance(distance);
    distanceBuffer.setGeometry((JAXBElement<AbstractGeometryType>) geometry);
    distanceBuffer.setPropertyName(propertyName);
    return distanceBuffer;
}
Also used : AbstractGeometryType(net.opengis.gml.v_3_1_1.AbstractGeometryType) DistanceBufferType(net.opengis.filter.v_1_1_0.DistanceBufferType)

Example 2 with PropertyNameType

use of net.opengis.filter.v_1_1_0.PropertyNameType in project ddf by codice.

the class CswFilterFactory method createPropertyNameType.

private PropertyNameType createPropertyNameType(String propertyName) {
    PropertyNameType propertyNameType = new PropertyNameType();
    propertyNameType.setContent(Arrays.asList(new Object[] { propertyName }));
    return propertyNameType;
}
Also used : PropertyNameType(net.opengis.filter.v_1_1_0.PropertyNameType)

Example 3 with PropertyNameType

use of net.opengis.filter.v_1_1_0.PropertyNameType in project ddf by codice.

the class CswQueryFactoryTest method createTemporalBinaryComparisonOpType.

private BinaryComparisonOpType createTemporalBinaryComparisonOpType(String attr, String comparison) {
    BinaryComparisonOpType comparisonOp = new BinaryComparisonOpType();
    PropertyNameType propName = new PropertyNameType();
    propName.getContent().add(attr);
    comparisonOp.getExpression().add(filterObjectFactory.createPropertyName(propName));
    LiteralType literal = new LiteralType();
    literal.getContent().add(comparison);
    comparisonOp.getExpression().add(filterObjectFactory.createLiteral(literal));
    return comparisonOp;
}
Also used : LiteralType(net.opengis.filter.v_1_1_0.LiteralType) BinaryComparisonOpType(net.opengis.filter.v_1_1_0.BinaryComparisonOpType) PropertyNameType(net.opengis.filter.v_1_1_0.PropertyNameType)

Example 4 with PropertyNameType

use of net.opengis.filter.v_1_1_0.PropertyNameType in project ddf by codice.

the class CswQueryFactoryTest method testPostGetRecordsValidSort.

@Test
public void testPostGetRecordsValidSort() throws CswException, UnsupportedQueryException, SourceUnavailableException, FederationException {
    GetRecordsType grr = createDefaultPostRecordsRequest();
    grr.setResultType(ResultType.RESULTS);
    QueryType query = new QueryType();
    SortByType incomingSort = new SortByType();
    SortPropertyType propType = new SortPropertyType();
    PropertyNameType propName = new PropertyNameType();
    propName.setContent(Collections.singletonList(TITLE_TEST_ATTRIBUTE));
    propType.setPropertyName(propName);
    incomingSort.getSortProperty().add(propType);
    query.setSortBy(incomingSort);
    JAXBElement<QueryType> jaxbQuery = new JAXBElement<>(cswQnameOutPutSchema, QueryType.class, query);
    grr.setAbstractQuery(jaxbQuery);
    QueryRequest queryRequest = queryFactory.getQuery(grr);
    SortBy resultSort = queryRequest.getQuery().getSortBy();
    assertThat(resultSort.getPropertyName().getPropertyName(), is(CQL_FRAMEWORK_TEST_ATTRIBUTE));
    assertThat(resultSort.getSortOrder(), is(SortOrder.ASCENDING));
}
Also used : QueryRequest(ddf.catalog.operation.QueryRequest) SortBy(org.opengis.filter.sort.SortBy) GetRecordsType(net.opengis.cat.csw.v_2_0_2.GetRecordsType) SortPropertyType(net.opengis.filter.v_1_1_0.SortPropertyType) SortByType(net.opengis.filter.v_1_1_0.SortByType) JAXBElement(javax.xml.bind.JAXBElement) QueryType(net.opengis.cat.csw.v_2_0_2.QueryType) PropertyNameType(net.opengis.filter.v_1_1_0.PropertyNameType) Test(org.junit.Test)

Example 5 with PropertyNameType

use of net.opengis.filter.v_1_1_0.PropertyNameType in project ddf by codice.

the class CswQueryFactoryTest method createDistanceBufferType.

private DistanceBufferType createDistanceBufferType() {
    DistanceBufferType distanceBuffer = new DistanceBufferType();
    PropertyNameType propName = new PropertyNameType();
    propName.getContent().add(SPATIAL_TEST_ATTRIBUTE);
    distanceBuffer.setPropertyName(propName);
    DistanceType distance = filterObjectFactory.createDistanceType();
    distance.setUnits(REL_GEO_UNITS);
    distance.setContent(Double.toString(REL_GEO_DISTANCE));
    distanceBuffer.setDistance(distance);
    distanceBuffer.setGeometry(createPolygon());
    return distanceBuffer;
}
Also used : DistanceBufferType(net.opengis.filter.v_1_1_0.DistanceBufferType) DistanceType(net.opengis.filter.v_1_1_0.DistanceType) PropertyNameType(net.opengis.filter.v_1_1_0.PropertyNameType)

Aggregations

PropertyNameType (net.opengis.filter.v_1_1_0.PropertyNameType)10 BinarySpatialOpType (net.opengis.filter.v_1_1_0.BinarySpatialOpType)4 DistanceBufferType (net.opengis.filter.v_1_1_0.DistanceBufferType)4 Geometry (com.vividsolutions.jts.geom.Geometry)3 DistanceType (net.opengis.filter.v_1_1_0.DistanceType)3 SortByType (net.opengis.filter.v_1_1_0.SortByType)3 SortPropertyType (net.opengis.filter.v_1_1_0.SortPropertyType)3 JAXBElement (javax.xml.bind.JAXBElement)2 GetRecordsType (net.opengis.cat.csw.v_2_0_2.GetRecordsType)2 QueryType (net.opengis.cat.csw.v_2_0_2.QueryType)2 AbstractGeometryType (net.opengis.gml.v_3_1_1.AbstractGeometryType)2 QueryRequest (ddf.catalog.operation.QueryRequest)1 StringReader (java.io.StringReader)1 LinkedList (java.util.LinkedList)1 JAXBException (javax.xml.bind.JAXBException)1 Unmarshaller (javax.xml.bind.Unmarshaller)1 QName (javax.xml.namespace.QName)1 XMLInputFactory (javax.xml.stream.XMLInputFactory)1 XMLStreamReader (javax.xml.stream.XMLStreamReader)1 DistributedSearchType (net.opengis.cat.csw.v_2_0_2.DistributedSearchType)1