兰伯特 2008 年预测

发布于 2024-11-26 10:35:18 字数 1932 浏览 2 评论 0原文

我需要编写一个函数,可以将纬度/经度定义的某个位置投影到地图(图像)上的 x,y 坐标。

地图本身似乎使用“比利时兰伯特”作为投影类型。

我找到了有关此投影及其配置的一些官方信息: http://ign.be/FR /FR2-1-4.shtmhttp://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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

长不大的小祸害 2024-12-03 10:35:18

对于那些感兴趣的人,这就是我让它发挥作用的方法。

这是比利时地图(似乎使用 Lambert 72 或 2008)。

    Proj proj = new LambertConformal(centerLatLonPoint, scale, 1776, 1468,
            4.3592158333333333333333333333333, //centralMeridian
            49.833333333333333333333333333333, //lambert_sp_one
            51.166666666666666666666666666667, //lambert_sp_two
            50.797815, //referenceLatitude
            649328.0, //falseEasting
            665262.0, //falseNorthing
            Ellipsoid.GRS_1980);

比例尺可以这样计算:

    LatLonPoint dePanneLatLonPoint = new LatLonPoint(51.0975f, 2.5855f);
    Point dePannePoint = new Point(27, 313);

    LatLonPoint mussonLatLonPoint = new LatLonPoint(49.5567f, 5.7106f);
    Point mussonPoint = new Point(1464, 1426);

    float scale = proj.getScale(dePanneLatLonPoint, mussonLatLonPoint, dePannePoint, mussonPoint);

这两个点是任意点(尽可能西北和东南),您知道它们的地理坐标及其在地图上的投影位置。

我还必须找到地图中心的地理坐标。

然后可以通过以下方式找到地图上某个点的位置:

     Point point = proj.forward(latitude, longitude, new Point(), false);

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

    Proj proj = new LambertConformal(centerLatLonPoint, scale, 1776, 1468,
            4.3592158333333333333333333333333, //centralMeridian
            49.833333333333333333333333333333, //lambert_sp_one
            51.166666666666666666666666666667, //lambert_sp_two
            50.797815, //referenceLatitude
            649328.0, //falseEasting
            665262.0, //falseNorthing
            Ellipsoid.GRS_1980);

Scale can be calculating this way:

    LatLonPoint dePanneLatLonPoint = new LatLonPoint(51.0975f, 2.5855f);
    Point dePannePoint = new Point(27, 313);

    LatLonPoint mussonLatLonPoint = new LatLonPoint(49.5567f, 5.7106f);
    Point mussonPoint = new Point(1464, 1426);

    float scale = proj.getScale(dePanneLatLonPoint, mussonLatLonPoint, dePannePoint, mussonPoint);

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:

     Point point = proj.forward(latitude, longitude, new Point(), false);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文