Search in sources :

Example 11 with PropertyNameType

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

the class CswFilterFactory method createPropertyNameType.

private JAXBElement<PropertyNameType> createPropertyNameType(List<Object> propertyNameValues) {
    JAXBElement<PropertyNameType> propertyNameType = filterObjectFactory.createPropertyName(new PropertyNameType());
    propertyNameType.getValue().setContent(propertyNameValues);
    return propertyNameType;
}
Also used : PropertyNameType(net.opengis.filter.v_1_1_0.PropertyNameType)

Example 12 with PropertyNameType

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

the class CswFilterFactory method createBinarySpatialOpTypeUsingEnvelope.

private BinarySpatialOpType createBinarySpatialOpTypeUsingEnvelope(PropertyNameType propertyName, JAXBElement<EnvelopeType> envelope) {
    BinarySpatialOpType binarySpatialOpType = new BinarySpatialOpType();
    binarySpatialOpType.setPropertyName(propertyName);
    binarySpatialOpType.setEnvelope(envelope);
    return binarySpatialOpType;
}
Also used : BinarySpatialOpType(net.opengis.filter.v_1_1_0.BinarySpatialOpType)

Example 13 with PropertyNameType

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

the class CswFilterFactory method createBinarySpatialOpType.

private BinarySpatialOpType createBinarySpatialOpType(PropertyNameType propertyName, String wkt, BinarySpatialOperand geometryOrEnvelope) {
    BinarySpatialOpType binarySpatialOpType = null;
    if (geometryOrEnvelope == BinarySpatialOperand.GEOMETRY) {
        wkt = convertWktToLatLonOrdering(wkt);
        Geometry geometry = getGeometryFromWkt(wkt);
        JAXBElement<? extends AbstractGeometryType> geometryJaxbElement = convertGeometry(geometry);
        binarySpatialOpType = createBinarySpatialOpTypeUsingGeometry(propertyName, geometryJaxbElement);
    } else {
        JAXBElement<EnvelopeType> envelopeJaxbElement = createEnvelopeType(wkt);
        binarySpatialOpType = createBinarySpatialOpTypeUsingEnvelope(propertyName, envelopeJaxbElement);
    }
    return binarySpatialOpType;
}
Also used : Geometry(com.vividsolutions.jts.geom.Geometry) EnvelopeType(net.opengis.gml.v_3_1_1.EnvelopeType) BinarySpatialOpType(net.opengis.filter.v_1_1_0.BinarySpatialOpType)

Example 14 with PropertyNameType

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

the class AbstractCswSource method createSortBy.

private SortByType createSortBy(Query query) {
    SortByType sortBy = null;
    if (query.getSortBy() != null) {
        sortBy = new SortByType();
        SortPropertyType sortProperty = new SortPropertyType();
        PropertyNameType propertyName = new PropertyNameType();
        String propName;
        if (query.getSortBy().getPropertyName() != null) {
            propName = query.getSortBy().getPropertyName().getPropertyName();
            if (propName != null) {
                if (Result.TEMPORAL.equals(propName) || Metacard.ANY_DATE.equals(propName)) {
                    propName = Core.MODIFIED;
                } else if (Result.RELEVANCE.equals(propName) || Metacard.ANY_TEXT.equals(propName)) {
                    propName = Core.TITLE;
                } else if (Result.DISTANCE.equals(propName) || Metacard.ANY_GEO.equals(propName)) {
                    return null;
                }
                propertyName.setContent(Arrays.asList((Object) cswFilterDelegate.mapPropertyName(propName)));
                sortProperty.setPropertyName(propertyName);
                if (SortOrder.DESCENDING.equals(query.getSortBy().getSortOrder())) {
                    sortProperty.setSortOrder(SortOrderType.DESC);
                } else {
                    sortProperty.setSortOrder(SortOrderType.ASC);
                }
                sortBy.getSortProperty().add(sortProperty);
            }
        } else {
            return null;
        }
    }
    return sortBy;
}
Also used : SortPropertyType(net.opengis.filter.v_1_1_0.SortPropertyType) SortByType(net.opengis.filter.v_1_1_0.SortByType) PropertyNameType(net.opengis.filter.v_1_1_0.PropertyNameType)

Example 15 with PropertyNameType

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

the class CswQueryFactoryTest method createBinarySpatialOpType.

private BinarySpatialOpType createBinarySpatialOpType() {
    BinarySpatialOpType binarySpatialOps = new BinarySpatialOpType();
    PropertyNameType propName = new PropertyNameType();
    propName.getContent().add(SPATIAL_TEST_ATTRIBUTE);
    binarySpatialOps.setPropertyName(propName);
    binarySpatialOps.setGeometry(createPolygon());
    return binarySpatialOps;
}
Also used : BinarySpatialOpType(net.opengis.filter.v_1_1_0.BinarySpatialOpType) 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