PageSourceSearch

https://h3geo.org/assets/js/34251a6c.1e52fe5b.js

js h3geo.org collected 2026-10-01 09:13:48 UTC 5,104 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkh3_website||=[]).push([[2070],{9670(e,t,n){n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>s,default:()=>h,frontMatter:()=>c,metadata:()=>o,toc:()=>l});const o=JSON.parse('{"id":"core-library/cellToLatLngDesc","title":"Determine the latitude/longitude coordinates of the center point of an H3Index cell","description":"This operation is performed by function cellToLatLng. See the comments in the function source code for more detail.","source":"@site/docs/core-library/cellToLatLngDesc.md","sourceDirName":"core-library","slug":"/core-library/cellToLatLngDesc","permalink":"/docs/core-library/cellToLatLngDesc","draft":false,"unlisted":false,"editUrl":"https://github.com/uber/h3/edit/master/website/docs/core-library/cellToLatLngDesc.md","tags":[],"version":"current","frontMatter":{"id":"cellToLatLngDesc","title":"Determine the latitude/longitude coordinates of the center point of an H3Index cell","sidebar_label":"Determine the latitude/longitude coordinates of the center point of an H3Index cell","slug":"/core-library/cellToLatLngDesc"},"sidebar":"someSidebar","previous":{"title":"Conversion from latitude/longitude to containing H3 cell index","permalink":"/docs/core-library/latLngToCellDesc"},"next":{"title":"Generate the cell boundary in latitude/longitude coordinates of an H3Index cell","permalink":"/docs/core-library/cellToBoundaryDesc"}}');var i=n(4848),r=n(8453);const c={id:"cellToLatLngDesc",title:"Determine the latitude/longitude coordinates of the center point of an H3Index cell",sidebar_label:"Determine the latitude/longitude coordinates of the center point of an H3Index cell",slug:"/core-library/cellToLatLngDesc"},s=void 0,a={},l=[];function d(e){const t={a:"a",code:"code",em:"em",li:"li",ol:"ol",p:"p",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["This operation is performed by function ",(0,i.jsx)(t.code,{children:"cellToLatLng"}),". See the comments in the function source code for more detail."]}),"\n",(0,i.jsxs)(t.p,{children:["The conversion is performed as a series of coordinate system conversions described below. See the page ",(0,i.jsx)(t.a,{href:"/docs/core-library/coordsystems",children:"Coordinate Systems used by the H3 Core Library"})," for more information on each of these coordinate systems."]}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["The function ",(0,i.jsx)(t.code,{children:"_h3ToFaceIjk"})," then converts the H3 index to the appropriate icosahedron face number and normalized ",(0,i.jsx)(t.em,{children:"ijk"})," coordinate's on that face's coordinate system as follows:"]}),"\n"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"We start by assuming that the cell center point falls on the same icosahedron face as its base cell."}),"\n",(0,i.jsxs)(t.li,{children:["It is possible that the cell center point lies on an adjacent face (termed an ",(0,i.jsx)(t.em,{children:"overage"})," in the code), in which case we would need to use a projection centered on that adjacent face instead. We recall that normalized ",(0,i.jsx)(t.em,{children:"ijk"})," coordinates have at most two non-zero components, and that in a face-centered Class II system the sum of those components is a resolution-specific constant value for cells that lie on the edge of that icosahedral face.\nWe determine whether an overage exists by taking the sum of the ",(0,i.jsx)(t.em,{children:"ijk"})," components, and if there is an overage the positive ",(0,i.jsx)(t.em,{children:"ijk"})," components indicate which adjacent face the cell center lies on. A lookup operation is then performed to find the appropriate rotation and translation to transform the ",(0,i.jsx)(t.em,{children:"ijk"})," coordinates into the adjacent face-centered ",(0,i.jsx)(t.em,{children:"ijk"})," system."]}),"\n"]}),"\n",(0,i.jsx)("div",{align:"center",children:(0,i.jsx)("img",{height:"300",src:"/images/triEdge.png"})}),"\n",(0,i.jsxs)(t.ol,{start:"2",children:["\n",(0,i.jsxs)(t.li,{children:["The face-centered ",(0,i.jsx)(t.em,{children:"ijk"})," coordinates are then converted into corresponding ",(0,i.jsx)(t.em,{children:"Hex2d"})," coordinates using the function ",(0,i.jsx)(t.code,{children:"_ijkToHex2d"}),"."]}),"\n",(0,i.jsxs)(t.li,{children:["The function ",(0,i.jsx)(t.code,{children:"_hex2dToGeo"})," takes the ",(0,i.jsx)(t.em,{children:"Hex2d"})," coordinates and scales them into face-centered gnomonic coordinates, and then performs an inverse gnomonic projection to get the latitude/longitude coordinates."]}),"\n"]})]})}function h(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453(e,t,n){n.d(t,{R:()=>c,x:()=>s});var o=n(6540);const i={},r=o.createContext(i);function c(e){const t=o.useContext(r);return o.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:c(e.components),o.createElement(r.Provider,{value:t},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.