/** Adds an element to the current record with scheme */ public void addElementWithScheme(String name, String scheme, String value) { super.addElement(name + ".value", value); super.addElement(name + ".scheme", scheme); } }
@Test public void testBuildMDRecord() throws MismatchedDimensionException, Exception { GenericRecordBuilder rb = new GenericRecordBuilder(MetaDataDescriptor.getInstance()); rb.addElement("fileIdentifier.CharacterString", "00180e67-b7cf-40a3-861d-b3a09337b195"); rb.addElement("identificationInfo.AbstractMD_Identification.citation.CI_Citation.title.CharacterString", "Image2000 Product 1 (at1) Multispectral"); rb.addElement("dateStamp.Date", "2004-10-04 00:00:00"); rb.addElement("identificationInfo.AbstractMD_Identification.abstract.CharacterString", "IMAGE2000 product 1 individual orthorectified scenes. IMAGE2000 was produced from ETM+ Landsat 7 satellite data and provides a consistent European coverage of individual orthorectified scenes in national map projection systems."); rb.addElement("hierarchyLevel.MD_ScopeCode.@codeListValue", "dataset"); rb.addElement("identificationInfo.AbstractMD_Identification.descriptiveKeywords.MD_Keywords.keyword.CharacterString", "imagery", "baseMaps", "earthCover"); rb.addElement("contact.CI_ResponsibleParty.individualName.CharacterString", "Niels Charlier"); rb.addBoundingBox(new ReferencedEnvelope(14.05, 17.24, 46.46, 28.42, DefaultGeographicCRS.WGS84)); Feature f = rb.build(null); assertRecordElement(f, "gmd:fileIdentifier/gco:CharacterString", "00180e67-b7cf-40a3-861d-b3a09337b195"); assertRecordElement(f, "gmd:identificationInfo/gmd:AbstractMD_Identification/gmd:citation/gmd:CI_Citation/gmd:title/gco:CharacterString", "Image2000 Product 1 (at1) Multispectral"); assertRecordElement(f, "gmd:dateStamp/gco:Date", "2004-10-04 00:00:00"); assertRecordElement(f, "gmd:identificationInfo/gmd:AbstractMD_Identification/gmd:abstract/gco:CharacterString", "IMAGE2000 product 1 individual orthorectified scenes. IMAGE2000 was produced from ETM+ Landsat 7 satellite data and provides a consistent European coverage of individual orthorectified scenes in national map projection systems."); assertRecordElement(f, "gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue", "dataset"); assertRecordElement(f, "gmd:identificationInfo/gmd:AbstractMD_Identification/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:keyword/gco:CharacterString", "imagery", "baseMaps", "earthCover"); assertBBox(f, new ReferencedEnvelope(14.05, 17.24, 46.46, 28.42, DefaultGeographicCRS.WGS84)); }
public CatalogStoreFeatureIterator(int offset, int count, SortBy[] sortOrder, Filter filter, Catalog catalog, CatalogStoreMapping mapping, RecordDescriptor recordDescriptor, Map<String, String> interpolationProperties) { this.offset = offset; this.count = count; this.sortOrder = sortOrder; this.filter = filter; catalogFacade = catalog.getFacade(); this.mapping = mapping; this.interpolationProperties = interpolationProperties; layerIt = catalogFacade.list(ResourceInfo.class, filter, null, null, sortOrder); nextLayer(); layerGroupIt = catalogFacade.list(LayerGroupInfo.class, filter, null, null, sortOrder); nextLayerGroup(); comparator = sortOrder==null || sortOrder.length==0 ? null : CatalogComparatorFactory.buildComparator(sortOrder); index = 0; while (index < offset && hasNext()) { nextInternal(); } builder = new GenericRecordBuilder(recordDescriptor); }
(Object) ORIGINAL_BBOXES, (Object) new ArrayList<ReferencedEnvelope>(boxes)); addElement( recordDescriptor.getBoundingBoxPropertyName(), Collections.singletonList((Object) geom), Attribute att = buildNode(node); fb.append(substitutionMap.get(att.getName()), att);
/** * Adds an element to the current record with user data * * @param name path of property with dots * @param value the value(s) to be inserted * @param userData the user data */ public void addElement( String name, List<Object> value, Map<Object, Object> userData, int splitIndex) { createAttribute( root, 0, recordDescriptor.getFeatureType(), name.split("\\."), value, userData, splitIndex); }
list.add(buildNode(child));
builder = new GenericRecordBuilder(recordDescriptor);
createAttribute( (TreeBranch) treenodes.get(i), index + 1, createAttribute( (TreeBranch) treenodes.get(i), index + 1,
/** Adds an element to the current record */ public void addElement(String name, String... values) { super.addElement(name + ".value", values); }
/** * Adds an element to the current record * * @param name path of property with dots * @param values the value(s) to be inserted */ public void addElement(String name, String... values) { addElement(name, Arrays.asList((Object[]) values), null, -1); }
/** * Adds an element to the current record * * @param name path of property with dots * @param values the value(s) to be inserted */ public void addElement(String name, int splitIndex, String... values) { addElement(name, Arrays.asList((Object[]) values), null, splitIndex); }