@Test public void TestCatFeatureObject() { RevFeature feature = RevFeatureBuilder.build(points1); CharSequence desc = geogig.command(CatObject.class).setObject(Suppliers.ofInstance(feature)) .call(); String[] lines = desc.toString().split("\n"); assertEquals(points1.getProperties().size() + 2, lines.length); assertEquals(FieldType.STRING.name() + "\tStringProp1_1", lines[2]); assertEquals(FieldType.INTEGER.name() + "\t1000", lines[3]); assertEquals(FieldType.POINT.name() + "\tPOINT (1 1)", lines[4]); }
@Test public void TestCatFeatureObject() { RevFeature feature = RevFeature.builder().build(points1); CharSequence desc = geogig.command(CatObject.class).setObject(Suppliers.ofInstance(feature)) .call(); String[] lines = desc.toString().split("\n"); assertEquals(points1.getProperties().size() + 2, lines.length); assertEquals(FieldType.STRING.name() + "\tStringProp1_1", lines[2]); assertEquals(FieldType.INTEGER.name() + "\t1000", lines[3]); assertEquals(FieldType.POINT.name() + "\tPOINT (1 1)", lines[4]); }
private void printAttributeDescriptor(Writer w, PropertyDescriptor attrib) throws IOException { print(w, attrib.getName().toString()); print(w, "\t"); print(w, FieldType.forBinding(attrib.getType().getBinding()).name()); print(w, "\t"); print(w, Integer.toString(attrib.getMinOccurs())); print(w, "\t"); print(w, Integer.toString(attrib.getMaxOccurs())); print(w, "\t"); print(w, Boolean.toString(attrib.isNillable())); PropertyType attrType = attrib.getType(); if (attrType instanceof GeometryType) { GeometryType gt = (GeometryType) attrType; CoordinateReferenceSystem crs = gt.getCoordinateReferenceSystem(); String crsText = CrsTextSerializer.serialize(crs); print(w, "\t"); println(w, crsText); } else { println(w, ""); } }
private void printAttributeDescriptor(Writer w, PropertyDescriptor attrib) throws IOException { print(w, attrib.getName().toString()); print(w, "\t"); print(w, FieldType.forBinding(attrib.getType().getBinding()).name()); print(w, "\t"); print(w, Integer.toString(attrib.getMinOccurs())); print(w, "\t"); print(w, Integer.toString(attrib.getMaxOccurs())); print(w, "\t"); print(w, Boolean.toString(attrib.isNillable())); PropertyType attrType = attrib.getType(); if (attrType instanceof GeometryType) { GeometryType gt = (GeometryType) attrType; CoordinateReferenceSystem crs = gt.getCoordinateReferenceSystem(); String crsText = CrsTextSerializer.serialize(crs); print(w, "\t"); println(w, crsText); } else { println(w, ""); } }
ansi.a(attrib.getName()).newline(); PropertyType attrType = attrib.getType(); String typeName = FieldType.forBinding(attrType.getBinding()).name(); if (attrType instanceof GeometryType) { GeometryType gt = (GeometryType) attrType;
ansi.a(attrib.getName()).newline(); PropertyType attrType = attrib.getType(); String typeName = FieldType.forBinding(attrType.getBinding()).name(); if (attrType instanceof GeometryType) { GeometryType gt = (GeometryType) attrType;
ansi.a(attrib.getName()).newline(); PropertyType attrType = attrib.getType(); String typeName = FieldType.forBinding(attrType.getBinding()).name(); if (attrType instanceof GeometryType) { GeometryType gt = (GeometryType) attrType;
public void writeFeatureType(RevFeatureType featureType, String tag) throws StreamWriterException { out.writeStartElement(tag); writeElement("id", featureType.getId().toString()); writeElement("name", featureType.getName().toString()); ImmutableList<PropertyDescriptor> descriptors = featureType.descriptors(); out.writeStartArray("attribute"); for (PropertyDescriptor descriptor : descriptors) { out.writeStartArrayElement("attribute"); writeElement("name", descriptor.getName().toString()); writeElement("type", FieldType.forBinding(descriptor.getType().getBinding()).name()); writeElement("minoccurs", Integer.toString(descriptor.getMinOccurs())); writeElement("maxoccurs", Integer.toString(descriptor.getMaxOccurs())); writeElement("nillable", Boolean.toString(descriptor.isNillable())); PropertyType attrType = descriptor.getType(); if (attrType instanceof GeometryType) { GeometryType gt = (GeometryType) attrType; CoordinateReferenceSystem crs = gt.getCoordinateReferenceSystem(); String crsText = CrsTextSerializer.serialize(crs); writeElement("crs", crsText); } out.writeEndArrayElement(); } out.writeEndArray(); out.writeEndElement(); }