I've recently begun undertaking some development in Kettle (actually GeoKettle, the geospatial enabled version of Kettle), version 3.2. I've been writing some geocoding components that will take an address and pass back latitude/longitude, using ESRI software. I wrote these for the benefit of my company and the community, and because it was fun.
Components I have written:
Eventually you will be able to download and use these, when I get around to writing up documentation on them and packaging them up.
Here are some things I have learned as I have gone about writing new components. I'll expand this section as I go.
TYPE_STRING | String |
TYPE_DATE | java.util.Date |
TYPE_NUMBER | Double |
TYPE_INTEGER | Long |
TYPE_BIGNUMBER | java.math.BigDecimal |
TYPE_BOOLEAN | Boolean |
TYPE_BINARY | byte[] |
TYPE_SERIALIZABLE | uses object.toString() |
private void addOutputField(RowMetaInterface r, String origin, String fieldName, int fieldType, int length, int precision, Object defaultValue, String conversionMask) { ValueMetaAndData newField; ValueMetaInterface v; newField = new ValueMetaAndData(new ValueMeta(fieldName, fieldType), defaultValue); newField.getValueMeta().setLength(length); newField.getValueMeta().setPrecision(precision); if (conversionMask != null) { newField.getValueMeta().setConversionMask(conversionMask); } v = newField.getValueMeta(); v.setOrigin(origin); r.addValueMeta(v); } public void getFields(RowMetaInterface r, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) { addOutputField(r, origin, "latitude", ValueMetaInterface.TYPE_NUMBER, 18, 15, new Double(0), "###.###############"); }