Destination array is not long enough to copy all the items in the collection. Check array index and length. · Issue #226 · SharpMap/SharpMap · GitHub
Skip to content

Destination array is not long enough to copy all the items in the collection. Check array index and length. #226

Description

@liugt34

In SharpMap.Data.Providers.DBaseReader.cs at line 961

//case "System.Boolean":
case TypeCode.Boolean:
var tempChar = BitConverter.ToChar(tmpBuffer, 0);
return ((tempChar == 'T') || (tempChar == 't') || (tempChar == 'Y') || (tempChar == 'y'));

when i export a shapefile from PostGIS, the DbaseField.Lenght == 1, but the BitConverter.ToChar must have 2 bits,
so i fix it by this way

if(dbf.DataTypeCode == TypeCode.Boolean && dbf.Length == 1) { tmpBuffer = new byte[2]; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions