/** @see org.geotools.data.ResourceInfo#getTitle() */ public String getTitle() { InternationalString description = info.getFeatureType().getDescription(); return description == null ? info.getFeatureTypeName() : description.toString(); }
null, null, baseType.getDescription());
/** Initializes the builder with state from a pre-existing feature type. */ public void init(SimpleFeatureType type) { init(); if (type == null) return; uri = type.getName().getNamespaceURI(); local = type.getName().getLocalPart(); description = type.getDescription(); restrictions = null; restrictions().addAll(type.getRestrictions()); this.defaultCrs = type.getCoordinateReferenceSystem(); this.defaultCrsSet = true; if (type.getGeometryDescriptor() != null) { this.defaultGeometry = type.getGeometryDescriptor().getLocalName(); } attributes = null; attributes().addAll(type.getAttributeDescriptors()); isAbstract = type.isAbstract(); superType = (SimpleFeatureType) type.getSuper(); }
@Override protected SimpleFeatureType buildTargetFeatureType() { // create schema SimpleFeatureTypeBuilder tb = new SimpleFeatureTypeBuilder(); for (AttributeDescriptor descriptor : delegate.getSchema().getAttributeDescriptors()) { if (!(descriptor.getType() instanceof GeometryTypeImpl) || (!delegate.getSchema().getGeometryDescriptor().equals(descriptor))) { tb.add(descriptor); } else { AttributeTypeBuilder builder = new AttributeTypeBuilder(); builder.setBinding(MultiPolygon.class); AttributeDescriptor attributeDescriptor = builder.buildDescriptor(descriptor.getLocalName(), builder.buildType()); tb.add(attributeDescriptor); if (tb.getDefaultGeometry() == null) { tb.setDefaultGeometry(descriptor.getLocalName()); } } } tb.setDescription(delegate.getSchema().getDescription()); tb.setCRS(delegate.getSchema().getCoordinateReferenceSystem()); tb.setName(delegate.getSchema().getName()); return tb.buildFeatureType(); }
builder.setName(featureType.getName()); builder.setAbstract(featureType.isAbstract()); builder.setDescription(featureType.getDescription()); if (featureType.getSuper() instanceof SimpleFeatureType) { builder.setSuperType((SimpleFeatureType) featureType.getSuper());
/** * @see org.geotools.data.ResourceInfo#getTitle() */ public String getTitle() { InternationalString description = info.getFeatureType().getDescription(); return description == null ? info.getFeatureTypeName() : description.toString(); }
builder.setName(featureType.getName()); builder.setAbstract(featureType.isAbstract()); builder.setDescription(featureType.getDescription()); if (featureType.getSuper() instanceof SimpleFeatureType) { builder.setSuperType((SimpleFeatureType) featureType.getSuper());
tb.setDescription(firstFeatureCollectionSchema.getDescription()); tb.setCRS(firstFeatureCollectionSchema.getCoordinateReferenceSystem()); tb.setAbstract(firstFeatureCollectionSchema.isAbstract());
private VectorCapabilitiesInfo getVectorCapabilitiesInfo(DataStore store, String typeName) { VectorCapabilitiesInfo vci = new VectorCapabilitiesInfo(); vci.setTypeName(typeName); String[] tt = typeName.split(":", 2); if (tt.length == 2) { vci.setNamespace(tt[0]); vci.setName(tt[1]); } else { vci.setName(typeName); } try { SimpleFeatureType sft = store.getSchema(typeName); vci.setDescription((sft.getDescription() != null ? sft.getDescription().toString() : "")); vci.setCrs(sft.getCoordinateReferenceSystem().getIdentifiers().iterator().next().toString()); vci.setGeometryType((sft.getGeometryDescriptor() != null ? sft.getGeometryDescriptor() .getType().getBinding().getSimpleName() : "?")); } catch (Exception e) { vci.setDescription("[Failed retrieving metadata!]"); LOG.debug("Failed retrieving metadata: ", e); } return vci; }
vci.setDescription((sft.getDescription() != null ? sft.getDescription().toString() : "")); vci.setCrs(sft.getCoordinateReferenceSystem().getIdentifiers().iterator().next().toString()); vci.setGeometryType((sft.getGeometryDescriptor() != null ? sft.getGeometryDescriptor()
/** * Initializes the builder with state from a pre-existing feature type. */ public void init(SimpleFeatureType type) { init(); if (type == null) return; uri = type.getName().getNamespaceURI(); local = type.getName().getLocalPart(); description = type.getDescription(); restrictions = null; restrictions().addAll(type.getRestrictions()); this.defaultCrs = type.getCoordinateReferenceSystem(); this.defaultCrsSet = true; attributes = null; attributes().addAll(type.getAttributeDescriptors()); isAbstract = type.isAbstract(); superType = (SimpleFeatureType) type.getSuper(); }
dataStore.getNamespace() == null ? null : dataStore.getNamespace().toString(), info.getFeatureName()), attrDescrs, geomDescr, false, null, null, baseType .getDescription());
sft.getAttributeDescriptors(), sft.getGeometryDescriptor(), sft.isAbstract(), sft.getRestrictions(), sft.getSuper(), sft.getDescription()); } else { throw new InvalidParameterException(
sft.getAttributeDescriptors(), sft.getGeometryDescriptor(), sft.isAbstract(), sft.getRestrictions(), sft.getSuper(), sft.getDescription()); } else { throw new InvalidParameterException(
sft.getAttributeDescriptors(), sft.getGeometryDescriptor(), sft.isAbstract(), sft.getRestrictions(), sft.getSuper(), sft.getDescription()); } else { throw new InvalidParameterException(
public SimpleFeatureType convertFeatureType(SimpleFeatureType oldFeatureType) { SimpleFeatureTypeBuilder ftb = new SimpleFeatureTypeBuilder(); ftb.add("Geometry", Geometry.class); ftb.setDefaultGeometry("Geometry"); List<AttributeDescriptor> attributeDescriptors = oldFeatureType.getAttributeDescriptors(); for (AttributeDescriptor attributeDescriptor : attributeDescriptors) { String localName = attributeDescriptor.getLocalName(); if (!"Geometry".equals(localName)) { ftb.add(attributeDescriptor); } } ftb.setName(oldFeatureType.getName()); ftb.setDescription(oldFeatureType.getDescription()); ftb.setCRS(KMLFileFormat.KML_CRS); ftb.setSRS(KMLFileFormat.KML_SRS); // remove style attribute for now if (oldFeatureType.getDescriptor("Style") != null) { ftb.remove("Style"); } ftb.add("Folder", String.class); SimpleFeatureType ft = ftb.buildFeatureType(); return ft; }
public SimpleFeatureType convertFeatureType(SimpleFeatureType oldFeatureType) { SimpleFeatureTypeBuilder ftb = new SimpleFeatureTypeBuilder(); ftb.add("Geometry", Geometry.class); ftb.setDefaultGeometry("Geometry"); List<AttributeDescriptor> attributeDescriptors = oldFeatureType.getAttributeDescriptors(); for (AttributeDescriptor attributeDescriptor : attributeDescriptors) { String localName = attributeDescriptor.getLocalName(); if (!"Geometry".equals(localName)) { ftb.add(attributeDescriptor); } } ftb.setName(oldFeatureType.getName()); ftb.setDescription(oldFeatureType.getDescription()); ftb.setCRS(KMLFileFormat.KML_CRS); ftb.setSRS(KMLFileFormat.KML_SRS); // remove style attribute for now if (oldFeatureType.getDescriptor("Style") != null) { ftb.remove("Style"); } ftb.add("Folder", String.class); SimpleFeatureType ft = ftb.buildFeatureType(); return ft; }
typeOutBuilder.setDescription(typeIn.getDescription()); typeOutBuilder.setName(typeIn.getName()); for (AttributeDescriptor att : typeIn.getAttributeDescriptors()) {
@Override protected SimpleFeatureType buildTargetFeatureType() { // create schema SimpleFeatureTypeBuilder tb = new SimpleFeatureTypeBuilder(); for (AttributeDescriptor descriptor : delegate.getSchema().getAttributeDescriptors()) { if (!(descriptor.getType() instanceof GeometryTypeImpl) || (!delegate.getSchema().getGeometryDescriptor().equals(descriptor))) { tb.add(descriptor); } else { AttributeTypeBuilder builder = new AttributeTypeBuilder(); builder.setBinding(MultiPolygon.class); AttributeDescriptor attributeDescriptor = builder.buildDescriptor(descriptor .getLocalName(), builder.buildType()); tb.add(attributeDescriptor); if(tb.getDefaultGeometry() == null) { tb.setDefaultGeometry(descriptor.getLocalName()); } } } tb.setDescription(delegate.getSchema().getDescription()); tb.setCRS(delegate.getSchema().getCoordinateReferenceSystem()); tb.setName(delegate.getSchema().getName()); return tb.buildFeatureType(); }
tb.setDescription(firstFeatureCollectionSchema.getDescription()); tb.setCRS(firstFeatureCollectionSchema.getCoordinateReferenceSystem()); tb.setAbstract(firstFeatureCollectionSchema.isAbstract());