We had a problem with null characters in the DBF data that came
with the US Census tiger databases we downloaded from ESRI.
Here is a fix in DbfInputStream.readFieldDescription()
-- cary
---------- com/bbn/openmap/dataAccess/shape/input/DbfInputStream.java
------------
/**
* Initializes arrays that hold column names, column types, character
* lengths, and decimal counts, then populates them
*/
private void readFieldDescripters() throws IOException {
_columnNames = new String[_columnCount];
_types = new byte[_columnCount];
_lengths = new int[_columnCount];
_decimalCounts = new byte[_columnCount];
for (int n=0; n<=_columnCount-1; n++) {
_columnNames[n] = _leis.readString(11);
//
// Some TIGER dbf files from ESRI have nulls
// in the column names. Delete them.
//
int ix = _columnNames[n].indexOf((char)0);
if(ix > 0) {
_columnNames[n] = _columnNames[n].substring(0,ix);
}
_types[n] = (byte)_leis.readByte();
_leis.skipBytes(4);
_lengths[n] = _leis.readUnsignedByte();
_decimalCounts[n] = _leis.readByte();
_leis.skipBytes(14);
}
}
--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Fri Aug 12 2005 - 09:35:59 EDT