简体   繁体   English

在C#应用程序中从地图生成地理坐标

[英]Generating geographic coordinates from a map in a C# application

I'm currently working on a C# application. 我目前正在使用C#应用程序。 What I would like to do is display a map of the UK, just a JPEG image (if possible), which also, when clicked, generates geographic coordinates of the point clicked. 我想做的是显示英国的地图,仅显示一张JPEG图像(如果可能的话),当单击该图像时,它还会生成单击点的地理坐标。

Ideally what I would like to move onto is displaying a marker at two points clicked with a line drawn between them but the above is my primary goal. 理想情况下,我要移动的是在两个点处单击并在它们之间画一条线的地方显示一个标记,但这是我的主要目标。

My issue is that I'm actually not too sure how I would go about doing this; 我的问题是我实际上不太确定如何去做。 I have done a fair bit of research into it and have since used XAML to display the JPEG, but very much unsure of what route I should now go down. 我对此进行了相当多的研究,此后使用XAML来显示JPEG,但是非常不确定我现在应该走哪条路。

I would greatly appreciate any advice you might be able to give. 我非常感谢您可能提供的任何建议。

Thanks, 谢谢,

M 中号

Besides the scale etc. you will also need to know what Geographic coordinate system the images was created in so that you can correctly interpolate the location from the mouse position on the image and known reference points on the image. 除了比例尺等之外,您还需要知道创建图像的地理坐标系 ,以便可以从图像上的鼠标位置和图像上的已知参考点正确地插入位置。

The coordinate system flattens out the map to a 2D image, but this causes distortions which need to be taken into account. 坐标系将地图展平为2D图像,但这会导致变形,需要将其考虑在内。 This might be an interesting read for you: A guide to coordinate systems in Great Britain 这可能对您来说很有趣: 《英国坐标系统指南》

The UK is quite simple because pretty much every map uses the National Grid (defined by the Ordnance Survey). 英国非常简单,因为几乎每张地图都使用国家网格(由军械测量局定义)。 This is rectangular so you don't have to worry about curvature. 这是矩形的,因此您不必担心曲率。 If you know the national grid and pixel locations of two points on the map you can derive anywhere else using linear interpolation. 如果您知道地图上两个点的国家网格和像素位置,则可以使用线性插值法在任何其他位置导出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM