SharpMap.Geometries.Geometry

Topics: General Topics
Jan 29, 2007 at 3:46 PM
Error 1 The best overloaded method match for 'SharpMap.Data.Providers.GeometryProvider.GeometryProvider(System.Collections.ObjectModel.Collection<SharpMap.Geometries.Geometry>)' has some invalid arguments D:\Documents and Settings\Ibra\Meus documentos\Visual Studio 2005\Projects\Mapa\Mapa\Form1.cs 151 44 Mapa




Help Me



Ibraim Mansur
BR
Coordinator
Jan 29, 2007 at 4:21 PM
Hi,

Do you have some more code and description for me.

regards
Christian
Jan 29, 2007 at 5:26 PM

System.Collections.Generic.List<SharpMap.Geometries.Geometry> Pontos = new System.Collections.Generic.List<SharpMap.Geometries.Geometry>();
.
.
.
private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
if (map != null)
{
SharpMap.Geometries.Point ClickPnt = new SharpMap.Geometries.Point();
ClickPnt = map.ImageToWorld(new System.Drawing.Point(e.X, e.Y));
Pontos.Add(ClickPnt);

VectorLayer m_VectorLayer = new VectorLayer("Ponto");
m_VectorLayer.DataSource = new SharpMap.Data.Providers.GeometryProvider(Pontos); -> "Error"
m_VectorLayer.Style.Symbol = new Bitmap("D:\\BOLA1.BMP");
map.Layers.Add(m_VectorLayer);
pictureBox1.Image = map.GetMap();
}

}
Error 2 The best overloaded method match for 'SharpMap.Data.Providers.GeometryProvider.GeometryProvider(System.Collections.ObjectModel.Collection<SharpMap.Geometries.Geometry>)' has some invalid arguments D:\Documents and Settings\Ibra\Meus documentos\Visual Studio 2005\Projects\Mapa\Mapa\Form1.cs 175 32 Mapa

Error 3 Argument '1': cannot convert from 'System.Collections.Generic.List<SharpMap.Geometries.Geometry>' to 'System.Collections.ObjectModel.Collection<SharpMap.Geometries.Geometry>' D:\Documents and Settings\Ibra\Meus documentos\Visual Studio
2005\Projects\Mapa\Mapa\Form1.cs 175 77 Mapa

This error happened after I changed DLL to open the data through MsSqlSpatial


Help Me


Ibraim Mansur
Br
Jan 29, 2007 at 11:12 PM
Ibraim,
I was getting the same sort of error as your error 3. It went away when I used the correct versions of the SharpMap.dll and SharpMap.UI.dll. The version numbering it was looking for was 0.9.2423.31552.
HTH
Best regards
Jan 30, 2007 at 4:15 PM
If I change DLL, it doesn't locate the referêcia for MsSqlSpatial.
Where finds Dll's that it corrects my mistake and have reference for MsSqlSpatial.


Thank you


Developer
Jan 30, 2007 at 5:52 PM
Download MsSqlSpatial data provider from this changeset:
http://www.codeplex.com/SharpMap/SourceControl/DownloadSourceCode.aspx?changeSetId=6695

Best regards,
Ricardo Stuven.
Developer
Jan 30, 2007 at 5:55 PM
...And it's not needed a reference to MsSqlSpatialLibrary.dll. It's uniquely to be used by msscmd.exe and to be deployed in the database, it should be not used in other contexts.

Best regards,
Ricardo Stuven.