NetTopologySuite / NetTopologySuite.IO.ShapeFile

The ShapeFile IO module for NTS.
33 stars 25 forks source link

String values are trimmed when read using DbaseFileReader #63

Closed kristofdegrave closed 1 month ago

kristofdegrave commented 3 years ago

When we write a string value that starts or ends with a space in a dbase file, these spaces are removed when reading the value.

https://github.com/NetTopologySuite/NetTopologySuite.IO.ShapeFile/blob/3c952d5df92d1b5cc3c78b7f9d4815f129c2b719/src/NetTopologySuite.IO.ShapeFile/Dbase/DbaseFileReader.cs#L163

Are there any specific reasons why this is done? I would expect to get the result back, the way I wrote it in the file.

KubaSzostak commented 1 month ago

According to the dBASE specification Character (C) field is "padded with blanks to the width of the field". Therefore all spaces have to be trimmed, as per specification.