d3中的Lambert圆锥保角投影 [英] Lambert conic conformal projection in d3

查看:555
本文介绍了d3中的Lambert圆锥保角投影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的祖国奥地利的SVG地图上投射一组点([long,lat]元组):





现在,从阅读D3文档,我可以猜测,我必须为投影指定更多的参数,例如两个标准平行线。不幸的是,我不知道他们是什么,并尝试围绕西部和东部边界的地图的各种价值观没有工作。我假设他们可以从我对地图知道的,虽然,或者可能不是?



其次,让我困惑的是,投影不是错误地旋转,但不正确我认为使用 .fitSize 会照顾到这一点。



任何人都可以给我任何指针

$ p

解决方案

Fitsize会正确地翻译和缩放地图,但是使用圆锥投影

有一份记录在案的奥地利Lambert Conic Conformal地图投影,其规格可以在



svg图片可能使用不同的参数略微从张贴的参数(舍入,打字错误)或者并行是自定义选择;但是,这应该是相当紧凑的。


I'm trying to project a set of points ([long, lat] tuples) on top of an SVG map of my home country Austria:

https://commons.wikimedia.org/wiki/File:Austria-geographic_map-blank.svg

The description of the SVG file on Wikimedia gives a projection name and the bounds of the map:

Lambert Conformal Conic, WGS84 datum
Geographic limits of the map:

West: 17.2° W
East: 9.3° W
North: 49.2° N
South: 46.0° N

Naive as I am, I thought this information would be enough to create the right kind of projection with D3.

This is what I tried first:

    let gcc = d3.geoConicConformal()
        .fitSize([width, height], bbox)

Where bbox is a GeoJSON polygon representing the boundaries of the map as given above.

Unfortunately the result is not the correct projection:

Now, from reading the D3 docs I can guess that I have to specify more parameters for the projection, e.g. two standard parallels. Unfortunately I have no idea what they are, and trying various values around the western and eastern boundaries of the map didn't work. I assume they can be derived from what I know about the map though, or maybe not?

Secondly, what confuses me is that the projection is not just wrongly rotated but incorrectly scaled as well -- I thought using .fitSize would take care of that.

Can anybody give me any pointers on correctly setting up a Lambert conic conformal projection?

解决方案

Fitsize will translate and scale the map properly, however, with a conic projection you need to rotate, and as you noted, set the parallels.

Parallels:

There is a documented Austria Lambert Conic Conformal map projection, its specifications can be found here or here. The parallels that likely are correct are in this case are [46,49], though the map you are using could be a custom projection.

Rotation

Now you need to rotate the map, along the x axis by longitude. Conic maps are generally rotated along the x axis and centered on the y axis (see my answer here here for a graphical explanation of why (and how parallels change your projection)).

Rotation moves the world so that your area of interest is aligned properly, such that the central meridian of the map is vertical in your map. Based on the projection specifications noted above, the central meridian should be at 13 degrees, 20 minutes (13.333 degrees), though there is a small disagreement between the two references. Rotation along the x axis is set at the negative of this value.

Using these parameters:

d3.geoConicConformal()
    .parallels([46,49])
    .rotate([-13.333,0])
    .fitSize([width,height],bbox)

I managed a pretty good fit with my very downsampled goto world topojson:

It is possible that the svg image uses parameters that differ slightly from the posted parameters (rounding, typos) or that the parallels are custom selected; however, this should be a fairly tight fit.

这篇关于d3中的Lambert圆锥保角投影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆