现在的位置: 首页 > 综合 > 正文

Add a point on a map

2013年04月07日 ⁄ 综合 ⁄ 共 2125字 ⁄ 字号 评论关闭
Add a point on a map 
Tags: Geospatial Computation


Apr 28 2007 at 7:39 PM

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);

pti.Add(p);

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

map.Layers.Add(layPunti);
map.ZoomToExtents();

I've also try to change the point coordinates, but there aren't any changes
Can someone help me?Thanks.


May 2 2007 at 4:42 PM

Hi.

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);
dt.AddRow(rw);
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"));
shp.Open(true);
shp.Save(dt);
shp.Close();

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 11: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:

http://www.sharpgis.net/2006/07/07/ApplyingOntheflyTransformationInSharpMap.aspx

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 11:55 PM

If you are able to find a solution, please help me.


Coordinator
Jun 20 2007 at 8:10 AM

What are the parameters of the Gauss-Boaga projection? Do you have a WKT representation or a .prj file?

 

抱歉!评论已关闭.