This project has moved and is read-only. For the latest updates, please go here.

MsSQLSpatial provided will not compile with IProvider interface.

Feb 29, 2008 at 3:59 PM
Edited Feb 29, 2008 at 4:00 PM
I am building a Sharpmap Web app that needs to access data from a MS SQL Server database that has been spatially enabled with the MSSQLSpatial extension. The production DLL (version 0.9) of SharpMap did not provide a MsSqlSpatial class. Therefore I down loaded the source code for the SharpMap project and the MsSqlSpatial class and added the class to the project and tried to compile. Error message reports that the "GetGeometriesInView(SharpMap.Geometries.BoundingBox bbox)" method of the MsSqlSpatial class did not have the same reurn type as the interface it is implementing "IProvider". Ditto the "GetObjectIDsInView(SharpMap.Geometries.BoundingBox bbox)" method. Sure enough the IProvider interface has a return type of "System.Collections.Generic.List<uint>" while the MsSqlSpatial class has a return type of "Collection<Geometries.Geometry>". OK then, I get a later version of the IProvider interface. I downloaded that from the same version where I got the IProvider interface. Now I get an error reporting error for the same methods in the GeometryProvider class, the ShapeFile class, the OleDbPoint class, and the MsSql class. (Naturally since they all implement the same interface.) So I replace all of those classes. Now I am getting the error cannot implicitly convert type System.Collections.ObjectModel.Collection,SharpMap.Geometries.Geometry> to System.Collections.Generic.List<SharpMap.Geometries.Geometry> in the VectorLayer class, and cannot implicitly convert type System.Collections.Generic.List<uint> to System.Collections.ObjectModel.Collection<uint> two places in the ShapeFile class. I keep getting errors I keep doing this until I have inserted every file in the Change set 30878 into the project and replacing all of the files for which there is a copy. Now I get 16 errors for GeometryTransform class which is reporting invalid parameters for the fundtions SharpMap.CoordinateSystems.Transformations.IMathTransform.Transform(SharpMap.Geometries.Point) and cannot convert double[] to SharpMap.Geometries.Point. At this point I am stumped and have no idea on how to proceed. Could someone please point me in the right direction? Thanks in advance.

Feb 29, 2008 at 8:01 PM
Got help from my boss with more experience in Open Source in general and Sharpmap in particular. Found out SharpMap is not compiled from a single standalone project but is created from an number of collaborating project in a single solution, all of which necessary for a complete compile. Thus the latest code release contains an ".sln" file in the "trunk" directory which needs to be built. Compiling a the demo website will show the list of dll's that need to be included in any ASP.Net website for it to properly work. Now I can start to build some maps.