use of org.geotools.feature.NameImpl in project GeoGig by boundlessgeo.
the class ImportOp method forceFeatureTypeName.
private SimpleFeatureType forceFeatureTypeName(SimpleFeatureType featureType, String path) {
SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder();
builder.setAttributes(featureType.getAttributeDescriptors());
builder.setName(new NameImpl(featureType.getName().getNamespaceURI(), path));
builder.setCRS(featureType.getCoordinateReferenceSystem());
featureType = builder.buildFeatureType();
return featureType;
}
use of org.geotools.feature.NameImpl in project ddf by codice.
the class CswQueryFactory method buildSort.
private SortBy buildSort(SortByType sort) throws CswException {
if (sort == null || sort.getSortProperty() == null) {
return null;
}
SortBy[] sortByArr = parseSortBy(sort);
if (sortByArr.length > 1) {
LOGGER.debug("Query request has multiple sort criteria, only primary will be used");
}
SortBy sortBy = sortByArr[0];
if (sortBy.getPropertyName() == null) {
LOGGER.debug("No property name in primary sort criteria");
return null;
}
if (!attributeRegistry.lookup(sortBy.getPropertyName().getPropertyName()).isPresent() && !DefaultCswRecordMap.hasDefaultMetacardFieldForPrefixedString(sortBy.getPropertyName().getPropertyName(), sortBy.getPropertyName().getNamespaceContext())) {
throw new CswException("Property " + sortBy.getPropertyName().getPropertyName() + " is not a valid SortBy Field", CswConstants.INVALID_PARAMETER_VALUE, "SortProperty");
}
String name = DefaultCswRecordMap.getDefaultMetacardFieldForPrefixedString(sortBy.getPropertyName().getPropertyName(), sortBy.getPropertyName().getNamespaceContext());
PropertyName propName = new AttributeExpressionImpl(new NameImpl(name));
return new SortByImpl(propName, sortBy.getSortOrder());
}
use of org.geotools.feature.NameImpl in project ddf by codice.
the class TestCswRecordMapperFilterVisitor method testVisitWithBoundingBoxProperty.
@Test
public void testVisitWithBoundingBoxProperty() {
AttributeExpressionImpl propName = new AttributeExpressionImpl(new NameImpl(new QName(CswConstants.DUBLIN_CORE_SCHEMA, CswConstants.OWS_BOUNDING_BOX, CswConstants.DUBLIN_CORE_NAMESPACE_PREFIX)));
CswRecordMapperFilterVisitor visitor = new CswRecordMapperFilterVisitor(metacardType, mockMetacardTypeList);
PropertyName propertyName = (PropertyName) visitor.visit(propName, null);
assertThat(propertyName.getPropertyName(), is(Metacard.ANY_GEO));
}
Aggregations