Add a point on a map

Topics: Algorithms
Apr 28, 2007 at 11:39 AM
Hi there. I've to add a point (based on degrees, minutes and seconds notation) on a map. I've done in this way, but the point is always drawn in the bottom of the map and the existing layer are made small.

VectorLayer layPunti = new VectorLayer("LayerPunti");
List<SharpMap.Geometries.Geometry> pti = new List<SharpMap.Geometries.Geometry>();

Point p = Point.FromDMS(40,38,10,17,58,58);
System.Drawing.PointF q = map.WorldToImage(p);


layPunti.DataSource = new GeometryProvider(pti);
layPunti.Style.Symbol = new Bitmap("bitmap");


I've also try to change the point coordinates, but there aren't any changes
Can someone help me?Thanks.
May 2, 2007 at 8:42 AM

I am also facing same problem

I am able to create a shape file with only one point in it.

my code:

SharpMap.Data.FeatureDataTable dt = new SharpMap.Data.FeatureDataTable();
SharpMap.Data.FeatureDataRow rw = dt.NewRow();
rw.Geometry = new SharpMap.Geometries.Point(100, 100);
SharpMap.Data.Providers.ShapeFile.Create(Server.MapPath(@"~\App_data"), "test", SharpMap.Data.Providers.ShapeType.Polygon, dt);
SharpMap.Data.Providers.ShapeFile shp = new SharpMap.Data.Providers.ShapeFile(Server.MapPath(@"~\App_data\test.shp"));

is there there any thing wrong with this ?

if i have shape file, is it possible to edit it.

Thanks & Regards,
May 2, 2007 at 3:52 PM
Hi codewithhart,
my problem is this: I've got a map with only a layer. The user insert a point coordinates and my web application have to show this point on the map. My application shows the point on the map, but I've the point in the bottom and the existing layer that are made very very small and take place in high.

I know that my first problem is that my only layer takes its informations from a shapefile with Gauss-Boaga coordinate system, while the point is in WGS84 notation. Thus I think that I've to do something like this:

and then I think that I can show correctly both layers. But stilll now I don't know I can do all of this.
May 2, 2007 at 3:55 PM
If you are able to find a solution, please help me.
Jun 20, 2007 at 12:10 AM
What are the parameters of the Gauss-Boaga projection? Do you have a WKT representation or a .prj file?