兰伯特 2008 年预测
我需要编写一个函数,可以将纬度/经度定义的某个位置投影到地图(图像)上的 x,y 坐标。
地图本身似乎使用“比利时兰伯特”作为投影类型。
我找到了有关此投影及其配置的一些官方信息: http://ign.be/FR /FR2-1-4.shtm 和 http://ign.be/Common/Lambert2008/Transformation_Geographic_Lambert_FR.pdf(法语,如果需要,我会翻译)。
基本上,我得出的结论是使用某些库会更容易(尽管这不是这里的要求)。经过一番研究,看来 OpenMap 应该能够完成这项工作。
所以,这是我到目前为止得到的:(
private Point mapCoordinatesToPoint(LatLonPoint latLonPoint) {
LatLonPoint centerLatLonPoint = new LatLonPoint(50.797815, 4.3592158333333333333333333333333);
Proj proj = new LambertConformal(centerLatLonPoint, 1, 1000, 1000, 4.3592158333333333333333333333333, 49.833333333333333333333333333333, 51.166666666666666666666666666667, 50.797815, 649328.0, 665262.0, Ellipsoid.GRS_1980);
return proj.forward(latLonPoint);
}
知道我的 gif 是 1000x1000)
LamberConformal 构造函数的 JavaDoc:http://openmap.bbn.com/doc/api/com/bbn/openmap/proj/LambertConformal.html#LambertConformal%28com.bbn.openmap.LatLo nPoint,%20float,%20int,%20int,%20double,%20double,%20double,%20double,%20double,%20double,%20com.bbn.openmap.proj.Ellipsoid%29
我想我没有正确配置它:应该在地图上的某个点,xxx,给出了这个结果:
x=-1766051.0; y=-1.6355546E7;
给出“中心点”(?)作为参数给出
x=500.0; y=500.0;
(地图的中间,看起来不错)
任何熟悉的人这个,或者能够从链接中找出配置?
编辑:
尝试用以下内容替换方法中的最后一行:
return proj.forward(latLonPoint.getLatitude(), latLonPoint.getLongitude(), new Point(), false);
但效果不佳。
I need to write a function that can project some location defined by latitude/longitue to x,y coordinates on a map (image).
The map itself seems to be using "belgian Lambert" as projection type.
I found some official information about this projection and its configuration : http://ign.be/FR/FR2-1-4.shtm and http://ign.be/Common/Lambert2008/Transformation_Geographic_Lambert_FR.pdf (in french, I'll translate if needed).
Basically, I came to the conclusion that it would be easier to use some library (although that's not a requirement here). After some research, it seems that OpenMap should be able to do the work.
So, here is what I got so far:
private Point mapCoordinatesToPoint(LatLonPoint latLonPoint) {
LatLonPoint centerLatLonPoint = new LatLonPoint(50.797815, 4.3592158333333333333333333333333);
Proj proj = new LambertConformal(centerLatLonPoint, 1, 1000, 1000, 4.3592158333333333333333333333333, 49.833333333333333333333333333333, 51.166666666666666666666666666667, 50.797815, 649328.0, 665262.0, Ellipsoid.GRS_1980);
return proj.forward(latLonPoint);
}
(knowing that my gif is 1000x1000)
JavaDoc for LamberConformal constructor: http://openmap.bbn.com/doc/api/com/bbn/openmap/proj/LambertConformal.html#LambertConformal%28com.bbn.openmap.LatLonPoint,%20float,%20int,%20int,%20double,%20double,%20double,%20double,%20double,%20double,%20com.bbn.openmap.proj.Ellipsoid%29
I guess I didn't configure it right: some point that should be on the map, xxx, gives this result:
x=-1766051.0; y=-1.6355546E7;
Giving the "center point" (?) as parameter gives
x=500.0; y=500.0;
(middle of the map, which looks ok)
Anyone familiar with this, or able to figure the configuration from the links?
EDIT:
tried replacing last line from method with this:
return proj.forward(latLonPoint.getLatitude(), latLonPoint.getLongitude(), new Point(), false);
but not better.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于那些感兴趣的人,这就是我让它发挥作用的方法。
这是比利时地图(似乎使用 Lambert 72 或 2008)。
比例尺可以这样计算:
这两个点是任意点(尽可能西北和东南),您知道它们的地理坐标及其在地图上的投影位置。
我还必须找到地图中心的地理坐标。
然后可以通过以下方式找到地图上某个点的位置:
For those interested, here is how I did let it work.
This is for a map of Belgium (seems to be using either Lambert 72 or 2008).
Scale can be calculating this way:
The two points being arbitrary points (as nw and se as possible) for which you know both the geographical coordinates and where this is projected on the map.
I also had to find the geographical coordinates of the center of the map.
The location of a point on the map can then be found this way: