You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When measured in lat/lon degrees (or meters) the vertical and horizontal sizes of a hexagon are not the same because of the Mercator distortions. From the API documentation it is not clear what sizes size and innerRadius actually represent.
The API should clarify that and ideally provide means for obtaining sizes along the two axes. For example, the functions below give outer sizes for both axes (but don't account for wrapping at antimeridian and poles):
const zoneSize = (z, accessor) => {
let [ a, b ] = d3.extent(z.geometry, accessor)
return (b - a)
}
const zoneHeight = (z) => zoneSize(z, d => d.lat)
const zoneWidth = (z) => zoneSize(z, d => d.lon)
Also z.size seems to return half of the outer radius (zoneWidth) contrary to the documentation which states that it is the side length
let z = terahex.decode('130046352')
z.size * 2 // 2.469135802469136
z.geometry[0].lon - z.geometry[3].lon // 2.469135802469168
The text was updated successfully, but these errors were encountered:
When measured in lat/lon degrees (or meters) the vertical and horizontal sizes of a hexagon are not the same because of the Mercator distortions. From the API documentation it is not clear what sizes
size
andinnerRadius
actually represent.The API should clarify that and ideally provide means for obtaining sizes along the two axes. For example, the functions below give outer sizes for both axes (but don't account for wrapping at antimeridian and poles):
Also z.size seems to return half of the outer radius (zoneWidth) contrary to the documentation which states that it is the side length
The text was updated successfully, but these errors were encountered: