Lambert conic conformal projection in d3

后端 未结 1 1479
甜味超标
甜味超标 2020-12-11 10:18

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-geograph

1条回答
  •  时光取名叫无心
    2020-12-11 11:00

    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.

    0 讨论(0)
提交回复
热议问题