Problems loading shapefiles

Topics: Data Access
May 9, 2007 at 12:58 PM
Hi,

Im trying to use shapefiles generated from ESRI ( http://www.esri.com/data/download/basemap/howtodownload.html )

But each time I add these to a layer I get an "DuplicateNameException" from GetMap() method in SharpMap.Map.

Exception: "A column named 'AREA' already belongs to this DataTable."

Is this a bug or should it be processed in someway?



May 10, 2007 at 2:28 AM
This is a known "bug" in some software that generates duplicate columns in the DBF with the same name. DataTables does not allow for dublicate names in the columns (this would be a mess anyway). SharpMap uses DataTables for attribute data, so you have to fix your DBF file to make this work. Try looking at the header of the DBF in a hex-editor. With a little luck you might be able to rename one of the columns directly there (but be sure to have a backup).