This project has moved. For the latest updates, please go here.

2.0 Compile Error

Topics: SharpMap Project, SharpMap v2.0, WinForms Controls
Sep 4, 2008 at 12:09 PM

Is "2.0 2008 June 21 Drop" Release version working in all manner? I downloaded it and compiled but got an error: 'SharpMap.Presentation.WinForms.MapViewControl' does not implement interface member 'SharpMap.Presentation.Views.IMapView2D.IdentifyLocation(GeoAPI.Coordinates.ICoordinate)'.

Even though all the 10 methods inside IMapView2D were implemented in MapViewControl, it gives this error on all 10 methods.

Can someone help!

Sep 4, 2008 at 1:07 PM
Hmm actually the error was:

System.InvalidOperationException was unhandled
  Message="Vertex components can't be NaN."
at NetTopologySuite.Coordinates.BufferedCoordinate2DFactory.getVertexInternal(Double x, Double y, Double w) in \NTS\ManagedBufferedCoordinate2D\BufferedCoordinate2DFactory.cs:line 621

The code compiled but gave the above error while loading. I just wanted to see the output, so, I commented few lines in this function and was able to run the application.

But when I load a shapefile, I got: A projection is defined for this shapefile, but no CoordinateSystemFactory was set.
Sep 4, 2008 at 2:11 PM

Hi Brian,

in reverse order: there is an outstanding issue with reprojection at the moment, remove the .prj file and that should get you a bit further.

I think the other issue is due to the MapViewControl.Map property being set before the first layer as been added to the map, this then causes issues trying to calculate the extents. To work around just add the first layer to the map before assigning the map to the view. hth jd 

Sep 4, 2008 at 4:44 PM
Thanks for your reply John. I tried to open a shape file without prj file but it says: Cannot add the empty coordinate to a sequence.$0$0$0$0I am sure there could be some problems during the development, but for testing, do you have a working version anywhere? $0$0$0$0$0Also I am just curious to ask whether Sharpmap can open dgn files and read its projection information.$0$0$0$0$0Brian$0
Sep 4, 2008 at 5:09 PM
You could try the top demo app from you will need to change VectorStyle to GeometryStyle but it does contain some built dlls which you can play around with, but it is pretty old now - you may do better with the svn stuff - (but it is a bit of a pain to get the environment set up correctly)

wrt dgn files I havent ever used them but OGR will open them so you may be able to use it with 0.9 - probably not 2.0 for now.. hth jd