Fixed the code page and SQL Collation issue

Topics: SharpMap Project, SharpMap v2.0
Jul 3, 2008 at 1:53 PM

Currently sharpMap read the shapefiles, actually read DBF file, by detecting the codepage in the DBF field.
If the codepage is 0 means it is Unicode. That is not always true. At least Navteq and TeleAltas are not following this rule.
What I did is to let user to specify the codepage when they initialize a shapefile object.
 
When I read the DBF file, if user specified the codepage, ignore the codepage in DBF field.
I also fixed the SQL server Collation issue. Currently when user try to transfer map data from shapefile to SQL Server.
SQL Server will generate the table by using system default Collation.
The problem is when your map data is in Chinese Character set, it will crashed when you insert them into a Latin Collation SQL Server.

I also added a Open2 () in DBF file which will igore the step of building a spatial index table. The use case is when you want to read the shapefile and its DBF file from head to toe. You don't care about spatial index. It is a time waste and for USA street map data, you will use up your computer memory.

Please let me know if I can contribute my code to the project.
HaiyanDu7@gMail.com
Currently map rending is too slow to show one region of USA. It is slower than MapWindow, http://www.mapwindow.org/download.php
we might need a better rending algorithm.

Haiyan Du