Add a point on a map

本文讨论了在地图上正确显示基于度、分、秒表示的坐标点的问题。用户尝试添加坐标点到地图上,但发现点总是出现在地图底部且现有图层被缩小。文章探讨了坐标系统的转换以及如何正确地在不同坐标系统中显示点。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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?
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值