From 1ab95543d8015e522b72155bbe0d558797cd454a Mon Sep 17 00:00:00 2001 From: isaacbrodsky Date: Mon, 4 Nov 2024 04:31:47 +0000 Subject: [PATCH] deploy: 2174f5154f6cfdb55ae6994869be581d176fd7d1 --- 404.html | 4 ++-- assets/js/{3095a365.39d9356d.js => 3095a365.1e75f8c7.js} | 2 +- ...{runtime~main.e1cb6546.js => runtime~main.b7e63586.js} | 2 +- docs/3.x/api/hierarchy/index.html | 4 ++-- docs/3.x/api/indexing/index.html | 4 ++-- docs/3.x/api/inspection/index.html | 4 ++-- docs/3.x/api/misc/index.html | 4 ++-- docs/3.x/api/regions/index.html | 4 ++-- docs/3.x/api/traversal/index.html | 4 ++-- docs/3.x/api/uniedge/index.html | 4 ++-- docs/3.x/community/applications/index.html | 4 ++-- docs/3.x/community/bindings/index.html | 4 ++-- docs/3.x/community/libraries/index.html | 4 ++-- docs/3.x/community/tutorials/index.html | 4 ++-- docs/3.x/comparisons/admin/index.html | 4 ++-- docs/3.x/comparisons/geohash/index.html | 4 ++-- docs/3.x/comparisons/hexbin/index.html | 4 ++-- docs/3.x/comparisons/placekey/index.html | 4 ++-- docs/3.x/comparisons/s2/index.html | 4 ++-- docs/3.x/core-library/coordsystems/index.html | 4 ++-- docs/3.x/core-library/creating-bindings/index.html | 4 ++-- docs/3.x/core-library/custom-alloc/index.html | 4 ++-- docs/3.x/core-library/filters/index.html | 4 ++-- docs/3.x/core-library/geoToH3desc/index.html | 4 ++-- docs/3.x/core-library/h3Indexing/index.html | 4 ++-- docs/3.x/core-library/h3ToGeoBoundaryDesc/index.html | 4 ++-- docs/3.x/core-library/h3ToGeoDesc/index.html | 4 ++-- docs/3.x/core-library/overview/index.html | 4 ++-- docs/3.x/core-library/restable/index.html | 4 ++-- docs/3.x/core-library/usage/index.html | 4 ++-- docs/3.x/faq/index.html | 4 ++-- docs/3.x/highlights/aggregation/index.html | 4 ++-- docs/3.x/highlights/flowmodel/index.html | 4 ++-- docs/3.x/highlights/indexing/index.html | 4 ++-- docs/3.x/highlights/joining/index.html | 4 ++-- docs/3.x/highlights/ml/index.html | 4 ++-- docs/3.x/index.html | 4 ++-- docs/3.x/installation/index.html | 4 ++-- docs/3.x/quickstart/index.html | 4 ++-- docs/api/hierarchy/index.html | 4 ++-- docs/api/indexing/index.html | 4 ++-- docs/api/inspection/index.html | 8 ++++---- docs/api/misc/index.html | 4 ++-- docs/api/regions/index.html | 4 ++-- docs/api/traversal/index.html | 4 ++-- docs/api/uniedge/index.html | 4 ++-- docs/api/vertex/index.html | 4 ++-- docs/community/applications/index.html | 4 ++-- docs/community/bindings/index.html | 4 ++-- docs/community/libraries/index.html | 4 ++-- docs/community/tutorials/index.html | 4 ++-- docs/comparisons/admin/index.html | 4 ++-- docs/comparisons/geohash/index.html | 4 ++-- docs/comparisons/hexbin/index.html | 4 ++-- docs/comparisons/placekey/index.html | 4 ++-- docs/comparisons/s2/index.html | 4 ++-- docs/core-library/cellToBoundaryDesc/index.html | 4 ++-- docs/core-library/cellToLatLngDesc/index.html | 4 ++-- docs/core-library/compilation-options/index.html | 4 ++-- docs/core-library/coordsystems/index.html | 4 ++-- docs/core-library/creating-bindings/index.html | 4 ++-- docs/core-library/custom-alloc/index.html | 4 ++-- docs/core-library/filters/index.html | 4 ++-- docs/core-library/h3Indexing/index.html | 4 ++-- docs/core-library/latLngToCellDesc/index.html | 4 ++-- docs/core-library/overview/index.html | 4 ++-- docs/core-library/restable/index.html | 4 ++-- docs/core-library/testing/index.html | 4 ++-- docs/core-library/usage/index.html | 4 ++-- docs/faq/index.html | 4 ++-- docs/highlights/aggregation/index.html | 4 ++-- docs/highlights/flowmodel/index.html | 4 ++-- docs/highlights/indexing/index.html | 4 ++-- docs/highlights/joining/index.html | 4 ++-- docs/highlights/ml/index.html | 4 ++-- docs/index.html | 4 ++-- docs/installation/index.html | 4 ++-- docs/library/errors/index.html | 4 ++-- docs/library/index/cell/index.html | 4 ++-- docs/library/index/directededge/index.html | 4 ++-- docs/library/index/vertex/index.html | 4 ++-- docs/library/migrating-3.x/index.html | 4 ++-- docs/library/migration-3.x/functions/index.html | 4 ++-- docs/library/terminology/index.html | 4 ++-- docs/quickstart/index.html | 4 ++-- index.html | 4 ++-- 86 files changed, 172 insertions(+), 172 deletions(-) rename assets/js/{3095a365.39d9356d.js => 3095a365.1e75f8c7.js} (57%) rename assets/js/{runtime~main.e1cb6546.js => runtime~main.b7e63586.js} (98%) diff --git a/404.html b/404.html index 7fd7030da..c1549634a 100644 --- a/404.html +++ b/404.html @@ -4,13 +4,13 @@ Page Not Found | H3 - +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- + \ No newline at end of file diff --git a/assets/js/3095a365.39d9356d.js b/assets/js/3095a365.1e75f8c7.js similarity index 57% rename from assets/js/3095a365.39d9356d.js rename to assets/js/3095a365.1e75f8c7.js index 22c3ed88c..df1ab62a4 100644 --- a/assets/js/3095a365.39d9356d.js +++ b/assets/js/3095a365.1e75f8c7.js @@ -1 +1 @@ -"use strict";(self.webpackChunkh3_website=self.webpackChunkh3_website||[]).push([[4423],{5680:(e,a,n)=>{n.d(a,{xA:()=>p,yg:()=>d});var l=n(6540);function t(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function r(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);a&&(l=l.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,l)}return n}function s(e){for(var a=1;a=0||(t[n]=e[n]);return t}(e,a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(l=0;l=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var i=l.createContext({}),u=function(e){var a=l.useContext(i),n=a;return e&&(n="function"==typeof e?e(a):s(s({},a),e)),n},p=function(e){var a=u(e.components);return l.createElement(i.Provider,{value:a},e.children)},c={inlineCode:"code",wrapper:function(e){var a=e.children;return l.createElement(l.Fragment,{},a)}},g=l.forwardRef((function(e,a){var n=e.components,t=e.mdxType,r=e.originalType,i=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),g=u(n),d=t,m=g["".concat(i,".").concat(d)]||g[d]||c[d]||r;return n?l.createElement(m,s(s({ref:a},p),{},{components:n})):l.createElement(m,s({ref:a},p))}));function d(e,a){var n=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var r=n.length,s=new Array(r);s[0]=g;var o={};for(var i in a)hasOwnProperty.call(a,i)&&(o[i]=a[i]);o.originalType=e,o.mdxType="string"==typeof e?e:t,s[1]=o;for(var u=2;u{n.d(a,{A:()=>s});var l=n(6540),t=n(53);const r="tabItem_Ymn6";function s(e){let{children:a,hidden:n,className:s}=e;return l.createElement("div",{role:"tabpanel",className:(0,t.A)(r,s),hidden:n},a)}},1470:(e,a,n)=>{n.d(a,{A:()=>I});var l=n(8168),t=n(6540),r=n(53),s=n(3104),o=n(2681),i=n(7485),u=n(1682),p=n(9466);function c(e){return function(e){var a,n;return null!=(a=null==(n=t.Children.map(e,(e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:a}=e;return!!a&&"object"==typeof a&&"value"in a}(e))return e;throw new Error("Docusaurus error: Bad child <"+("string"==typeof e.type?e.type:e.type.name)+'>: all children of the component should be , and every should have a unique "value" prop.')})))?void 0:n.filter(Boolean))?a:[]}(e).map((e=>{let{props:{value:a,label:n,attributes:l,default:t}}=e;return{value:a,label:n,attributes:l,default:t}}))}function g(e){const{values:a,children:n}=e;return(0,t.useMemo)((()=>{const e=null!=a?a:c(n);return function(e){const a=(0,u.X)(e,((e,a)=>e.value===a.value));if(a.length>0)throw new Error('Docusaurus error: Duplicate values "'+a.map((e=>e.value)).join(", ")+'" found in . Every value needs to be unique.')}(e),e}),[a,n])}function d(e){let{value:a,tabValues:n}=e;return n.some((e=>e.value===a))}function m(e){let{queryString:a=!1,groupId:n}=e;const l=(0,o.W6)(),r=function(e){let{queryString:a=!1,groupId:n}=e;if("string"==typeof a)return a;if(!1===a)return null;if(!0===a&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return null!=n?n:null}({queryString:a,groupId:n});return[(0,i.aZ)(r),(0,t.useCallback)((e=>{if(!r)return;const a=new URLSearchParams(l.location.search);a.set(r,e),l.replace({...l.location,search:a.toString()})}),[r,l])]}function y(e){const{defaultValue:a,queryString:n=!1,groupId:l}=e,r=g(e),[s,o]=(0,t.useState)((()=>function(e){var a;let{defaultValue:n,tabValues:l}=e;if(0===l.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!d({value:n,tabValues:l}))throw new Error('Docusaurus error: The has a defaultValue "'+n+'" but none of its children has the corresponding value. Available values are: '+l.map((e=>e.value)).join(", ")+". If you intend to show no default tab, use defaultValue={null} instead.");return n}const t=null!=(a=l.find((e=>e.default)))?a:l[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:a,tabValues:r}))),[i,u]=m({queryString:n,groupId:l}),[c,y]=function(e){let{groupId:a}=e;const n=function(e){return e?"docusaurus.tab."+e:null}(a),[l,r]=(0,p.Dv)(n);return[l,(0,t.useCallback)((e=>{n&&r.set(e)}),[n,r])]}({groupId:l}),h=(()=>{const e=null!=i?i:c;return d({value:e,tabValues:r})?e:null})();(0,t.useLayoutEffect)((()=>{h&&o(h)}),[h]);return{selectedValue:s,selectValue:(0,t.useCallback)((e=>{if(!d({value:e,tabValues:r}))throw new Error("Can't select invalid tab value="+e);o(e),u(e),y(e)}),[u,y,r]),tabValues:r}}var h=n(2303);const v="tabList__CuJ",f="tabItem_LNqP";function b(e){let{className:a,block:n,selectedValue:o,selectValue:i,tabValues:u}=e;const p=[],{blockElementScrollPositionUntilNextRender:c}=(0,s.a_)(),g=e=>{const a=e.currentTarget,n=p.indexOf(a),l=u[n].value;l!==o&&(c(a),i(l))},d=e=>{var a;let n=null;switch(e.key){case"Enter":g(e);break;case"ArrowRight":{var l;const a=p.indexOf(e.currentTarget)+1;n=null!=(l=p[a])?l:p[0];break}case"ArrowLeft":{var t;const a=p.indexOf(e.currentTarget)-1;n=null!=(t=p[a])?t:p[p.length-1];break}}null==(a=n)||a.focus()};return t.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":n},a)},u.map((e=>{let{value:a,label:n,attributes:s}=e;return t.createElement("li",(0,l.A)({role:"tab",tabIndex:o===a?0:-1,"aria-selected":o===a,key:a,ref:e=>p.push(e),onKeyDown:d,onClick:g},s,{className:(0,r.A)("tabs__item",f,null==s?void 0:s.className,{"tabs__item--active":o===a})}),null!=n?n:a)})))}function T(e){let{lazy:a,children:n,selectedValue:l}=e;const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(a){const e=r.find((e=>e.props.value===l));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return t.createElement("div",{className:"margin-top--md"},r.map(((e,a)=>(0,t.cloneElement)(e,{key:a,hidden:e.props.value!==l}))))}function x(e){const a=y(e);return t.createElement("div",{className:(0,r.A)("tabs-container",v)},t.createElement(b,(0,l.A)({},e,a)),t.createElement(T,(0,l.A)({},e,a)))}function I(e){const a=(0,h.A)();return t.createElement(x,(0,l.A)({key:String(a)},e))}},653:(e,a,n)=>{n.r(a),n.d(a,{assets:()=>p,contentTitle:()=>i,default:()=>d,frontMatter:()=>o,metadata:()=>u,toc:()=>c});var l=n(8168),t=(n(6540),n(5680)),r=n(1470),s=n(9365);const o={id:"inspection",title:"Index inspection functions",sidebar_label:"Inspection",slug:"/api/inspection"},i=void 0,u={unversionedId:"api/inspection",id:"api/inspection",title:"Index inspection functions",description:"These functions provide metadata about an H3 index, such as its resolution or base cell, and provide utilities for converting into and out of the 64-bit representation of an H3 index.",source:"@site/docs/api/inspection.mdx",sourceDirName:"api",slug:"/api/inspection",permalink:"/docs/api/inspection",draft:!1,editUrl:"https://github.com/uber/h3/edit/master/website/docs/api/inspection.mdx",tags:[],version:"current",frontMatter:{id:"inspection",title:"Index inspection functions",sidebar_label:"Inspection",slug:"/api/inspection"},sidebar:"someSidebar",previous:{title:"Indexing",permalink:"/docs/api/indexing"},next:{title:"Traversal",permalink:"/docs/api/traversal"}},p={},c=[{value:"getResolution",id:"getresolution",level:2},{value:"getBaseCellNumber",id:"getbasecellnumber",level:2},{value:"stringToH3",id:"stringtoh3",level:2},{value:"h3ToString",id:"h3tostring",level:2},{value:"isValidCell",id:"isvalidcell",level:2},{value:"isResClassIII",id:"isresclassiii",level:2},{value:"isPentagon",id:"ispentagon",level:2},{value:"getIcosahedronFaces",id:"geticosahedronfaces",level:2},{value:"maxFaceCount",id:"maxfacecount",level:2}],g={toc:c};function d(e){let{components:a,...n}=e;return(0,t.yg)("wrapper",(0,l.A)({},g,n,{components:a,mdxType:"MDXLayout"}),(0,t.yg)("p",null,"These functions provide metadata about an H3 index, such as its resolution or base cell, and provide utilities for converting into and out of the 64-bit representation of an H3 index."),(0,t.yg)("h2",{id:"getresolution"},"getResolution"),(0,t.yg)("p",null,"Returns the resolution of the index.\n(Works for cells, edges, and vertexes.)"),(0,t.yg)(r.A,{groupId:"language",defaultValue:"c",values:[{label:"C",value:"c"},{label:"Java",value:"java"},{label:"JavaScript (Live)",value:"javascript"},{label:"Python",value:"python"},{label:"Shell",value:"shell"}],mdxType:"Tabs"},(0,t.yg)(s.A,{value:"c",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-c"},"int getResolution(H3Index h);\n"))),(0,t.yg)(s.A,{value:"java",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-java"},"int getResolution(long h3);\nint getResolution(String h3Address);\n"))),(0,t.yg)(s.A,{value:"javascript",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js"},"h3.getResolution(h)\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js",metastring:"live",live:!0},"function example() {\n const h = '85283473fffffff';\n return h3.getResolution(h);\n}\n"))),(0,t.yg)(s.A,{value:"python",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-py"},"h3.get_resolution(h)\n"))),(0,t.yg)(s.A,{value:"shell",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-sh"},"$ h3 getResolution --help\nh3: Extracts the resolution (0 - 15) from the H3 cell\nH3 4.1.0\n\n getResolution Extracts the resolution (0 - 15) from the H3 cell\n -h, --help Show this help message.\n -c, --cell Required. H3 Cell\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"$ h3 getResolution -c 85283473fffffff\n5\n")))),(0,t.yg)("h2",{id:"getbasecellnumber"},"getBaseCellNumber"),(0,t.yg)("p",null,"Returns the base cell number of the index.\n(Works for cells, edges, and vertexes.)"),(0,t.yg)(r.A,{groupId:"language",defaultValue:"c",values:[{label:"C",value:"c"},{label:"Java",value:"java"},{label:"JavaScript (Live)",value:"javascript"},{label:"Python",value:"python"},{label:"Shell",value:"shell"}],mdxType:"Tabs"},(0,t.yg)(s.A,{value:"c",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-c"},"int getBaseCellNumber(H3Index h);\n"))),(0,t.yg)(s.A,{value:"java",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-java"},"int getBaseCellNumber(long h3);\nint getBaseCellNumber(String h3Address);\n"))),(0,t.yg)(s.A,{value:"javascript",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js"},"h3.getBaseCellNumber(h)\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js",metastring:"live",live:!0},"function example() {\n const h = '85283473fffffff';\n return h3.getBaseCellNumber(h);\n}\n"))),(0,t.yg)(s.A,{value:"python",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-py"},"h3.get_base_cell_number(h)\n"))),(0,t.yg)(s.A,{value:"shell",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-sh"},"$ h3 getBaseCellNumber --help\nh3: Extracts the base cell number (0 - 121) from the H3 cell\nH3 4.1.0\n\n getBaseCellNumber Extracts the base cell number (0 - 121) from the H3 cell\n -h, --help Show this help message.\n -c, --cell Required. H3 Cell\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"$ h3 getBaseCellNumber -c 85283473fffffff\n20\n")))),(0,t.yg)("h2",{id:"stringtoh3"},"stringToH3"),(0,t.yg)("p",null,"Converts the string representation to ",(0,t.yg)("inlineCode",{parentName:"p"},"H3Index")," (",(0,t.yg)("inlineCode",{parentName:"p"},"uint64_t"),") representation."),(0,t.yg)(r.A,{groupId:"language",defaultValue:"c",values:[{label:"C",value:"c"},{label:"Java",value:"java"},{label:"JavaScript (Live)",value:"javascript"},{label:"Python",value:"python"},{label:"Shell",value:"shell"}],mdxType:"Tabs"},(0,t.yg)(s.A,{value:"c",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-c"},"H3Error stringToH3(const char *str, H3Index *out);\n")),(0,t.yg)("p",null,"Returns 0 (",(0,t.yg)("inlineCode",{parentName:"p"},"E_SUCCESS"),") on success.")),(0,t.yg)(s.A,{value:"java",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-java"},"long stringToH3(String h3Address);\n"))),(0,t.yg)(s.A,{value:"javascript",mdxType:"TabItem"},(0,t.yg)("admonition",{type:"note"},(0,t.yg)("p",{parentName:"admonition"},"The H3 JavaScript binding supports only the string representation of an H3 index."))),(0,t.yg)(s.A,{value:"python",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-py"},"h3.string_to_h3(h)\n"))),(0,t.yg)(s.A,{value:"shell",mdxType:"TabItem"},(0,t.yg)("admonition",{type:"note"},(0,t.yg)("p",{parentName:"admonition"},"The H3 CLI supports only the string representation of an H3 index.")))),(0,t.yg)("h2",{id:"h3tostring"},"h3ToString"),(0,t.yg)("p",null,"Converts the ",(0,t.yg)("inlineCode",{parentName:"p"},"H3Index")," representation of the index to the string representation."),(0,t.yg)(r.A,{groupId:"language",defaultValue:"c",values:[{label:"C",value:"c"},{label:"Java",value:"java"},{label:"JavaScript (Live)",value:"javascript"},{label:"Python",value:"python"},{label:"Shell",value:"shell"}],mdxType:"Tabs"},(0,t.yg)(s.A,{value:"c",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-c"},"H3Error h3ToString(H3Index h, char *str, size_t sz);\n")),(0,t.yg)("p",null,(0,t.yg)("inlineCode",{parentName:"p"},"str")," must be at least of length 17.\nReturns 0 (",(0,t.yg)("inlineCode",{parentName:"p"},"E_SUCCESS"),") on success.")),(0,t.yg)(s.A,{value:"java",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-java"},"String h3ToString(long h3);\n"))),(0,t.yg)(s.A,{value:"javascript",mdxType:"TabItem"},(0,t.yg)("admonition",{type:"note"},(0,t.yg)("p",{parentName:"admonition"},"The H3 JavaScript binding supports only the string representation of an H3 index."))),(0,t.yg)(s.A,{value:"python",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-py"},"h3.h3_to_string(h)\n"))),(0,t.yg)(s.A,{value:"shell",mdxType:"TabItem"},(0,t.yg)("admonition",{type:"note"},(0,t.yg)("p",{parentName:"admonition"},"The H3 CLI supports only the string representation of an H3 index.")))),(0,t.yg)("h2",{id:"isvalidcell"},"isValidCell"),(0,t.yg)("p",null,"Returns non-zero if this is a valid H3 cell index."),(0,t.yg)(r.A,{groupId:"language",defaultValue:"c",values:[{label:"C",value:"c"},{label:"Java",value:"java"},{label:"JavaScript (Live)",value:"javascript"},{label:"Python",value:"python"},{label:"Shell",value:"shell"}],mdxType:"Tabs"},(0,t.yg)(s.A,{value:"c",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-c"},"int isValidCell(H3Index h);\n"))),(0,t.yg)(s.A,{value:"java",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-java"},"boolean isValidCell(long h3);\nboolean isValidCell(String h3Address);\n"))),(0,t.yg)(s.A,{value:"javascript",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js"},"h3.isValidCell(h)\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js",metastring:"live",live:!0},"function example() {\n const h = '85283473fffffff';\n return h3.isValidCell(h);\n}\n"))),(0,t.yg)(s.A,{value:"python",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-py"},"h3.is_valid_cell(h)\n"))),(0,t.yg)(s.A,{value:"shell",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-sh"},"$ h3 isValidCell --help\nh3: Checks if the provided H3 index is actually valid\nH3 4.1.0\n\n isValidCell Checks if the provided H3 index is actually valid\n -h, --help Show this help message.\n -c, --cell Required. H3 Cell\n -f, --format 'json' for true or false, 'numeric' for 1 or 0 (Default: json)\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"$ h3 isValidCell -c 85283473fffffff\ntrue\n")))),(0,t.yg)("h2",{id:"isresclassiii"},"isResClassIII"),(0,t.yg)("p",null,"Returns non-zero if this index has a resolution with Class III orientation."),(0,t.yg)(r.A,{groupId:"language",defaultValue:"c",values:[{label:"C",value:"c"},{label:"Java",value:"java"},{label:"JavaScript (Live)",value:"javascript"},{label:"Python",value:"python"},{label:"Shell",value:"shell"}],mdxType:"Tabs"},(0,t.yg)(s.A,{value:"c",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-c"},"int isResClassIII(H3Index h);\n"))),(0,t.yg)(s.A,{value:"java",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-java"},"boolean isResClassIII(long h3);\nboolean isResClassIII(String h3Address);\n"))),(0,t.yg)(s.A,{value:"javascript",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js"},"h3.isResClassIII(h)\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js",metastring:"live",live:!0},"function example() {\n const h = '85283473fffffff';\n return h3.isResClassIII(h);\n}\n"))),(0,t.yg)(s.A,{value:"python",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-py"},"h3.is_res_class_III(h)\n"))),(0,t.yg)(s.A,{value:"shell",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-sh"},"$ h3 isResClassIII --help\nh3: Checks if the provided H3 index has a Class III orientation\nH3 4.1.0\n\n isResClassIII Checks if the provided H3 index has a Class III orientation\n -h, --help Show this help message.\n -c, --cell Required. H3 Cell\n -f, --format 'json' for true or false, 'numeric' for 1 or 0 (Default: json)\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"$ h3 isResClassIII -c 85283473fffffff\ntrue\n")))),(0,t.yg)("h2",{id:"ispentagon"},"isPentagon"),(0,t.yg)("p",null,"Returns non-zero if this index represents a pentagonal cell."),(0,t.yg)(r.A,{groupId:"language",defaultValue:"c",values:[{label:"C",value:"c"},{label:"Java",value:"java"},{label:"JavaScript (Live)",value:"javascript"},{label:"Python",value:"python"},{label:"Shell",value:"shell"}],mdxType:"Tabs"},(0,t.yg)(s.A,{value:"c",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-c"},"int isPentagon(H3Index h);\n"))),(0,t.yg)(s.A,{value:"java",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-java"},"boolean isPentagon(long h3);\nboolean isPentagon(String h3Address);\n"))),(0,t.yg)(s.A,{value:"javascript",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js"},"h3.isPentagon(h)\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js",metastring:"live",live:!0},"function example() {\n const h = '85283473fffffff';\n return h3.isPentagon(h);\n}\n"))),(0,t.yg)(s.A,{value:"python",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-py"},"h3.is_pentagon(h)\n"))),(0,t.yg)(s.A,{value:"shell",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-sh"},"$ h3 isPentagon --help\nh3: Checks if the provided H3 index is a pentagon instead of a hexagon\nH3 4.1.0\n\n isPentagon Checks if the provided H3 index is a pentagon instead of a hexagon\n -h, --help Show this help message.\n -c, --cell Required. H3 Cell\n -f, --format 'json' for true or false, 'numeric' for 1 or 0 (Default: json)\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"$ h3 isPentagon -c 85283473fffffff\nfalse\n")))),(0,t.yg)("h2",{id:"geticosahedronfaces"},"getIcosahedronFaces"),(0,t.yg)("p",null,"Find all icosahedron faces intersected by a given H3 cell.\nFaces are represented as integers from 0-19, inclusive."),(0,t.yg)(r.A,{groupId:"language",defaultValue:"c",values:[{label:"C",value:"c"},{label:"Java",value:"java"},{label:"JavaScript (Live)",value:"javascript"},{label:"Python",value:"python"},{label:"Shell",value:"shell"}],mdxType:"Tabs"},(0,t.yg)(s.A,{value:"c",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-c"},"H3Error getIcosahedronFaces(H3Index h, int* out);\n")),(0,t.yg)("p",null,"Face values are placed in the array ",(0,t.yg)("inlineCode",{parentName:"p"},"out"),".\n",(0,t.yg)("inlineCode",{parentName:"p"},"out")," must be at least length of ",(0,t.yg)("inlineCode",{parentName:"p"},"maxFaceCount(h)"),".\nThe array is sparse, and empty (no intersection) array values are represented by -1."),(0,t.yg)("p",null,"Returns 0 (",(0,t.yg)("inlineCode",{parentName:"p"},"E_SUCCESS"),") on success.")),(0,t.yg)(s.A,{value:"java",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-java"},"Collection getIcosahedronFaces(long h3);\nCollection getIcosahedronFaces(String h3Address);\n"))),(0,t.yg)(s.A,{value:"javascript",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js"},"h3.getIcosahedronFaces(h)\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js",metastring:"live",live:!0},"function example() {\n const h = '85283473fffffff';\n return h3.getIcosahedronFaces(h);\n}\n"))),(0,t.yg)(s.A,{value:"python",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-py"},"h3.get_icosahedron_faces(h)\n"))),(0,t.yg)(s.A,{value:"shell",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-sh"},"$ h3 getIcosahedronFaces --help\nh3: Returns the icosahedron face numbers (0 - 19) that the H3 index intersects\nH3 4.1.0\n\n getIcosahedronFaces Returns the icosahedron face numbers (0 - 19) that the H3 index intersects\n -h, --help Show this help message.\n -c, --cell Required. H3 Cell\n -f, --format 'json' for [faceNum, ...], 'newline' for faceNum\\n... (Default: json)\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"$ h3 getIcosahedronFaces -c 85283473fffffff\n[7]\n")))),(0,t.yg)("h2",{id:"maxfacecount"},"maxFaceCount"),(0,t.yg)("p",null,"Returns the maximum number of icosahedron faces the given H3 index may intersect."),(0,t.yg)(r.A,{groupId:"language",defaultValue:"c",values:[{label:"C",value:"c"},{label:"Java",value:"java"},{label:"JavaScript (Live)",value:"javascript"},{label:"Python",value:"python"},{label:"Shell",value:"shell"}],mdxType:"Tabs"},(0,t.yg)(s.A,{value:"c",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-c"},"H3Error maxFaceCount(H3Index h3, int *out);\n")),(0,t.yg)("p",null,"Returns 0 (",(0,t.yg)("inlineCode",{parentName:"p"},"E_SUCCESS"),") on success.")),(0,t.yg)(s.A,{value:"java",mdxType:"TabItem"},(0,t.yg)("admonition",{type:"note"},(0,t.yg)("p",{parentName:"admonition"},"This function exists for memory management and is not exposed."))),(0,t.yg)(s.A,{value:"javascript",mdxType:"TabItem"},(0,t.yg)("admonition",{type:"note"},(0,t.yg)("p",{parentName:"admonition"},"This function exists for memory management and is not exposed."))),(0,t.yg)(s.A,{value:"python",mdxType:"TabItem"},(0,t.yg)("admonition",{type:"note"},(0,t.yg)("p",{parentName:"admonition"},"This function exists for memory management and is not exposed."))),(0,t.yg)(s.A,{value:"shell",mdxType:"TabItem"},(0,t.yg)("admonition",{type:"note"},(0,t.yg)("p",{parentName:"admonition"},"This function exists for memory management and is not exposed.")))))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkh3_website=self.webpackChunkh3_website||[]).push([[4423],{5680:(e,a,n)=>{n.d(a,{xA:()=>p,yg:()=>d});var l=n(6540);function t(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function r(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);a&&(l=l.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,l)}return n}function s(e){for(var a=1;a=0||(t[n]=e[n]);return t}(e,a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(l=0;l=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var i=l.createContext({}),u=function(e){var a=l.useContext(i),n=a;return e&&(n="function"==typeof e?e(a):s(s({},a),e)),n},p=function(e){var a=u(e.components);return l.createElement(i.Provider,{value:a},e.children)},c={inlineCode:"code",wrapper:function(e){var a=e.children;return l.createElement(l.Fragment,{},a)}},g=l.forwardRef((function(e,a){var n=e.components,t=e.mdxType,r=e.originalType,i=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),g=u(n),d=t,m=g["".concat(i,".").concat(d)]||g[d]||c[d]||r;return n?l.createElement(m,s(s({ref:a},p),{},{components:n})):l.createElement(m,s({ref:a},p))}));function d(e,a){var n=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var r=n.length,s=new Array(r);s[0]=g;var o={};for(var i in a)hasOwnProperty.call(a,i)&&(o[i]=a[i]);o.originalType=e,o.mdxType="string"==typeof e?e:t,s[1]=o;for(var u=2;u{n.d(a,{A:()=>s});var l=n(6540),t=n(53);const r="tabItem_Ymn6";function s(e){let{children:a,hidden:n,className:s}=e;return l.createElement("div",{role:"tabpanel",className:(0,t.A)(r,s),hidden:n},a)}},1470:(e,a,n)=>{n.d(a,{A:()=>I});var l=n(8168),t=n(6540),r=n(53),s=n(3104),o=n(2681),i=n(7485),u=n(1682),p=n(9466);function c(e){return function(e){var a,n;return null!=(a=null==(n=t.Children.map(e,(e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:a}=e;return!!a&&"object"==typeof a&&"value"in a}(e))return e;throw new Error("Docusaurus error: Bad child <"+("string"==typeof e.type?e.type:e.type.name)+'>: all children of the component should be , and every should have a unique "value" prop.')})))?void 0:n.filter(Boolean))?a:[]}(e).map((e=>{let{props:{value:a,label:n,attributes:l,default:t}}=e;return{value:a,label:n,attributes:l,default:t}}))}function g(e){const{values:a,children:n}=e;return(0,t.useMemo)((()=>{const e=null!=a?a:c(n);return function(e){const a=(0,u.X)(e,((e,a)=>e.value===a.value));if(a.length>0)throw new Error('Docusaurus error: Duplicate values "'+a.map((e=>e.value)).join(", ")+'" found in . Every value needs to be unique.')}(e),e}),[a,n])}function d(e){let{value:a,tabValues:n}=e;return n.some((e=>e.value===a))}function m(e){let{queryString:a=!1,groupId:n}=e;const l=(0,o.W6)(),r=function(e){let{queryString:a=!1,groupId:n}=e;if("string"==typeof a)return a;if(!1===a)return null;if(!0===a&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return null!=n?n:null}({queryString:a,groupId:n});return[(0,i.aZ)(r),(0,t.useCallback)((e=>{if(!r)return;const a=new URLSearchParams(l.location.search);a.set(r,e),l.replace({...l.location,search:a.toString()})}),[r,l])]}function y(e){const{defaultValue:a,queryString:n=!1,groupId:l}=e,r=g(e),[s,o]=(0,t.useState)((()=>function(e){var a;let{defaultValue:n,tabValues:l}=e;if(0===l.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!d({value:n,tabValues:l}))throw new Error('Docusaurus error: The has a defaultValue "'+n+'" but none of its children has the corresponding value. Available values are: '+l.map((e=>e.value)).join(", ")+". If you intend to show no default tab, use defaultValue={null} instead.");return n}const t=null!=(a=l.find((e=>e.default)))?a:l[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:a,tabValues:r}))),[i,u]=m({queryString:n,groupId:l}),[c,y]=function(e){let{groupId:a}=e;const n=function(e){return e?"docusaurus.tab."+e:null}(a),[l,r]=(0,p.Dv)(n);return[l,(0,t.useCallback)((e=>{n&&r.set(e)}),[n,r])]}({groupId:l}),h=(()=>{const e=null!=i?i:c;return d({value:e,tabValues:r})?e:null})();(0,t.useLayoutEffect)((()=>{h&&o(h)}),[h]);return{selectedValue:s,selectValue:(0,t.useCallback)((e=>{if(!d({value:e,tabValues:r}))throw new Error("Can't select invalid tab value="+e);o(e),u(e),y(e)}),[u,y,r]),tabValues:r}}var h=n(2303);const v="tabList__CuJ",f="tabItem_LNqP";function b(e){let{className:a,block:n,selectedValue:o,selectValue:i,tabValues:u}=e;const p=[],{blockElementScrollPositionUntilNextRender:c}=(0,s.a_)(),g=e=>{const a=e.currentTarget,n=p.indexOf(a),l=u[n].value;l!==o&&(c(a),i(l))},d=e=>{var a;let n=null;switch(e.key){case"Enter":g(e);break;case"ArrowRight":{var l;const a=p.indexOf(e.currentTarget)+1;n=null!=(l=p[a])?l:p[0];break}case"ArrowLeft":{var t;const a=p.indexOf(e.currentTarget)-1;n=null!=(t=p[a])?t:p[p.length-1];break}}null==(a=n)||a.focus()};return t.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":n},a)},u.map((e=>{let{value:a,label:n,attributes:s}=e;return t.createElement("li",(0,l.A)({role:"tab",tabIndex:o===a?0:-1,"aria-selected":o===a,key:a,ref:e=>p.push(e),onKeyDown:d,onClick:g},s,{className:(0,r.A)("tabs__item",f,null==s?void 0:s.className,{"tabs__item--active":o===a})}),null!=n?n:a)})))}function T(e){let{lazy:a,children:n,selectedValue:l}=e;const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(a){const e=r.find((e=>e.props.value===l));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return t.createElement("div",{className:"margin-top--md"},r.map(((e,a)=>(0,t.cloneElement)(e,{key:a,hidden:e.props.value!==l}))))}function x(e){const a=y(e);return t.createElement("div",{className:(0,r.A)("tabs-container",v)},t.createElement(b,(0,l.A)({},e,a)),t.createElement(T,(0,l.A)({},e,a)))}function I(e){const a=(0,h.A)();return t.createElement(x,(0,l.A)({key:String(a)},e))}},653:(e,a,n)=>{n.r(a),n.d(a,{assets:()=>p,contentTitle:()=>i,default:()=>d,frontMatter:()=>o,metadata:()=>u,toc:()=>c});var l=n(8168),t=(n(6540),n(5680)),r=n(1470),s=n(9365);const o={id:"inspection",title:"Index inspection functions",sidebar_label:"Inspection",slug:"/api/inspection"},i=void 0,u={unversionedId:"api/inspection",id:"api/inspection",title:"Index inspection functions",description:"These functions provide metadata about an H3 index, such as its resolution or base cell, and provide utilities for converting into and out of the 64-bit representation of an H3 index.",source:"@site/docs/api/inspection.mdx",sourceDirName:"api",slug:"/api/inspection",permalink:"/docs/api/inspection",draft:!1,editUrl:"https://github.com/uber/h3/edit/master/website/docs/api/inspection.mdx",tags:[],version:"current",frontMatter:{id:"inspection",title:"Index inspection functions",sidebar_label:"Inspection",slug:"/api/inspection"},sidebar:"someSidebar",previous:{title:"Indexing",permalink:"/docs/api/indexing"},next:{title:"Traversal",permalink:"/docs/api/traversal"}},p={},c=[{value:"getResolution",id:"getresolution",level:2},{value:"getBaseCellNumber",id:"getbasecellnumber",level:2},{value:"stringToH3",id:"stringtoh3",level:2},{value:"h3ToString",id:"h3tostring",level:2},{value:"isValidCell",id:"isvalidcell",level:2},{value:"isResClassIII",id:"isresclassiii",level:2},{value:"isPentagon",id:"ispentagon",level:2},{value:"getIcosahedronFaces",id:"geticosahedronfaces",level:2},{value:"maxFaceCount",id:"maxfacecount",level:2}],g={toc:c};function d(e){let{components:a,...n}=e;return(0,t.yg)("wrapper",(0,l.A)({},g,n,{components:a,mdxType:"MDXLayout"}),(0,t.yg)("p",null,"These functions provide metadata about an H3 index, such as its resolution or base cell, and provide utilities for converting into and out of the 64-bit representation of an H3 index."),(0,t.yg)("h2",{id:"getresolution"},"getResolution"),(0,t.yg)("p",null,"Returns the resolution of the index.\n(Works for cells, edges, and vertexes.)"),(0,t.yg)(r.A,{groupId:"language",defaultValue:"c",values:[{label:"C",value:"c"},{label:"Java",value:"java"},{label:"JavaScript (Live)",value:"javascript"},{label:"Python",value:"python"},{label:"Shell",value:"shell"}],mdxType:"Tabs"},(0,t.yg)(s.A,{value:"c",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-c"},"int getResolution(H3Index h);\n"))),(0,t.yg)(s.A,{value:"java",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-java"},"int getResolution(long h3);\nint getResolution(String h3Address);\n"))),(0,t.yg)(s.A,{value:"javascript",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js"},"h3.getResolution(h)\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js",metastring:"live",live:!0},"function example() {\n const h = '85283473fffffff';\n return h3.getResolution(h);\n}\n"))),(0,t.yg)(s.A,{value:"python",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-py"},"h3.get_resolution(h)\n"))),(0,t.yg)(s.A,{value:"shell",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-sh"},"$ h3 getResolution --help\nh3: Extracts the resolution (0 - 15) from the H3 cell\nH3 4.1.0\n\n getResolution Extracts the resolution (0 - 15) from the H3 cell\n -h, --help Show this help message.\n -c, --cell Required. H3 Cell\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"$ h3 getResolution -c 85283473fffffff\n5\n")))),(0,t.yg)("h2",{id:"getbasecellnumber"},"getBaseCellNumber"),(0,t.yg)("p",null,"Returns the base cell number of the index.\n(Works for cells, edges, and vertexes.)"),(0,t.yg)(r.A,{groupId:"language",defaultValue:"c",values:[{label:"C",value:"c"},{label:"Java",value:"java"},{label:"JavaScript (Live)",value:"javascript"},{label:"Python",value:"python"},{label:"Shell",value:"shell"}],mdxType:"Tabs"},(0,t.yg)(s.A,{value:"c",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-c"},"int getBaseCellNumber(H3Index h);\n"))),(0,t.yg)(s.A,{value:"java",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-java"},"int getBaseCellNumber(long h3);\nint getBaseCellNumber(String h3Address);\n"))),(0,t.yg)(s.A,{value:"javascript",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js"},"h3.getBaseCellNumber(h)\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js",metastring:"live",live:!0},"function example() {\n const h = '85283473fffffff';\n return h3.getBaseCellNumber(h);\n}\n"))),(0,t.yg)(s.A,{value:"python",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-py"},"h3.get_base_cell_number(h)\n"))),(0,t.yg)(s.A,{value:"shell",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-sh"},"$ h3 getBaseCellNumber --help\nh3: Extracts the base cell number (0 - 121) from the H3 cell\nH3 4.1.0\n\n getBaseCellNumber Extracts the base cell number (0 - 121) from the H3 cell\n -h, --help Show this help message.\n -c, --cell Required. H3 Cell\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"$ h3 getBaseCellNumber -c 85283473fffffff\n20\n")))),(0,t.yg)("h2",{id:"stringtoh3"},"stringToH3"),(0,t.yg)("p",null,"Converts the string representation to ",(0,t.yg)("inlineCode",{parentName:"p"},"H3Index")," (",(0,t.yg)("inlineCode",{parentName:"p"},"uint64_t"),") representation."),(0,t.yg)(r.A,{groupId:"language",defaultValue:"c",values:[{label:"C",value:"c"},{label:"Java",value:"java"},{label:"JavaScript (Live)",value:"javascript"},{label:"Python",value:"python"},{label:"Shell",value:"shell"}],mdxType:"Tabs"},(0,t.yg)(s.A,{value:"c",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-c"},"H3Error stringToH3(const char *str, H3Index *out);\n")),(0,t.yg)("p",null,"Returns 0 (",(0,t.yg)("inlineCode",{parentName:"p"},"E_SUCCESS"),") on success.")),(0,t.yg)(s.A,{value:"java",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-java"},"long stringToH3(String h3Address);\n"))),(0,t.yg)(s.A,{value:"javascript",mdxType:"TabItem"},(0,t.yg)("admonition",{type:"note"},(0,t.yg)("p",{parentName:"admonition"},"The H3 JavaScript binding supports only the string representation of an H3 index."))),(0,t.yg)(s.A,{value:"python",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-py"},"h3.str_to_int(h)\n"))),(0,t.yg)(s.A,{value:"shell",mdxType:"TabItem"},(0,t.yg)("admonition",{type:"note"},(0,t.yg)("p",{parentName:"admonition"},"The H3 CLI supports only the string representation of an H3 index.")))),(0,t.yg)("h2",{id:"h3tostring"},"h3ToString"),(0,t.yg)("p",null,"Converts the ",(0,t.yg)("inlineCode",{parentName:"p"},"H3Index")," representation of the index to the string representation."),(0,t.yg)(r.A,{groupId:"language",defaultValue:"c",values:[{label:"C",value:"c"},{label:"Java",value:"java"},{label:"JavaScript (Live)",value:"javascript"},{label:"Python",value:"python"},{label:"Shell",value:"shell"}],mdxType:"Tabs"},(0,t.yg)(s.A,{value:"c",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-c"},"H3Error h3ToString(H3Index h, char *str, size_t sz);\n")),(0,t.yg)("p",null,(0,t.yg)("inlineCode",{parentName:"p"},"str")," must be at least of length 17.\nReturns 0 (",(0,t.yg)("inlineCode",{parentName:"p"},"E_SUCCESS"),") on success.")),(0,t.yg)(s.A,{value:"java",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-java"},"String h3ToString(long h3);\n"))),(0,t.yg)(s.A,{value:"javascript",mdxType:"TabItem"},(0,t.yg)("admonition",{type:"note"},(0,t.yg)("p",{parentName:"admonition"},"The H3 JavaScript binding supports only the string representation of an H3 index."))),(0,t.yg)(s.A,{value:"python",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-py"},"h3.int_to_str(h)\n"))),(0,t.yg)(s.A,{value:"shell",mdxType:"TabItem"},(0,t.yg)("admonition",{type:"note"},(0,t.yg)("p",{parentName:"admonition"},"The H3 CLI supports only the string representation of an H3 index.")))),(0,t.yg)("h2",{id:"isvalidcell"},"isValidCell"),(0,t.yg)("p",null,"Returns non-zero if this is a valid H3 cell index."),(0,t.yg)(r.A,{groupId:"language",defaultValue:"c",values:[{label:"C",value:"c"},{label:"Java",value:"java"},{label:"JavaScript (Live)",value:"javascript"},{label:"Python",value:"python"},{label:"Shell",value:"shell"}],mdxType:"Tabs"},(0,t.yg)(s.A,{value:"c",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-c"},"int isValidCell(H3Index h);\n"))),(0,t.yg)(s.A,{value:"java",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-java"},"boolean isValidCell(long h3);\nboolean isValidCell(String h3Address);\n"))),(0,t.yg)(s.A,{value:"javascript",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js"},"h3.isValidCell(h)\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js",metastring:"live",live:!0},"function example() {\n const h = '85283473fffffff';\n return h3.isValidCell(h);\n}\n"))),(0,t.yg)(s.A,{value:"python",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-py"},"h3.is_valid_cell(h)\n"))),(0,t.yg)(s.A,{value:"shell",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-sh"},"$ h3 isValidCell --help\nh3: Checks if the provided H3 index is actually valid\nH3 4.1.0\n\n isValidCell Checks if the provided H3 index is actually valid\n -h, --help Show this help message.\n -c, --cell Required. H3 Cell\n -f, --format 'json' for true or false, 'numeric' for 1 or 0 (Default: json)\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"$ h3 isValidCell -c 85283473fffffff\ntrue\n")))),(0,t.yg)("h2",{id:"isresclassiii"},"isResClassIII"),(0,t.yg)("p",null,"Returns non-zero if this index has a resolution with Class III orientation."),(0,t.yg)(r.A,{groupId:"language",defaultValue:"c",values:[{label:"C",value:"c"},{label:"Java",value:"java"},{label:"JavaScript (Live)",value:"javascript"},{label:"Python",value:"python"},{label:"Shell",value:"shell"}],mdxType:"Tabs"},(0,t.yg)(s.A,{value:"c",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-c"},"int isResClassIII(H3Index h);\n"))),(0,t.yg)(s.A,{value:"java",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-java"},"boolean isResClassIII(long h3);\nboolean isResClassIII(String h3Address);\n"))),(0,t.yg)(s.A,{value:"javascript",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js"},"h3.isResClassIII(h)\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js",metastring:"live",live:!0},"function example() {\n const h = '85283473fffffff';\n return h3.isResClassIII(h);\n}\n"))),(0,t.yg)(s.A,{value:"python",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-py"},"h3.is_res_class_III(h)\n"))),(0,t.yg)(s.A,{value:"shell",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-sh"},"$ h3 isResClassIII --help\nh3: Checks if the provided H3 index has a Class III orientation\nH3 4.1.0\n\n isResClassIII Checks if the provided H3 index has a Class III orientation\n -h, --help Show this help message.\n -c, --cell Required. H3 Cell\n -f, --format 'json' for true or false, 'numeric' for 1 or 0 (Default: json)\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"$ h3 isResClassIII -c 85283473fffffff\ntrue\n")))),(0,t.yg)("h2",{id:"ispentagon"},"isPentagon"),(0,t.yg)("p",null,"Returns non-zero if this index represents a pentagonal cell."),(0,t.yg)(r.A,{groupId:"language",defaultValue:"c",values:[{label:"C",value:"c"},{label:"Java",value:"java"},{label:"JavaScript (Live)",value:"javascript"},{label:"Python",value:"python"},{label:"Shell",value:"shell"}],mdxType:"Tabs"},(0,t.yg)(s.A,{value:"c",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-c"},"int isPentagon(H3Index h);\n"))),(0,t.yg)(s.A,{value:"java",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-java"},"boolean isPentagon(long h3);\nboolean isPentagon(String h3Address);\n"))),(0,t.yg)(s.A,{value:"javascript",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js"},"h3.isPentagon(h)\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js",metastring:"live",live:!0},"function example() {\n const h = '85283473fffffff';\n return h3.isPentagon(h);\n}\n"))),(0,t.yg)(s.A,{value:"python",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-py"},"h3.is_pentagon(h)\n"))),(0,t.yg)(s.A,{value:"shell",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-sh"},"$ h3 isPentagon --help\nh3: Checks if the provided H3 index is a pentagon instead of a hexagon\nH3 4.1.0\n\n isPentagon Checks if the provided H3 index is a pentagon instead of a hexagon\n -h, --help Show this help message.\n -c, --cell Required. H3 Cell\n -f, --format 'json' for true or false, 'numeric' for 1 or 0 (Default: json)\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"$ h3 isPentagon -c 85283473fffffff\nfalse\n")))),(0,t.yg)("h2",{id:"geticosahedronfaces"},"getIcosahedronFaces"),(0,t.yg)("p",null,"Find all icosahedron faces intersected by a given H3 cell.\nFaces are represented as integers from 0-19, inclusive."),(0,t.yg)(r.A,{groupId:"language",defaultValue:"c",values:[{label:"C",value:"c"},{label:"Java",value:"java"},{label:"JavaScript (Live)",value:"javascript"},{label:"Python",value:"python"},{label:"Shell",value:"shell"}],mdxType:"Tabs"},(0,t.yg)(s.A,{value:"c",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-c"},"H3Error getIcosahedronFaces(H3Index h, int* out);\n")),(0,t.yg)("p",null,"Face values are placed in the array ",(0,t.yg)("inlineCode",{parentName:"p"},"out"),".\n",(0,t.yg)("inlineCode",{parentName:"p"},"out")," must be at least length of ",(0,t.yg)("inlineCode",{parentName:"p"},"maxFaceCount(h)"),".\nThe array is sparse, and empty (no intersection) array values are represented by -1."),(0,t.yg)("p",null,"Returns 0 (",(0,t.yg)("inlineCode",{parentName:"p"},"E_SUCCESS"),") on success.")),(0,t.yg)(s.A,{value:"java",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-java"},"Collection getIcosahedronFaces(long h3);\nCollection getIcosahedronFaces(String h3Address);\n"))),(0,t.yg)(s.A,{value:"javascript",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js"},"h3.getIcosahedronFaces(h)\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-js",metastring:"live",live:!0},"function example() {\n const h = '85283473fffffff';\n return h3.getIcosahedronFaces(h);\n}\n"))),(0,t.yg)(s.A,{value:"python",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-py"},"h3.get_icosahedron_faces(h)\n"))),(0,t.yg)(s.A,{value:"shell",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-sh"},"$ h3 getIcosahedronFaces --help\nh3: Returns the icosahedron face numbers (0 - 19) that the H3 index intersects\nH3 4.1.0\n\n getIcosahedronFaces Returns the icosahedron face numbers (0 - 19) that the H3 index intersects\n -h, --help Show this help message.\n -c, --cell Required. H3 Cell\n -f, --format 'json' for [faceNum, ...], 'newline' for faceNum\\n... (Default: json)\n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"$ h3 getIcosahedronFaces -c 85283473fffffff\n[7]\n")))),(0,t.yg)("h2",{id:"maxfacecount"},"maxFaceCount"),(0,t.yg)("p",null,"Returns the maximum number of icosahedron faces the given H3 index may intersect."),(0,t.yg)(r.A,{groupId:"language",defaultValue:"c",values:[{label:"C",value:"c"},{label:"Java",value:"java"},{label:"JavaScript (Live)",value:"javascript"},{label:"Python",value:"python"},{label:"Shell",value:"shell"}],mdxType:"Tabs"},(0,t.yg)(s.A,{value:"c",mdxType:"TabItem"},(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-c"},"H3Error maxFaceCount(H3Index h3, int *out);\n")),(0,t.yg)("p",null,"Returns 0 (",(0,t.yg)("inlineCode",{parentName:"p"},"E_SUCCESS"),") on success.")),(0,t.yg)(s.A,{value:"java",mdxType:"TabItem"},(0,t.yg)("admonition",{type:"note"},(0,t.yg)("p",{parentName:"admonition"},"This function exists for memory management and is not exposed."))),(0,t.yg)(s.A,{value:"javascript",mdxType:"TabItem"},(0,t.yg)("admonition",{type:"note"},(0,t.yg)("p",{parentName:"admonition"},"This function exists for memory management and is not exposed."))),(0,t.yg)(s.A,{value:"python",mdxType:"TabItem"},(0,t.yg)("admonition",{type:"note"},(0,t.yg)("p",{parentName:"admonition"},"This function exists for memory management and is not exposed."))),(0,t.yg)(s.A,{value:"shell",mdxType:"TabItem"},(0,t.yg)("admonition",{type:"note"},(0,t.yg)("p",{parentName:"admonition"},"This function exists for memory management and is not exposed.")))))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.e1cb6546.js b/assets/js/runtime~main.b7e63586.js similarity index 98% rename from assets/js/runtime~main.e1cb6546.js rename to assets/js/runtime~main.b7e63586.js index 1d6896950..3de4a471a 100644 --- a/assets/js/runtime~main.e1cb6546.js +++ b/assets/js/runtime~main.b7e63586.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,d,f,c,b={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var d=t[e]={exports:{}};return b[e].call(d.exports,d,d.exports,r),d.exports}r.m=b,e=[],r.O=(a,d,f,c)=>{if(!d){var b=1/0;for(i=0;i=c)&&Object.keys(r.O).every((e=>r.O[e](d[o])))?d.splice(o--,1):(t=!1,c0&&e[i-1][2]>c;i--)e[i]=e[i-1];e[i]=[d,f,c]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},d=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,f){if(1&f&&(e=this(e)),8&f)return e;if("object"==typeof e&&e){if(4&f&&e.__esModule)return e;if(16&f&&"function"==typeof e.then)return e}var c=Object.create(null);r.r(c);var b={};a=a||[null,d({}),d([]),d(d)];for(var t=2&f&&e;"object"==typeof t&&!~a.indexOf(t);t=d(t))Object.getOwnPropertyNames(t).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,r.d(c,b),c},r.d=(e,a)=>{for(var d in a)r.o(a,d)&&!r.o(e,d)&&Object.defineProperty(e,d,{enumerable:!0,get:a[d]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,d)=>(r.f[d](e,a),a)),[])),r.u=e=>"assets/js/"+({58:"b5c5dd86",906:"189aaee1",1032:"d7a9a298",1071:"bae90603",1156:"99d0c291",1195:"68225966",1535:"05791271",1578:"68805b82",1589:"50228cc7",1619:"19d631a3",1885:"dab818f4",2070:"34251a6c",2143:"c16916bd",2220:"729ab2a1",2278:"23374ca6",2339:"e2f3de81",2388:"02ff1c63",2441:"87a6d570",2634:"c4f5d8e4",2712:"27a03cad",2802:"fa4d91bf",2874:"de765383",3011:"12a68e96",3282:"64f36fa5",3306:"e6b8e746",3307:"5865895f",3355:"81699298",3737:"6668789f",3822:"8070e160",3826:"2e11adad",3837:"c40752a6",4117:"b9897a48",4187:"fbef1709",4218:"ae324a9f",4302:"9e89d62b",4423:"3095a365",4712:"f61d236c",5065:"3206a0f6",5146:"14bd523d",5166:"61118aa6",5396:"0b2050d0",5420:"f7acec0f",5524:"5dde19ad",5569:"1617ae38",5631:"2c3cf8c0",5793:"4f832294",5880:"d6d76602",5895:"c597ff39",5941:"7eb267a0",5965:"9bf41262",6097:"fdb8e513",6367:"f1e5cb15",6994:"eaa4a4c2",7105:"14e4e148",7318:"6ad39459",7455:"90a51507",7470:"6f42ab02",7533:"9ff4adb4",7545:"e6060a2b",7576:"6eaead5b",7683:"c331bc18",7858:"5056453c",8070:"0480b142",8298:"0f5b76ef",8314:"b309b599",8348:"f159c6d5",8399:"161f5775",8401:"17896441",8419:"3e1d306d",8581:"935f2afb",8714:"1be78505",9322:"2cb0f3b9",9633:"4d838a35",9863:"2936ee19",9957:"2d141a6c"}[e]||e)+"."+{58:"7bedbe66",842:"f6576b58",906:"34e2bf06",1032:"e1f349e9",1071:"a77b5ebc",1156:"66a1395b",1195:"1bd356b4",1535:"98a1c283",1578:"a06d7e7d",1589:"9a676a55",1619:"5b0e139e",1774:"ab875877",1885:"de5a696d",2070:"82e4c5a9",2143:"cbfe902a",2220:"bcc20529",2278:"dc44d444",2339:"d58ad3a2",2388:"944936b9",2441:"b2ddcda0",2634:"860991b2",2712:"246abd39",2802:"bd4f7023",2874:"74c776a2",3011:"50dedbfe",3282:"5922694c",3306:"d0ad3129",3307:"ec534582",3355:"61f87d21",3737:"4d819733",3822:"4175bfc9",3826:"ca4b3940",3837:"da9f8b77",4117:"63464ab6",4187:"7270cb39",4218:"284befc5",4220:"89659f15",4302:"eda7636d",4423:"39d9356d",4538:"e6c340b7",4712:"a8a0fe1f",5065:"3a42c562",5146:"302c0085",5166:"e0354ee5",5396:"3b366dd4",5420:"881def36",5524:"fd6834ef",5569:"0152eea7",5631:"394d84f2",5793:"cc86b4b3",5880:"41f18064",5895:"5daf2668",5941:"57382c79",5965:"28df0b7e",6097:"13f797fe",6367:"7f5b75a2",6994:"a0f4460e",7105:"7b19d3dc",7318:"bb54f8dd",7455:"ed7c8c95",7470:"2c6874fb",7533:"1ba998d8",7545:"218f88b4",7576:"81c7a040",7683:"c85aca2b",7858:"e7cf7967",8070:"aa079a4e",8298:"1ba8d011",8314:"3c824eb4",8348:"fbc325a0",8399:"1c0aeee1",8401:"b902181d",8419:"6eac75af",8581:"b9771ca0",8714:"590a5b3d",9322:"f9c5cc09",9633:"529323f1",9863:"9f602670",9957:"1a1e8fa4"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),f={},c="h3-website:",r.l=(e,a,d,b)=>{if(f[e])f[e].push(a);else{var t,o;if(void 0!==d)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var c=f[e];if(delete f[e],t.parentNode&&t.parentNode.removeChild(t),c&&c.forEach((e=>e(d))),a)return a(d)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/",r.gca=function(e){return e={17896441:"8401",68225966:"1195",81699298:"3355",b5c5dd86:"58","189aaee1":"906",d7a9a298:"1032",bae90603:"1071","99d0c291":"1156","05791271":"1535","68805b82":"1578","50228cc7":"1589","19d631a3":"1619",dab818f4:"1885","34251a6c":"2070",c16916bd:"2143","729ab2a1":"2220","23374ca6":"2278",e2f3de81:"2339","02ff1c63":"2388","87a6d570":"2441",c4f5d8e4:"2634","27a03cad":"2712",fa4d91bf:"2802",de765383:"2874","12a68e96":"3011","64f36fa5":"3282",e6b8e746:"3306","5865895f":"3307","6668789f":"3737","8070e160":"3822","2e11adad":"3826",c40752a6:"3837",b9897a48:"4117",fbef1709:"4187",ae324a9f:"4218","9e89d62b":"4302","3095a365":"4423",f61d236c:"4712","3206a0f6":"5065","14bd523d":"5146","61118aa6":"5166","0b2050d0":"5396",f7acec0f:"5420","5dde19ad":"5524","1617ae38":"5569","2c3cf8c0":"5631","4f832294":"5793",d6d76602:"5880",c597ff39:"5895","7eb267a0":"5941","9bf41262":"5965",fdb8e513:"6097",f1e5cb15:"6367",eaa4a4c2:"6994","14e4e148":"7105","6ad39459":"7318","90a51507":"7455","6f42ab02":"7470","9ff4adb4":"7533",e6060a2b:"7545","6eaead5b":"7576",c331bc18:"7683","5056453c":"7858","0480b142":"8070","0f5b76ef":"8298",b309b599:"8314",f159c6d5:"8348","161f5775":"8399","3e1d306d":"8419","935f2afb":"8581","1be78505":"8714","2cb0f3b9":"9322","4d838a35":"9633","2936ee19":"9863","2d141a6c":"9957"}[e]||e,r.p+r.u(e)},(()=>{var e={5354:0,1869:0};r.f.j=(a,d)=>{var f=r.o(e,a)?e[a]:void 0;if(0!==f)if(f)d.push(f[2]);else if(/^(1869|5354)$/.test(a))e[a]=0;else{var c=new Promise(((d,c)=>f=e[a]=[d,c]));d.push(f[2]=c);var b=r.p+r.u(a),t=new Error;r.l(b,(d=>{if(r.o(e,a)&&(0!==(f=e[a])&&(e[a]=void 0),f)){var c=d&&("load"===d.type?"missing":d.type),b=d&&d.target&&d.target.src;t.message="Loading chunk "+a+" failed.\n("+c+": "+b+")",t.name="ChunkLoadError",t.type=c,t.request=b,f[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,d)=>{var f,c,b=d[0],t=d[1],o=d[2],n=0;if(b.some((a=>0!==e[a]))){for(f in t)r.o(t,f)&&(r.m[f]=t[f]);if(o)var i=o(r)}for(a&&a(d);n{"use strict";var e,a,d,f,c,b={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var d=t[e]={exports:{}};return b[e].call(d.exports,d,d.exports,r),d.exports}r.m=b,e=[],r.O=(a,d,f,c)=>{if(!d){var b=1/0;for(i=0;i=c)&&Object.keys(r.O).every((e=>r.O[e](d[o])))?d.splice(o--,1):(t=!1,c0&&e[i-1][2]>c;i--)e[i]=e[i-1];e[i]=[d,f,c]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},d=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,f){if(1&f&&(e=this(e)),8&f)return e;if("object"==typeof e&&e){if(4&f&&e.__esModule)return e;if(16&f&&"function"==typeof e.then)return e}var c=Object.create(null);r.r(c);var b={};a=a||[null,d({}),d([]),d(d)];for(var t=2&f&&e;"object"==typeof t&&!~a.indexOf(t);t=d(t))Object.getOwnPropertyNames(t).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,r.d(c,b),c},r.d=(e,a)=>{for(var d in a)r.o(a,d)&&!r.o(e,d)&&Object.defineProperty(e,d,{enumerable:!0,get:a[d]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,d)=>(r.f[d](e,a),a)),[])),r.u=e=>"assets/js/"+({58:"b5c5dd86",906:"189aaee1",1032:"d7a9a298",1071:"bae90603",1156:"99d0c291",1195:"68225966",1535:"05791271",1578:"68805b82",1589:"50228cc7",1619:"19d631a3",1885:"dab818f4",2070:"34251a6c",2143:"c16916bd",2220:"729ab2a1",2278:"23374ca6",2339:"e2f3de81",2388:"02ff1c63",2441:"87a6d570",2634:"c4f5d8e4",2712:"27a03cad",2802:"fa4d91bf",2874:"de765383",3011:"12a68e96",3282:"64f36fa5",3306:"e6b8e746",3307:"5865895f",3355:"81699298",3737:"6668789f",3822:"8070e160",3826:"2e11adad",3837:"c40752a6",4117:"b9897a48",4187:"fbef1709",4218:"ae324a9f",4302:"9e89d62b",4423:"3095a365",4712:"f61d236c",5065:"3206a0f6",5146:"14bd523d",5166:"61118aa6",5396:"0b2050d0",5420:"f7acec0f",5524:"5dde19ad",5569:"1617ae38",5631:"2c3cf8c0",5793:"4f832294",5880:"d6d76602",5895:"c597ff39",5941:"7eb267a0",5965:"9bf41262",6097:"fdb8e513",6367:"f1e5cb15",6994:"eaa4a4c2",7105:"14e4e148",7318:"6ad39459",7455:"90a51507",7470:"6f42ab02",7533:"9ff4adb4",7545:"e6060a2b",7576:"6eaead5b",7683:"c331bc18",7858:"5056453c",8070:"0480b142",8298:"0f5b76ef",8314:"b309b599",8348:"f159c6d5",8399:"161f5775",8401:"17896441",8419:"3e1d306d",8581:"935f2afb",8714:"1be78505",9322:"2cb0f3b9",9633:"4d838a35",9863:"2936ee19",9957:"2d141a6c"}[e]||e)+"."+{58:"7bedbe66",842:"f6576b58",906:"34e2bf06",1032:"e1f349e9",1071:"a77b5ebc",1156:"66a1395b",1195:"1bd356b4",1535:"98a1c283",1578:"a06d7e7d",1589:"9a676a55",1619:"5b0e139e",1774:"ab875877",1885:"de5a696d",2070:"82e4c5a9",2143:"cbfe902a",2220:"bcc20529",2278:"dc44d444",2339:"d58ad3a2",2388:"944936b9",2441:"b2ddcda0",2634:"860991b2",2712:"246abd39",2802:"bd4f7023",2874:"74c776a2",3011:"50dedbfe",3282:"5922694c",3306:"d0ad3129",3307:"ec534582",3355:"61f87d21",3737:"4d819733",3822:"4175bfc9",3826:"ca4b3940",3837:"da9f8b77",4117:"63464ab6",4187:"7270cb39",4218:"284befc5",4220:"89659f15",4302:"eda7636d",4423:"1e75f8c7",4538:"e6c340b7",4712:"a8a0fe1f",5065:"3a42c562",5146:"302c0085",5166:"e0354ee5",5396:"3b366dd4",5420:"881def36",5524:"fd6834ef",5569:"0152eea7",5631:"394d84f2",5793:"cc86b4b3",5880:"41f18064",5895:"5daf2668",5941:"57382c79",5965:"28df0b7e",6097:"13f797fe",6367:"7f5b75a2",6994:"a0f4460e",7105:"7b19d3dc",7318:"bb54f8dd",7455:"ed7c8c95",7470:"2c6874fb",7533:"1ba998d8",7545:"218f88b4",7576:"81c7a040",7683:"c85aca2b",7858:"e7cf7967",8070:"aa079a4e",8298:"1ba8d011",8314:"3c824eb4",8348:"fbc325a0",8399:"1c0aeee1",8401:"b902181d",8419:"6eac75af",8581:"b9771ca0",8714:"590a5b3d",9322:"f9c5cc09",9633:"529323f1",9863:"9f602670",9957:"1a1e8fa4"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),f={},c="h3-website:",r.l=(e,a,d,b)=>{if(f[e])f[e].push(a);else{var t,o;if(void 0!==d)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var c=f[e];if(delete f[e],t.parentNode&&t.parentNode.removeChild(t),c&&c.forEach((e=>e(d))),a)return a(d)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/",r.gca=function(e){return e={17896441:"8401",68225966:"1195",81699298:"3355",b5c5dd86:"58","189aaee1":"906",d7a9a298:"1032",bae90603:"1071","99d0c291":"1156","05791271":"1535","68805b82":"1578","50228cc7":"1589","19d631a3":"1619",dab818f4:"1885","34251a6c":"2070",c16916bd:"2143","729ab2a1":"2220","23374ca6":"2278",e2f3de81:"2339","02ff1c63":"2388","87a6d570":"2441",c4f5d8e4:"2634","27a03cad":"2712",fa4d91bf:"2802",de765383:"2874","12a68e96":"3011","64f36fa5":"3282",e6b8e746:"3306","5865895f":"3307","6668789f":"3737","8070e160":"3822","2e11adad":"3826",c40752a6:"3837",b9897a48:"4117",fbef1709:"4187",ae324a9f:"4218","9e89d62b":"4302","3095a365":"4423",f61d236c:"4712","3206a0f6":"5065","14bd523d":"5146","61118aa6":"5166","0b2050d0":"5396",f7acec0f:"5420","5dde19ad":"5524","1617ae38":"5569","2c3cf8c0":"5631","4f832294":"5793",d6d76602:"5880",c597ff39:"5895","7eb267a0":"5941","9bf41262":"5965",fdb8e513:"6097",f1e5cb15:"6367",eaa4a4c2:"6994","14e4e148":"7105","6ad39459":"7318","90a51507":"7455","6f42ab02":"7470","9ff4adb4":"7533",e6060a2b:"7545","6eaead5b":"7576",c331bc18:"7683","5056453c":"7858","0480b142":"8070","0f5b76ef":"8298",b309b599:"8314",f159c6d5:"8348","161f5775":"8399","3e1d306d":"8419","935f2afb":"8581","1be78505":"8714","2cb0f3b9":"9322","4d838a35":"9633","2936ee19":"9863","2d141a6c":"9957"}[e]||e,r.p+r.u(e)},(()=>{var e={5354:0,1869:0};r.f.j=(a,d)=>{var f=r.o(e,a)?e[a]:void 0;if(0!==f)if(f)d.push(f[2]);else if(/^(1869|5354)$/.test(a))e[a]=0;else{var c=new Promise(((d,c)=>f=e[a]=[d,c]));d.push(f[2]=c);var b=r.p+r.u(a),t=new Error;r.l(b,(d=>{if(r.o(e,a)&&(0!==(f=e[a])&&(e[a]=void 0),f)){var c=d&&("load"===d.type?"missing":d.type),b=d&&d.target&&d.target.src;t.message="Loading chunk "+a+" failed.\n("+c+": "+b+")",t.name="ChunkLoadError",t.type=c,t.request=b,f[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,d)=>{var f,c,b=d[0],t=d[1],o=d[2],n=0;if(b.some((a=>0!==e[a]))){for(f in t)r.o(t,f)&&(r.m[f]=t[f]);if(o)var i=o(r)}for(a&&a(d);n Hierarchical grid functions | H3 - + @@ -158,7 +158,7 @@ } }
Result
Loading...

Uncompacts the set compactedSet of indexes to the resolution res. h3Set must be at least of size maxUncompactSize(compactedSet, numHexes, res).

Returns 0 on success.

maxUncompactSize

int maxUncompactSize(const H3Index *compactedSet, const int numHexes, const int res)

Returns the size of the array needed by uncompact.

- + \ No newline at end of file diff --git a/docs/3.x/api/indexing/index.html b/docs/3.x/api/indexing/index.html index 0197aeae5..273fb09b7 100644 --- a/docs/3.x/api/indexing/index.html +++ b/docs/3.x/api/indexing/index.html @@ -4,7 +4,7 @@ Indexing functions | H3 - + @@ -107,7 +107,7 @@
Result
Loading...

Finds the boundary of the cell. See the algorithm description for more information.

- + \ No newline at end of file diff --git a/docs/3.x/api/inspection/index.html b/docs/3.x/api/inspection/index.html index 47b6e19d0..959558677 100644 --- a/docs/3.x/api/inspection/index.html +++ b/docs/3.x/api/inspection/index.html @@ -4,7 +4,7 @@ Index inspection functions | H3 - + @@ -184,7 +184,7 @@ } }
Result
Loading...

Find all icosahedron faces intersected by a given H3 index and places them in the array out. out must be at least of length maxFaceCount(h).

Faces are represented as integers from 0-19, inclusive. The array is sparse, and empty (no intersection) array values are represented by -1.

maxFaceCount

int maxFaceCount(H3Index h3);

Returns the maximum number of icosahedron faces the given H3 index may intersect.

- + \ No newline at end of file diff --git a/docs/3.x/api/misc/index.html b/docs/3.x/api/misc/index.html index 08b7e89dd..913132ebe 100644 --- a/docs/3.x/api/misc/index.html +++ b/docs/3.x/api/misc/index.html @@ -4,7 +4,7 @@ Miscellaneous H3 functions | H3 - + @@ -511,7 +511,7 @@ }
Result
Loading...

Gives the "great circle" or "haversine" distance between pairs of GeoCoord points (lat/lng pairs) in radians.

- + \ No newline at end of file diff --git a/docs/3.x/api/regions/index.html b/docs/3.x/api/regions/index.html index 86e63e9a8..e08784418 100644 --- a/docs/3.x/api/regions/index.html +++ b/docs/3.x/api/regions/index.html @@ -4,7 +4,7 @@ Region functions | H3 - + @@ -87,7 +87,7 @@ or multiple resolutions are present, and the algorithm may produce unexpected or invalid output.

destroyLinkedPolygon

void destroyLinkedPolygon(LinkedGeoPolygon* polygon);

Free all allocated memory for a linked geo structure. The caller is responsible for freeing memory allocated to the input polygon struct.

- + \ No newline at end of file diff --git a/docs/3.x/api/traversal/index.html b/docs/3.x/api/traversal/index.html index 3348f3fb2..afba4a87a 100644 --- a/docs/3.x/api/traversal/index.html +++ b/docs/3.x/api/traversal/index.html @@ -4,7 +4,7 @@ Grid traversal functions | H3 - + @@ -249,7 +249,7 @@ }
Result
Loading...

Produces an H3 index from local IJ coordinates anchored by an origin.

This function is experimental, and its output is not guaranteed to be compatible across different versions of H3.

- + \ No newline at end of file diff --git a/docs/3.x/api/uniedge/index.html b/docs/3.x/api/uniedge/index.html index 6a44ce717..6dcb7e6c3 100644 --- a/docs/3.x/api/uniedge/index.html +++ b/docs/3.x/api/uniedge/index.html @@ -4,7 +4,7 @@ Unidirectional edge functions | H3 - + @@ -247,7 +247,7 @@ } }
Result
Loading...

Provides the coordinates defining the unidirectional edge.

- + \ No newline at end of file diff --git a/docs/3.x/community/applications/index.html b/docs/3.x/community/applications/index.html index 701f147fe..dd4925d7c 100644 --- a/docs/3.x/community/applications/index.html +++ b/docs/3.x/community/applications/index.html @@ -4,13 +4,13 @@ Applications Using H3 | H3 - +
Version: 3.x

Applications Using H3

The following applications use H3. Contributions to this list are welcome, please feel free to open a pull request.

Visualization

  • kepler.gl - An open source geospatial analysis tool
  • pydeck - High-scale spatial rendering in Python, powered by deck.gl
- + \ No newline at end of file diff --git a/docs/3.x/community/bindings/index.html b/docs/3.x/community/bindings/index.html index 95529bd70..a66f56cd3 100644 --- a/docs/3.x/community/bindings/index.html +++ b/docs/3.x/community/bindings/index.html @@ -4,13 +4,13 @@ Bindings | H3 - +
Version: 3.x
- + \ No newline at end of file diff --git a/docs/3.x/community/libraries/index.html b/docs/3.x/community/libraries/index.html index ee50f7dd7..4b3d823af 100644 --- a/docs/3.x/community/libraries/index.html +++ b/docs/3.x/community/libraries/index.html @@ -4,13 +4,13 @@ Libraries Using H3 | H3 - +
Version: 3.x

Libraries Using H3

The following libraries use H3 via one of its bindings. Contributions to this list are welcome, please feel free to open a pull request.

JavaScript

Python

Rust

  • nmandery/h3ron - Raster to H3 conversion, smoothing of linked polygons.
- + \ No newline at end of file diff --git a/docs/3.x/community/tutorials/index.html b/docs/3.x/community/tutorials/index.html index ccddba5ab..1f9d13875 100644 --- a/docs/3.x/community/tutorials/index.html +++ b/docs/3.x/community/tutorials/index.html @@ -4,13 +4,13 @@ Learning Resources | H3 - +
Version: 3.x

Learning Resources

This page lists further learning materials and code walkthroughs for the H3 library and bindings. Contributions to this list are welcome, please feel free to open a pull request.

Community

Videos

Java

  • H3 Measurements: Measurements of average cell area, average cell perimeter length, truncation error, and so on.

JavaScript

Python

- + \ No newline at end of file diff --git a/docs/3.x/comparisons/admin/index.html b/docs/3.x/comparisons/admin/index.html index 741244a0e..499c5c6cf 100644 --- a/docs/3.x/comparisons/admin/index.html +++ b/docs/3.x/comparisons/admin/index.html @@ -4,13 +4,13 @@ Admin Boundaries | H3 - +
Version: 3.x

Admin Boundaries

Administrative boundaries, such as ZIP Codes and Census Blocks in the United States, can be used for aggregating and analyzing data. These boundaries have a number of drawbacks for aggregating data. These are primarily related to not having a comparable spatial unit of analysis, being unable to spatially relate data, and being unrelated to the data being analyzed.

ZIP Codes

The article Stop Using Zip Codes for Geospatial Analysis summarizes a number of problems with using ZIP Codes. In short, ZIP Codes do not represent areas themselves but rather mail delivery routes. They also vary greatly in spatial size when rendered as ZIP Code Tabulation Areas and change for unrelated reasons.

Use case specific partitioning

When using manually drawn partitions, there is usually no spatial unit of analysis which can be compared. Edges of partitions may exhibit boundary effects due to not taking into account neighboring partitions.

Manually drawn partitions can better incorporate human knowledge, but can require updating as that knowledge changes. It can take a significant amount of time and effort to define and update partitions manually.

The varying size of partitions means the center of a partition may be unrelated to the center of the data points.

ZIP Codes vs H3 comparison

ZIP Codes on the left, H3 on the right. Data: New York City 2015 Street Tree Census

- + \ No newline at end of file diff --git a/docs/3.x/comparisons/geohash/index.html b/docs/3.x/comparisons/geohash/index.html index d12b57810..1b701f7e0 100644 --- a/docs/3.x/comparisons/geohash/index.html +++ b/docs/3.x/comparisons/geohash/index.html @@ -4,13 +4,13 @@ Geohash | H3 - +
Version: 3.x

Geohash

Geohash is a system for encoding locations using a string of characters, creating a hierarchical, square grid system (a quadtree).

Area distortion

Because Geohash encodes latitude and longitudes pairs, it is subject to significant differences in area at different latitudes. A degree of longitude near a pole represents a significantly smaller distance than a degree of longitude near the equator.

Identifiers

Geohash uses strings for its cell indexes. Because they are strings, they can encode arbitrarily precise cells.

H3 cell indexes are designed to be 64 bit integers, which can be rendered and transmitted as strings if needed. The integer representation can be used when high performance is needed, as integer operations are usually more performant than string operations. Because indexes are fixed size, H3 has a maximum resolution it can encode.

Geohash vs H3 Comparison

Geohash on the left, H3 on the right. Data: San Francisco Street Tree List

- + \ No newline at end of file diff --git a/docs/3.x/comparisons/hexbin/index.html b/docs/3.x/comparisons/hexbin/index.html index 9c15b2fc1..0336b59ad 100644 --- a/docs/3.x/comparisons/hexbin/index.html +++ b/docs/3.x/comparisons/hexbin/index.html @@ -4,13 +4,13 @@ Hexbin | H3 - +
Version: 3.x

Hexbin

Hexbinning is the process of taking coordinates and binning them into hexagonal cells in analytics or mapping software. The size of the hexagons is configurable, and the hexagons can align with the map projection being used.

Hexbins are generally very computationally cheap to create, and for the best performance can be computed directly on a GPU. Their coordinates, while not hierarchical, support many common operations like finding neighbors and grid distances very efficiently.

Hexbins have drawbacks in the ability to reuse the grids. The cell identifiers they use are only useful in the specific hexbin grid, and are not portable to another grid, limiting their ability to be used for joining datasets. The cell identifiers are not hierarchical, so relating data at different grid resolutions can be difficult.

Hexbins are also limited by the projection system they are created on top of. This usually results in discontinuities at the edges of the projections, for example at the anti-meridian or at the poles.

Hexbin vs H3 Comparison

Hexbins on the left, H3 on the right. Data: San Francisco Street Tree List

- + \ No newline at end of file diff --git a/docs/3.x/comparisons/placekey/index.html b/docs/3.x/comparisons/placekey/index.html index f3d854424..484f40733 100644 --- a/docs/3.x/comparisons/placekey/index.html +++ b/docs/3.x/comparisons/placekey/index.html @@ -4,13 +4,13 @@ Placekey | H3 - +
Version: 3.x

Placekey

Placekey is a system for encoding points of interest (POIs), and incorporates H3 in its POI identifier.

For example, the Placekey for the Ferry Building in San Francisco, zzw-22y@5vg-7gt-qzz, contains a What Part (zzw-22y) encoding a specific POI, and a Where Part (5vg-7gt-qzz) encoding where that POI is. The Where Part is an H3 cell index at resolution 10, using an alternate string encoding. The example Where Part represents the H3 index 8a283082a677fff. Placekey Where Parts can be losslessly converted to and from their equivalent H3 indexes.

- + \ No newline at end of file diff --git a/docs/3.x/comparisons/s2/index.html b/docs/3.x/comparisons/s2/index.html index 8d1570ba3..35ae9d8ac 100644 --- a/docs/3.x/comparisons/s2/index.html +++ b/docs/3.x/comparisons/s2/index.html @@ -4,13 +4,13 @@ S2 | H3 - +
Version: 3.x

S2

S2, like H3, implements an open source, hierarchical, discrete, and global grid system. The systems share a number of similarities, including the use of 64 bit integers as cell indexes, making it very efficient to use both of them in big data systems.

One of the main differences between S2 and H3 is the choice of cell shape. S2 uses square cells while H3 uses hexagonal cells. This leads to important differences in neighbors, subdivision, and visualization.

Neighbors

Squares have two classes of neighbors: those that they share an edge with, and those that they share a point with. This can complicate analysis of moving things in the real world, because they are very unlikely to move in a way aligned with the grid. Instead, the analyst will need to account for different types of neighbors.

Hexagons have only one class of neighbor, that they share an edge with. This makes running convolutions and smoothing over the data much simpler, since only the grid distance (as opposed to the geographic distance) from a cell needs to be considered.

Subdivision

S2 uses an aperture 4 system where each cell is subdivided into 4 finer, child cells. Squares subdivide exactly into 4 child squares. This means that when indexing a point to an S2 cell, and then truncating to the parent S2 cell, there is no possibility that the point is not contained in the bounds of the parent cell.

This differs from H3 where the same operation is approximate. This is the case because hexagons do not exactly subdivide into 7 child hexagons.

Visualization

S2 cells are squares in the system's projection. When those cells are visualized on a map using a projection like the Web Mercator projection, the cells can subjectively appear distorted (i.e. as a quadrilateral rather than square).

H3 cells have the same non-alignment with the map projection, but in our experience the effect is less noticeable to viewers for hexagons.

S2 vs H3 Comparison

S2 on the left, H3 on the right. Data: San Francisco Street Tree List

- + \ No newline at end of file diff --git a/docs/3.x/core-library/coordsystems/index.html b/docs/3.x/core-library/coordsystems/index.html index 53cd2a6f0..0cca5d901 100644 --- a/docs/3.x/core-library/coordsystems/index.html +++ b/docs/3.x/core-library/coordsystems/index.html @@ -4,13 +4,13 @@ Coordinate systems | H3 - +
Version: 3.x

Coordinate systems

The H3 Core Library uses the following coordinate systems internally.

IJK Coordinates

Discrete hexagon planar grid systems naturally have 3 coordinate axes spaced 120° apart. We refer to such a system as an ijk coordinate system, for the three coordinate axes i, j, and k. A single ijk coordinate triplet is represented in the H3 Core Library using the structure type CoordIJK.

Using an ijk coordinate system to address hexagon grid cells provides multiple valid addresses for each cell. Normalizing an ijk address (function _ijkNormalize) creates a unique address consisting of the minimal positive ijk components; this always results in at most two non-zero components.

FaceIJK Coordinates

The H3 Core Library centers an ijk coordinate system on each face of the icosahedron; the combination of a face number and ijk coordinates on that face's coordinate system is represented using the structure type FaceIJK.

Each grid resolution is rotated ~19.1° relative to the next coarser resolution. The rotation alternates between counterclockwise and clockwise at each successive resolution, so that each resolution will have one of two possible orientations: Class II or Class III (using a terminology coined by R. Buckminster Fuller). The base cells, which make up resolution 0, are Class II.

Hex2d Coordinates

A Hex2d coordinate system is a cartesian coordinate system associated with a specific ijk coordinate system, where:

  • the origin of the Hex2d system is centered on the origin cell of the ijk system,
  • the positive x-axis of the Hex2d system is aligned with the i-axis of the ijk system, and
  • 1.0 unit distance in the Hex2d system is the distance between adjacent cell centers in the ijk coordinate system.

Hex2d coordinates are represented using the structure type Vec2d.

Local IJ Coordinates

Algorithms working with hexagons may want to refer to grid coordinates that are not interrupted by base cells or faces. These coordinates have 2 coordinate axes spaced 120° apart, with the coordinates anchored by an origin H3 index.

  • local coordinates are only comparable when they have the same origin index.
  • local coordinates are only valid near the origin. Pratically, this is within the same base cell or a neighboring base cell, except for pentagons.
  • the coordinate space may have deleted or warped regions due to pentagon distortion.
  • there may be multiple coordinates for the same index, with the same origin.
  • the origin may not be at (0, 0) in the local coordinate space.

Local IJ coordinates are represented using the structure type CoordIJ and an associated origin H3Index.

- + \ No newline at end of file diff --git a/docs/3.x/core-library/creating-bindings/index.html b/docs/3.x/core-library/creating-bindings/index.html index fed65baad..bced6ea06 100644 --- a/docs/3.x/core-library/creating-bindings/index.html +++ b/docs/3.x/core-library/creating-bindings/index.html @@ -4,13 +4,13 @@ Creating bindings for H3 | H3 - +
Version: 3.x

Creating bindings for H3

H3 is a C library, in part to make it simpler to create bindings for different programming languages. Each language usually has its own way to bind to C functions, but this document can serve as a starting point and list of tips.

There may already be H3 bindings available for your language of choice.

Function naming

The make binding-functions target produces a file binding-functions containing a list of function in the H3 public API, one per line. You can use this as part of your build process to check how much of the H3 public API your bindings expose. This list does not include memory management functions that are needed to allocate arrays to be passed to the H3 API.

Keeping similar names and purposes for functions can make it easier for your users to use the H3 API Reference.

Community

When ready, make a pull request to add your binding to the H3 documentation website.

Documentation

To be included in the H3 API reference, your binding should:

  • Be reasonably up to date with uber/h3.
  • Include bindings for the relevant functions in the output of make binding-functions. For example, stringToH3 may not be necessary if your bindings only supports string H3 indexes.
  • Use the major and minor version of the version of H3 bound. For example, when binding H3 version 3.2.1, a valid binding version would be 3.2.0, but 4.2.1 would not be valid.
- + \ No newline at end of file diff --git a/docs/3.x/core-library/custom-alloc/index.html b/docs/3.x/core-library/custom-alloc/index.html index 61239b0b0..f1cc3a031 100644 --- a/docs/3.x/core-library/custom-alloc/index.html +++ b/docs/3.x/core-library/custom-alloc/index.html @@ -4,13 +4,13 @@ Memory allocation | H3 - +
Version: 3.x

Memory allocation

H3's approach to memory management is to rely on memory allocated by the caller as much as possible. This allows memory to be managed by an external framework.

In some cases (for example, polyfill), H3 allocates heap memory. When this is needed, it uses the standard C memory allocation functions.

Custom Memory Allocators

caution

On some systems, such as Windows, the undefined symbols cannot be undefined at build time. Further changes to the H3 build are needed to provide custom implementations.

caution

There are a few algorithms like kRing that still use the call stack to recurse and could run out of memory that way.

H3 supports replacing the memory management functions (malloc, calloc, realloc, free) used by the library at build time. This can be used to integrate H3 within a managed framework.

When using custom memory allocators, H3 prefixes the names of memory allocation functions with the string you specify. The application linking H3 must have the prefixed replacement functions defined, or you must change the H3 build to link against the prefixed replacement functions.

When building H3, specify the H3_ALLOC_PREFIX option to your prefix of choice, as below:

cmake -DH3_ALLOC_PREFIX=my_prefix_ .

Then, in your application using H3, implement the following functions, replacing my_prefix_ with the prefix you chose above:

void* my_prefix_malloc(size_t size);
void* my_prefix_calloc(size_t num, size_t size);
void* my_prefix_realloc(void* ptr, size_t size);
void my_prefix_free(void* ptr);
info

H3 does not currently use realloc.

Link to H3 as you would have without the custom allocators. The custom allocators will be used for allocating heap memory in H3.

- + \ No newline at end of file diff --git a/docs/3.x/core-library/filters/index.html b/docs/3.x/core-library/filters/index.html index b74726f13..f49087365 100644 --- a/docs/3.x/core-library/filters/index.html +++ b/docs/3.x/core-library/filters/index.html @@ -4,13 +4,13 @@ Unix-style Filters for H3 | H3 - +
Version: 3.x

Unix-style Filters for H3

The directory src/apps/filters contains unix-style stdin/stdout filters that perform conversions between integer H3 indexes and other useful types. It currently contains the filters listed in the table below. See the header comments in each application source code file for more information.

Filters are experimental and are not part of the semantic version of the H3 library.

All latitude/longitude coordinates are in decimal degrees. See the H3 Index Representations page for information on the integer H3Index.

filterinputoutputs
geoToH3lat/lonH3Index
h3ToGeoH3Indexcell center point in lat/lon
h3ToGeoBoundaryH3Indexcell boundary in lat/lon
h3ToComponentsH3Indexcomponents
kRingH3Indexsurrounding H3Index
hexRangeH3Indexsurrounding H3Index, in order

Unix Command Line Examples

  • find the index for coordinates at resolution 5

    geoToH3 --resolution 5 --latitude 40.689167 --longitude -74.044444

  • output the cell center point for H3Index 845ad1bffffffff

    h3ToGeo --index 845ad1bffffffff

  • output the cell boundary for H3Index 845ad1bffffffff

    h3ToGeoBoundary --index 845ad1bffffffff

  • find the components for the H3Index 845ad1bffffffff

    h3ToComponents --index 845ad1bffffffff

  • output all indexes within distance 1 of the H3Index 845ad1bffffffff

    kRing -k 1 --origin 845ad1bffffffff

  • output all hexagon indexes within distance 2 of the H3Index 845ad1bffffffff

    hexRange -k 2 --origin 845ad1bffffffff

Note that the filters h3ToGeo and h3ToGeoBoundary take optional arguments that allow them to generate kml output. See the header comments in the corresponding source code files for details.

- + \ No newline at end of file diff --git a/docs/3.x/core-library/geoToH3desc/index.html b/docs/3.x/core-library/geoToH3desc/index.html index 0c086c1fc..e46caf72a 100644 --- a/docs/3.x/core-library/geoToH3desc/index.html +++ b/docs/3.x/core-library/geoToH3desc/index.html @@ -4,13 +4,13 @@ Conversion from latitude/longitude to containing H3 cell index | H3 - +
Version: 3.x

Conversion from latitude/longitude to containing H3 cell index

This operation is performed by function geoToH3. See the comments in the function for more detail.

The conversion is performed as a series of coordinate system conversions described below. See the page Coordinate Systems used by the H3 Core Library for more information on each of these coordinate systems.

  1. The input latitude/longitude coordinate is first converted into the containing icosahedron face and a Hex2d coordinate on that face using function _geoToHex2d, which determines the correct face and then performs a face-centered gnomonic projection into face-centered polar coordinates. These polar coordinates are then scaled appropriately to a Hex2d coordinate on the input grid resolution r.

  2. The Hex2d coordinate is converted into resolution r normalized ijk coordinates using function _hex2dToCoordIJK.

  3. The face and face-centered ijk coordinates are then converted into an H3Index representation using the following steps:

    • the H3 index digits are calculated from resolution r up to 0, adjusting the ijk coordinates at each successively coarser resolution.
    • when resolution 0 is reached, if the remaining ijk coordinates are (0,0,0) then the base cell centered on the face is chosen for the index
    • if the remaining resolution 0 ijk coordinates are not (0,0,0), then a lookup operation is performed to find the appropriate base cell and the required rotation (if any) to orient the cell in that base cell's coordinate system. The index is then translated and rotated into the coordinate system centered on the new base cell.
- + \ No newline at end of file diff --git a/docs/3.x/core-library/h3Indexing/index.html b/docs/3.x/core-library/h3Indexing/index.html index da16dce6b..df2bf0dd9 100644 --- a/docs/3.x/core-library/h3Indexing/index.html +++ b/docs/3.x/core-library/h3Indexing/index.html @@ -4,7 +4,7 @@ H3 Index Representations | H3 - + @@ -13,7 +13,7 @@ This index indicates, specifically, an invalid, missing, or uninitialized H3 index; it is analogous to NaN in floating point. It should be used instead of an arbitrary Mode 0 index, due to its uniqueness and easy identifiability.

H3 Cell Index

An H3 Cell index (mode 1) represents a cell (hexagon or pentagon) in the H3 grid system at a particular resolution. The components of the H3 Cell index are packed into a 64-bit integer in order, highest bit first, as follows:

  • 1 bit reserved and set to 0,
  • 4 bits to indicate the H3 Cell index mode,
  • 3 bits reserved and set to 0,
  • 4 bits to indicate the cell resolution 0-15,
  • 7 bits to indicate the base cell 0-121,
  • 3 bits to indicate each subsequent digit 0-6 from resolution 1 up to the resolution of the cell (45 bits total are reserved for resolutions 1-15)

The three bits for each unused digit are set to 7.

H3 Unidirectional Edge Index

An H3 Unidirectional Edge index (mode 2) represents a single directed edge between two cells (an "origin" cell and a neighboring "destination" cell). The components of the H3 Unidirectional Edge index are packed into a 64-bit integer in order, highest bit first, as follows:

  • 1 bit reserved and set to 0,
  • 4 bits to indicate the H3 Unidirectional Edge index mode,
  • 3 bits to indicate the edge (1-6) of the origin cell,
  • Subsequent bits matching the index bits of the origin cell.

H3 Vertex Index

An H3 Vertex index (mode 4) represents a single topological vertex in H3 grid system, shared by three cells. Note that this does not include the distortion vertexes occasionally present in a cell's geo boundary. An H3 Vertex is arbitrarily assigned one of the three neighboring cells as its "owner", which is used to calculate the canonical index and geo coordinate for the vertex. The components of the H3 Vertex index are packed into a 64-bit integer in order, highest bit first, as follows:

  • 1 bit reserved and set to 0,
  • 4 bits to indicate the H3 Vertex index mode,
  • 3 bits to indicate the vertex number (0-5) of vertex on the owner cell,
  • Subsequent bits matching the index bits of the owner cell.

Bit layout of H3Index

The layout of an H3Index is shown below in table form. The interpretation of the "Reserved" field differs depending on the mode of the index.

0x0F0x0E0x0D0x0C0x0B0x0A0x090x080x070x060x050x040x030x020x010x00
0x30ReservedModeMode-DependentResolutionBase cell
0x20Base cellDigit 1Digit 2Digit 3Digit 4Digit 5
0x10Digit 5Digit 6Digit 7Digit 8Digit 9Digit 10
0x00Digit 10Digit 11Digit 12Digit 13Digit 14Digit 15
- + \ No newline at end of file diff --git a/docs/3.x/core-library/h3ToGeoBoundaryDesc/index.html b/docs/3.x/core-library/h3ToGeoBoundaryDesc/index.html index ce259fe2e..330a54720 100644 --- a/docs/3.x/core-library/h3ToGeoBoundaryDesc/index.html +++ b/docs/3.x/core-library/h3ToGeoBoundaryDesc/index.html @@ -4,13 +4,13 @@ Generate the cell boundary in latitude/longitude coordinates of an H3Index cell | H3 - +
Version: 3.x

Generate the cell boundary in latitude/longitude coordinates of an H3Index cell

This operation is performed by function h3ToGeoBoundary. See the comments in the function source code for more detail.

The conversion is performed as a series of coordinate system conversions described below. See the page Coordinate Systems used by the H3 Core Library for more information on each of these coordinate systems.

  • We note that the cell vertices are the center points of cells in an aperture 3 grid one resolution finer than the cell resolution, which we term a substrate grid. We precalculate the substrate ijk coordinates of a cell with ijk coordinates (0,0,0), adding additional aperture 3 and aperture 7 (if required, by Class III cell grid) substrate grid resolutions as required to transform the vertex coordinates into a Class II substrate grid.
  • The function _faceIjkToGeoBoundary calculates the ijk coordinates of the cell center point in the appropriate substrate grid (determined in the last step), and each of the substrate vertices is translated using the cell center point ijk. Each vertex ijk is then transformed onto the appropriate face and Hex2d coordinate system using the approach taken in finding a cell center point. If adjacent vertices lie on different icosahedron faces a point is introduced at the intersection of the cell edge and icosahedron face edge.
  • The Hex2d coordinates are then converted to latitude/longitude using _hex2dToGeo.
- + \ No newline at end of file diff --git a/docs/3.x/core-library/h3ToGeoDesc/index.html b/docs/3.x/core-library/h3ToGeoDesc/index.html index b9b74eaab..637409c5a 100644 --- a/docs/3.x/core-library/h3ToGeoDesc/index.html +++ b/docs/3.x/core-library/h3ToGeoDesc/index.html @@ -4,14 +4,14 @@ Determine the latitude/longitude coordinates of the center point of an H3Index cell | H3 - +
Version: 3.x

Determine the latitude/longitude coordinates of the center point of an H3Index cell

This operation is performed by function h3ToGeo. See the comments in the function source code for more detail.

The conversion is performed as a series of coordinate system conversions described below. See the page Coordinate Systems used by the H3 Core Library for more information on each of these coordinate systems.

  • The function _h3ToFaceIjk then converts the H3 index to the appropriate icosahedron face number and normalized ijk coordinate's on that face's coordinate system as follows:
    • We start by assuming that the cell center point falls on the same icosahedron face as its base cell.
    • It is possible that the cell center point lies on an adjacent face (termed an overage in the code), in which case we would need to use a projection centered on that adjacent face instead. We recall that normalized 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. We determine whether an overage exists by taking the sum of the ijk components, and if there is an overage the positive 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 ijk coordinates into the adjacent face-centered ijk system.
  • The face-centered ijk coordinates are then converted into corresponding Hex2d coordinates using the function _ijkToHex2d.
  • The function _hex2dToGeo takes the Hex2d coordinates and scales them into face-centered gnomonic coordinates, and then performs an inverse gnomonic projection to get the latitude/longitude coordinates.
- + \ No newline at end of file diff --git a/docs/3.x/core-library/overview/index.html b/docs/3.x/core-library/overview/index.html index 098fe440d..10dd00c7d 100644 --- a/docs/3.x/core-library/overview/index.html +++ b/docs/3.x/core-library/overview/index.html @@ -4,13 +4,13 @@ Overview of the H3 Geospatial Indexing System | H3 - +
Version: 3.x

Overview of the H3 Geospatial Indexing System

The H3 geospatial indexing system is a discrete global grid system (see Sahr et al., 2003) consisting of a multi-precision hexagonal tiling of the sphere with hierarchical indexes.

The hexagonal grid system is created on the planar faces of a sphere-circumscribed icosahedron, and the grid cells are then projected to the surface of the sphere using an inverse face-centered polyhedral gnomonic projection. The coordinate reference system (CRS) is spherical coordinates with the WGS84/EPSG:4326 authalic radius. It is common to use WGS84 CRS data with the H3 library.

The icosahedron is fixed relative to the sphere using a Dymaxion orientation (due to R. Buckminster Fuller). This orientation of a spherical icosahedron places all 12 icosahedron vertices in the ocean. (At the time of H3's development, this was the only known orientation with this property. Others have since been found.)

The H3 grid is constructed on the icosahedron by recursively creating increasingly higher precision hexagon grids until the desired resolution is achieved. Note that it is impossible to tile the sphere/icosahedron completely with hexagons; each resolution of an icosahedral hexagon grid must contain exactly 12 pentagons at every resolution, with one pentagon centered on each of the icosahedron vertices.

The first H3 resolution (resolution 0) consists of 122 cells (110 hexagons and 12 icosahedron vertex-centered pentagons), referred to as the base cells. These were chosen to capture as much of the symmetry of the spherical icosahedron as possible. These base cells are assigned numbers from 0 to 121 based on the latitude of their center points; base cell 0 has the northern most center point, while base cell 121 has the southern most center point.

Each subsequent resolution beyond resolution 0 is created using an aperture 7 resolution spacing (aperture refers to the number of cells in the next finer resolution grid for each cell); as resolution increases the unit length is scaled by sqrt(7) and each hexagon has 1/7th the area of a hexagon at the next coarser resolution (as measured on the icosahedron). H3 provides 15 finer grid resolutions in addition to the resolution 0 base cells. The finest resolution, resolution 15, has cells with an area of less than 1 m2. A table detailing the average cell area for each H3 resolution is available here.

Note: you can create KML files to visualize the H3 grids by running the kml make target. It will place the files in the KML output sub-directory.

- + \ No newline at end of file diff --git a/docs/3.x/core-library/restable/index.html b/docs/3.x/core-library/restable/index.html index 6d460f6ee..d052f38d9 100644 --- a/docs/3.x/core-library/restable/index.html +++ b/docs/3.x/core-library/restable/index.html @@ -4,13 +4,13 @@ Table of Cell Areas for H3 Resolutions | H3 - +
Version: 3.x

Table of Cell Areas for H3 Resolutions

H3 ResolutionAverage Hexagon Area (km2)Average Hexagon Edge Length (km)Number of unique indexes
04,250,546.84770001,107.712591000122
1607,220.9782429418.676005500842
286,745.8540347158.2446558005,882
312,392.264862159.81085794041,162
41,770.323551722.606379400288,122
5252.90336458.5444082762,016,842
636.12905213.22948277214,117,882
75.16129321.22062975998,825,162
80.73732760.461354684691,776,122
90.10533250.1743756684,842,432,842
100.01504750.06590780733,897,029,882
110.00214960.024910561237,279,209,162
120.00030710.0094155261,660,954,464,122
130.00004390.00355989311,626,681,248,842
140.00000630.00134857581,386,768,741,882
150.00000090.000509713569,707,381,193,162
- + \ No newline at end of file diff --git a/docs/3.x/core-library/usage/index.html b/docs/3.x/core-library/usage/index.html index 2641511c7..fe5e3267c 100644 --- a/docs/3.x/core-library/usage/index.html +++ b/docs/3.x/core-library/usage/index.html @@ -4,13 +4,13 @@ Public API | H3 - +
Version: 3.x

Public API

API Versioning

The public API of the H3 Core Library is defined in the file h3api.h. The functions defined in h3api.h adhere to Semantic Versioning.

API Preconditions

The H3 API expects valid input. Behavior of the library may be undefined when given invalid input. Indexes should be validated with h3IsValid or h3UnidirectionalEdgeIsValid as appropriate.

- + \ No newline at end of file diff --git a/docs/3.x/faq/index.html b/docs/3.x/faq/index.html index 8937db39a..a3ac50a1b 100644 --- a/docs/3.x/faq/index.html +++ b/docs/3.x/faq/index.html @@ -4,13 +4,13 @@ Frequently Asked Questions | H3 - +
- + \ No newline at end of file diff --git a/docs/3.x/highlights/aggregation/index.html b/docs/3.x/highlights/aggregation/index.html index 2a17f1006..e070379ed 100644 --- a/docs/3.x/highlights/aggregation/index.html +++ b/docs/3.x/highlights/aggregation/index.html @@ -4,13 +4,13 @@ Aggregation | H3 - +
Version: 3.x

Aggregation

Analysis of location data, such as locations of cars in a city, can be done by bucketing locations. (Sahr et al., 2003) Using a regular grid provides smooth gradients and the ability to measure differences between cells.

The cell shape of that grid system is an important consideration. For simplicity, it should be a polygon that tiles regularly: the triangle, the square, or the hexagon. Of these, triangles and squares have neighbors with different distances. Triangles have three different distances, and squares have two different distances. For hexagons, all neighbors are equidistant.

TriangleSquareHexagon
Triangles have 12 neighborsSquares have 8 neighborsHexagons have 6 neighbors

This property allows for simpler analysis of movement. Hexagons have the property of expanding rings of neighbors approximating circles:


All six neighbors of a hexagon (ring 1)

Hexagons are also optimally space-filling. On average, a polygon may be filled with hexagon tiles with a smaller margin of error than would be present with square tiles.

References

- + \ No newline at end of file diff --git a/docs/3.x/highlights/flowmodel/index.html b/docs/3.x/highlights/flowmodel/index.html index e2eab53a7..6c44b2373 100644 --- a/docs/3.x/highlights/flowmodel/index.html +++ b/docs/3.x/highlights/flowmodel/index.html @@ -4,13 +4,13 @@ Flow Modelling | H3 - +
Version: 3.x

Flow Modelling

H3's hexagonal grid is well suited to analyzing movement. In addition to the benefits of the hexagonal grid shape, H3 includes other features for modelling flow.

H3 can create indexes that refer to the movement from one cell to a neighbor. These directed edge indexes share the advantages with their cell index counterparts, such as being 64 bit integers. The use of directed edges makes it possible to associate a weight with a movement in the grid.

(A planned improvement for the H3 system is to create indexes that refer to the edge between two cells without regards of direction.)

- + \ No newline at end of file diff --git a/docs/3.x/highlights/indexing/index.html b/docs/3.x/highlights/indexing/index.html index 2bb904f65..5714c0bcc 100644 --- a/docs/3.x/highlights/indexing/index.html +++ b/docs/3.x/highlights/indexing/index.html @@ -4,13 +4,13 @@ Indexing | H3 - +
Version: 3.x

Indexing

H3 is a hierarchical geospatial index. H3 indexes refer to cells by the spatial hierarchy. Every hexagonal cell, up to the maximum resolution supported by H3, has seven child cells below it in this hierarchy. This subdivision is referred to as aperture 7.


A parent hexagon approximately contains seven children

Hexagons do not cleanly subdivide into seven finer hexagons. However, by alternating the orientation of grids a subdivision into seven cells can be approximated. This makes it possible to truncate the precision within a fixed margin of error of an H3 index. It is also possible to determine all the children of a parent H3 index.

Approximate containment only applies when truncating the precision of an H3 index. The borders of hexagons indexed at a specific resolution are not approximate and not affected by these considerations. For example, indexing points to cells at a certain resolution and finding those cell's neighbors is not affected by approximate containment.

While geographic containment is approximate, logical containment in the index is exact. It is possible to use H3 as an exact logical index on top of data indexed at a specific resolution.

This approximation allows for efficiently relating datasets indexed at different resolutions of the H3 grid. The functions for changing precision (h3ToParent, h3ToChildren) are implemented with only a few bitwise operations, making them very fast. The structure of the H3 index means that geographically close locations will tend to have numerically close indexes.

The hierarchical structure can also be used in analysis, when the precision or uncertainty for a location needs to be encoded in the spatial index. For example, a point from a GPS receiver could be indexed at a coarser resolution when the precision of the signal is lower, or some cells could be aggregated to a parent cell when there are too few data points in each of the finer cells.

Hierarchical containment allows for use cases like making contiguous sets of cells "compact" with compactCells. It is then possible to uncompactCells to the same input set of cells, or to test whether a cell is contained by the compact set.

Uncompacted (dense)Compacted (sparse)
California represented by 10633 uncompacted cellsCalifornia represented by 901 compacted cells

In use cases where exact boundaries are needed applications must take care to handle the hierarchical concerns. This can be done by taking care to use the hierarchy as a logical one rather than geographic. Another useful approach is using the grid system as an optimization in addition to a more precise point-in-polygon check.

- + \ No newline at end of file diff --git a/docs/3.x/highlights/joining/index.html b/docs/3.x/highlights/joining/index.html index a5faa8b5e..740e12046 100644 --- a/docs/3.x/highlights/joining/index.html +++ b/docs/3.x/highlights/joining/index.html @@ -4,13 +4,13 @@ Joining | H3 - +
Version: 3.x

Joining

H3, acting as a standard unit of analysis, can be used to join disparate data sets.

The H3 library contains support for indexing points, lines, and regions into the grid. Other data formats, such as rasters, can be indexed into H3 using combinations of these basic indexing operations. Once data is indexed into H3 indexes, it can be easily joined with other datasets on the H3 index.

References

- + \ No newline at end of file diff --git a/docs/3.x/highlights/ml/index.html b/docs/3.x/highlights/ml/index.html index 067bd4171..5b33a0461 100644 --- a/docs/3.x/highlights/ml/index.html +++ b/docs/3.x/highlights/ml/index.html @@ -4,13 +4,13 @@ Machine Learning | H3 - +
Version: 3.x

Machine Learning

H3 is well suited to applying machine learning to geospatial data. Techniques from computer vision, such as convolution, can be applied to the pixel grid defined by H3.

H3 has functions for finding neighbors (kRing) for use in performing convolution, and functions for transforming indexes to a two dimensional IJ coordinate space on which other computer vision algorithms can be run.

- + \ No newline at end of file diff --git a/docs/3.x/index.html b/docs/3.x/index.html index 97e528be5..084bd516e 100644 --- a/docs/3.x/index.html +++ b/docs/3.x/index.html @@ -4,13 +4,13 @@ Introduction | H3 - +
Version: 3.x

Introduction

H3 is a geospatial indexing system that partitions the world into hexagonal cells. H3 is open source under the Apache 2 license.

The H3 Core Library implements the H3 grid system. It includes functions for converting from latitude and longitude coordinates to the containing H3 cell, finding the center of H3 cells, finding the boundary geometry of H3 cells, finding neighbors of H3 cells, and more.

Highlights

Comparisons

  • S2, an open source, hierarchical, discrete, and global grid system using square cells.
  • Geohash, a system for encoding locations using a string of characters, creating a hierarchical, square grid system (a quadtree).
  • Hexbin, the process of taking coordinates and binning them into hexagonal cells in analytics or mapping software.
  • Admin Boundaries, officially designated areas used for aggregating and analyzing data.
  • Placekey, a system for encoding points of interest (POIs) which incorporates H3 in its POI identifier.
- + \ No newline at end of file diff --git a/docs/3.x/installation/index.html b/docs/3.x/installation/index.html index c2dc97c8f..981b5a910 100644 --- a/docs/3.x/installation/index.html +++ b/docs/3.x/installation/index.html @@ -4,14 +4,14 @@ Installation | H3 - +
Version: 3.x

Installation

We recommend using prebuilt bindings if they are available for your programming language. Bindings for Go, Java, JavaScript, Python, and others are available.

Package managers

Using PyPi, run:

pip install h3

Using Conda, run:

conda config --add channels conda-forge
conda install h3-py

Install from source

First, clone the repository or download the source and check out the latest release:

git clone https://github.com/uber/h3.git
cd h3
git checkout v$(<VERSION)

You will need to install build dependencies for your operating system.

First make sure you have the developer tools installed and then run:

# Installing the bare build requirements
brew install cmake
# Installing useful tools for development
brew install clang-format lcov doxygen

Next, you can build the library:

mkdir build
cd build
cmake ..
cmake --build .

Optionally, to run H3's test suite, run:

ctest

By default, the filter applications are built when you build H3. You can confirm they are working by running:

./bin/geoToH3 --lat 14 --lon -42 --resolution 2
- + \ No newline at end of file diff --git a/docs/3.x/quickstart/index.html b/docs/3.x/quickstart/index.html index 9551676b1..db3f2ef4d 100644 --- a/docs/3.x/quickstart/index.html +++ b/docs/3.x/quickstart/index.html @@ -4,7 +4,7 @@ Quick Start | H3 - + @@ -99,7 +99,7 @@ } }
Result
Loading...
- + \ No newline at end of file diff --git a/docs/api/hierarchy/index.html b/docs/api/hierarchy/index.html index 2b3c9b9cc..020c8b5d9 100644 --- a/docs/api/hierarchy/index.html +++ b/docs/api/hierarchy/index.html @@ -4,7 +4,7 @@ Hierarchical grid functions | H3 - + @@ -235,7 +235,7 @@ }
Result
Loading...

uncompactCellsSize

Provides the total resulting number of cells if uncompacting a cell set to a given resolution.

H3Error uncompactCellsSize(const H3Index *compactedSet, const int64_t numCompacted, const int res, int64_t *out);

Provides the size of the array needed by uncompactCells into out.

Returns 0 (E_SUCCESS) on success.

- + \ No newline at end of file diff --git a/docs/api/indexing/index.html b/docs/api/indexing/index.html index 8e618db75..7e02d63b1 100644 --- a/docs/api/indexing/index.html +++ b/docs/api/indexing/index.html @@ -4,7 +4,7 @@ Indexing functions | H3 - + @@ -113,7 +113,7 @@
Result
Loading...
- + \ No newline at end of file diff --git a/docs/api/inspection/index.html b/docs/api/inspection/index.html index cb88bc230..e32e239a0 100644 --- a/docs/api/inspection/index.html +++ b/docs/api/inspection/index.html @@ -4,7 +4,7 @@ Index inspection functions | H3 - + @@ -69,8 +69,8 @@ color: transparent !important; } } -
Result
Loading...

stringToH3

Converts the string representation to H3Index (uint64_t) representation.

H3Error stringToH3(const char *str, H3Index *out);

Returns 0 (E_SUCCESS) on success.

h3ToString

Converts the H3Index representation of the index to the string representation.

H3Error h3ToString(H3Index h, char *str, size_t sz);

str must be at least of length 17. -Returns 0 (E_SUCCESS) on success.

isValidCell

Returns non-zero if this is a valid H3 cell index.

int isValidCell(H3Index h);

maxFaceCount

Returns the maximum number of icosahedron faces the given H3 index may intersect.

H3Error maxFaceCount(H3Index h3, int *out);

Returns 0 (E_SUCCESS) on success.

- + \ No newline at end of file diff --git a/docs/api/misc/index.html b/docs/api/misc/index.html index 2293060f3..401d2262e 100644 --- a/docs/api/misc/index.html +++ b/docs/api/misc/index.html @@ -4,7 +4,7 @@ Miscellaneous H3 functions | H3 - + @@ -582,7 +582,7 @@ } }
Result
Loading...
- + \ No newline at end of file diff --git a/docs/api/regions/index.html b/docs/api/regions/index.html index abdef41a7..a669d81e5 100644 --- a/docs/api/regions/index.html +++ b/docs/api/regions/index.html @@ -4,7 +4,7 @@ Region functions | H3 - + @@ -91,7 +91,7 @@ }
Result
Loading...

destroyLinkedMultiPolygon

Free all allocated memory for a linked geo structure. The caller is responsible for freeing memory allocated to the input polygon struct.

void destroyLinkedMultiPolygon(LinkedGeoPolygon *polygon);
- + \ No newline at end of file diff --git a/docs/api/traversal/index.html b/docs/api/traversal/index.html index 5c63f87e4..f8850c75d 100644 --- a/docs/api/traversal/index.html +++ b/docs/api/traversal/index.html @@ -4,7 +4,7 @@ Grid traversal functions | H3 - + @@ -257,7 +257,7 @@ } }
Result
Loading...
- + \ No newline at end of file diff --git a/docs/api/uniedge/index.html b/docs/api/uniedge/index.html index 8a94a715a..167052301 100644 --- a/docs/api/uniedge/index.html +++ b/docs/api/uniedge/index.html @@ -4,7 +4,7 @@ Directed edge functions | H3 - + @@ -250,7 +250,7 @@ } }
Result
Loading...
- + \ No newline at end of file diff --git a/docs/api/vertex/index.html b/docs/api/vertex/index.html index 0005e6a17..a9301e9fd 100644 --- a/docs/api/vertex/index.html +++ b/docs/api/vertex/index.html @@ -4,7 +4,7 @@ Vertex functions | H3 - + @@ -131,7 +131,7 @@ } }
Result
Loading...
- + \ No newline at end of file diff --git a/docs/community/applications/index.html b/docs/community/applications/index.html index 792b92c3c..57fbbc4a7 100644 --- a/docs/community/applications/index.html +++ b/docs/community/applications/index.html @@ -4,13 +4,13 @@ Applications Using H3 | H3 - +
Version: 4.x

Applications Using H3

The following applications use H3. Contributions to this list are welcome, please feel free to open a pull request.

Visualization

  • kepler.gl - An open source geospatial analysis tool
  • pydeck - High-scale spatial rendering in Python, powered by deck.gl
- + \ No newline at end of file diff --git a/docs/community/bindings/index.html b/docs/community/bindings/index.html index 447b7d614..c222d48b7 100644 --- a/docs/community/bindings/index.html +++ b/docs/community/bindings/index.html @@ -4,13 +4,13 @@ Bindings | H3 - +
Version: 4.x
- + \ No newline at end of file diff --git a/docs/community/libraries/index.html b/docs/community/libraries/index.html index 48040ce24..ff0b84105 100644 --- a/docs/community/libraries/index.html +++ b/docs/community/libraries/index.html @@ -4,13 +4,13 @@ Libraries Using H3 | H3 - +
Version: 4.x

Libraries Using H3

The following libraries use H3 via one of its bindings. Contributions to this list are welcome, please feel free to open a pull request.

JavaScript

Python

Rust

  • nmandery/h3ron - Raster to H3 conversion, smoothing of linked polygons.
- + \ No newline at end of file diff --git a/docs/community/tutorials/index.html b/docs/community/tutorials/index.html index e108c9f2b..d87a6751d 100644 --- a/docs/community/tutorials/index.html +++ b/docs/community/tutorials/index.html @@ -4,13 +4,13 @@ Learning Resources | H3 - + - + \ No newline at end of file diff --git a/docs/comparisons/admin/index.html b/docs/comparisons/admin/index.html index 2a5596892..bcad117d5 100644 --- a/docs/comparisons/admin/index.html +++ b/docs/comparisons/admin/index.html @@ -4,13 +4,13 @@ Admin Boundaries | H3 - +
Version: 4.x

Admin Boundaries

Administrative boundaries, such as ZIP Codes and Census Blocks in the United States, can be used for aggregating and analyzing data. These boundaries have a number of drawbacks for aggregating data. These are primarily related to not having a comparable spatial unit of analysis, being unable to spatially relate data, and being unrelated to the data being analyzed.

ZIP Codes

The article Stop Using Zip Codes for Geospatial Analysis summarizes a number of problems with using ZIP Codes. In short, ZIP Codes do not represent areas themselves but rather mail delivery routes. They also vary greatly in spatial size when rendered as ZIP Code Tabulation Areas and change for unrelated reasons.

Use case specific partitioning

When using manually drawn partitions, there is usually no spatial unit of analysis which can be compared. Edges of partitions may exhibit boundary effects due to not taking into account neighboring partitions.

Manually drawn partitions can better incorporate human knowledge, but can require updating as that knowledge changes. It can take a significant amount of time and effort to define and update partitions manually.

The varying size of partitions means the center of a partition may be unrelated to the center of the data points.

ZIP Codes vs H3 comparison

ZIP Codes on the left, H3 on the right. Data: New York City 2015 Street Tree Census

- + \ No newline at end of file diff --git a/docs/comparisons/geohash/index.html b/docs/comparisons/geohash/index.html index f9b56131a..5de1457ea 100644 --- a/docs/comparisons/geohash/index.html +++ b/docs/comparisons/geohash/index.html @@ -4,13 +4,13 @@ Geohash | H3 - +
Version: 4.x

Geohash

Geohash is a system for encoding locations using a string of characters, creating a hierarchical, square grid system (a quadtree).

Area distortion

Because Geohash encodes latitude and longitudes pairs, it is subject to significant differences in area at different latitudes. A degree of longitude near a pole represents a significantly smaller distance than a degree of longitude near the equator.

Identifiers

Geohash uses strings for its cell indexes. Because they are strings, they can encode arbitrarily precise cells.

H3 cell indexes are designed to be 64 bit integers, which can be rendered and transmitted as strings if needed. The integer representation can be used when high performance is needed, as integer operations are usually more performant than string operations. Because indexes are fixed size, H3 has a maximum resolution it can encode.

Geohash vs H3 Comparison

Geohash on the left, H3 on the right. Data: San Francisco Street Tree List

- + \ No newline at end of file diff --git a/docs/comparisons/hexbin/index.html b/docs/comparisons/hexbin/index.html index f5887e1b7..8a364a60a 100644 --- a/docs/comparisons/hexbin/index.html +++ b/docs/comparisons/hexbin/index.html @@ -4,13 +4,13 @@ Hexbin | H3 - +
Version: 4.x

Hexbin

Hexbinning is the process of taking coordinates and binning them into hexagonal cells in analytics or mapping software. The size of the hexagons is configurable, and the hexagons can align with the map projection being used.

Hexbins are generally very computationally cheap to create, and for the best performance can be computed directly on a GPU. Their coordinates, while not hierarchical, support many common operations like finding neighbors and grid distances very efficiently.

Hexbins have drawbacks in the ability to reuse the grids. The cell identifiers they use are only useful in the specific hexbin grid, and are not portable to another grid, limiting their ability to be used for joining datasets. The cell identifiers are not hierarchical, so relating data at different grid resolutions can be difficult.

Hexbins are also limited by the projection system they are created on top of. This usually results in discontinuities at the edges of the projections, for example at the anti-meridian or at the poles.

Hexbin vs H3 Comparison

Hexbins on the left, H3 on the right. Data: San Francisco Street Tree List

- + \ No newline at end of file diff --git a/docs/comparisons/placekey/index.html b/docs/comparisons/placekey/index.html index e5155c376..60ee211de 100644 --- a/docs/comparisons/placekey/index.html +++ b/docs/comparisons/placekey/index.html @@ -4,13 +4,13 @@ Placekey | H3 - +
Version: 4.x

Placekey

Placekey is a system for encoding points of interest (POIs), and incorporates H3 in its POI identifier.

For example, the Placekey for the Ferry Building in San Francisco, zzw-22y@5vg-7gt-qzz, contains a What Part (zzw-22y) encoding a specific POI, and a Where Part (5vg-7gt-qzz) encoding where that POI is. The Where Part is an H3 cell index at resolution 10, using an alternate string encoding. The example Where Part represents the H3 index 8a283082a677fff. Placekey Where Parts can be losslessly converted to and from their equivalent H3 indexes.

- + \ No newline at end of file diff --git a/docs/comparisons/s2/index.html b/docs/comparisons/s2/index.html index c246b4eed..dfa7378b7 100644 --- a/docs/comparisons/s2/index.html +++ b/docs/comparisons/s2/index.html @@ -4,13 +4,13 @@ S2 | H3 - +
Version: 4.x

S2

S2, like H3, implements an open source, hierarchical, discrete, and global grid system. The systems share a number of similarities, including the use of 64 bit integers as cell indexes, making it very efficient to use both of them in big data systems.

One of the main differences between S2 and H3 is the choice of cell shape. S2 uses square cells while H3 uses hexagonal cells. This leads to important differences in neighbors, subdivision, and visualization.

Neighbors

Squares have two classes of neighbors: those that they share an edge with, and those that they share a point with. This can complicate analysis of moving things in the real world, because they are very unlikely to move in a way aligned with the grid. Instead, the analyst will need to account for different types of neighbors.

Hexagons have only one class of neighbor, that they share an edge with. This makes running convolutions and smoothing over the data much simpler, since only the grid distance (as opposed to the geographic distance) from a cell needs to be considered.

Subdivision

S2 uses an aperture 4 system where each cell is subdivided into 4 finer, child cells. Squares subdivide exactly into 4 child squares. This means that when indexing a point to an S2 cell, and then truncating to the parent S2 cell, there is no possibility that the point is not contained in the bounds of the parent cell.

This differs from H3 where the same operation is approximate. This is the case because hexagons do not exactly subdivide into 7 child hexagons.

Visualization

S2 cells are squares in the system's projection. When those cells are visualized on a map using a projection like the Web Mercator projection, the cells can subjectively appear distorted (i.e. as a quadrilateral rather than square).

H3 cells have the same non-alignment with the map projection, but in our experience the effect is less noticeable to viewers for hexagons.

S2 vs H3 Comparison

S2 on the left, H3 on the right. Data: San Francisco Street Tree List

- + \ No newline at end of file diff --git a/docs/core-library/cellToBoundaryDesc/index.html b/docs/core-library/cellToBoundaryDesc/index.html index 6762ef205..8b680a25a 100644 --- a/docs/core-library/cellToBoundaryDesc/index.html +++ b/docs/core-library/cellToBoundaryDesc/index.html @@ -4,13 +4,13 @@ Generate the cell boundary in latitude/longitude coordinates of an H3Index cell | H3 - +
Version: 4.x

Generate the cell boundary in latitude/longitude coordinates of an H3Index cell

This operation is performed by function cellToBoundary. See the comments in the function source code for more detail.

The conversion is performed as a series of coordinate system conversions described below. See the page Coordinate Systems used by the H3 Core Library for more information on each of these coordinate systems.

  1. We note that the cell vertices are the center points of cells in an aperture 3 grid one resolution finer than the cell resolution, which we term a substrate grid. We precalculate the substrate ijk coordinates of a cell with ijk coordinates (0,0,0), adding additional aperture 3 and aperture 7 (if required, by Class III cell grid) substrate grid resolutions as required to transform the vertex coordinates into a Class II substrate grid.
  1. The function _faceIjkToGeoBoundary calculates the ijk coordinates of the cell center point in the appropriate substrate grid (determined in the last step), and each of the substrate vertices is translated using the cell center point ijk. Each vertex ijk is then transformed onto the appropriate face and Hex2d coordinate system using the approach taken in finding a cell center point. If adjacent vertices lie on different icosahedron faces a point is introduced at the intersection of the cell edge and icosahedron face edge.
  2. The Hex2d coordinates are then converted to latitude/longitude using _hex2dToGeo.
- + \ No newline at end of file diff --git a/docs/core-library/cellToLatLngDesc/index.html b/docs/core-library/cellToLatLngDesc/index.html index 8a39065cd..0c18b7a9b 100644 --- a/docs/core-library/cellToLatLngDesc/index.html +++ b/docs/core-library/cellToLatLngDesc/index.html @@ -4,14 +4,14 @@ Determine the latitude/longitude coordinates of the center point of an H3Index cell | H3 - +
Version: 4.x

Determine the latitude/longitude coordinates of the center point of an H3Index cell

This operation is performed by function cellToLatLng. See the comments in the function source code for more detail.

The conversion is performed as a series of coordinate system conversions described below. See the page Coordinate Systems used by the H3 Core Library for more information on each of these coordinate systems.

  1. The function _h3ToFaceIjk then converts the H3 index to the appropriate icosahedron face number and normalized ijk coordinate's on that face's coordinate system as follows:
  • We start by assuming that the cell center point falls on the same icosahedron face as its base cell.
  • It is possible that the cell center point lies on an adjacent face (termed an overage in the code), in which case we would need to use a projection centered on that adjacent face instead. We recall that normalized 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. We determine whether an overage exists by taking the sum of the ijk components, and if there is an overage the positive 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 ijk coordinates into the adjacent face-centered ijk system.
  1. The face-centered ijk coordinates are then converted into corresponding Hex2d coordinates using the function _ijkToHex2d.
  2. The function _hex2dToGeo takes the Hex2d coordinates and scales them into face-centered gnomonic coordinates, and then performs an inverse gnomonic projection to get the latitude/longitude coordinates.
- + \ No newline at end of file diff --git a/docs/core-library/compilation-options/index.html b/docs/core-library/compilation-options/index.html index 6eb5dc69e..8a30868a2 100644 --- a/docs/core-library/compilation-options/index.html +++ b/docs/core-library/compilation-options/index.html @@ -4,7 +4,7 @@ Compilation options | H3 - + @@ -24,7 +24,7 @@ this flag because that configuration is not well tested.

H3_ALLOC_PREFIX

Used for directing the library to use a different set of functions for memory management.

H3_PREFIX

Used for renaming the public API.

If enabled, CMake will print which CTest test case corresponds to which input file.

ENABLE_WARNINGS

Whether to enable all compiler warnings. (i.e. -Wall)

WARNINGS_AS_ERRORS

Whether to treat compiler warnings as errors. While a useful tool for ensuring software quality, this should not be enabled for production builds as compiler warnings can change unexpectedly between versions. This is intended to be used with ENABLE_WARNINGS on.

WRAP_VALGRIND

Whether to wrap invocations of the test suite with valgrind (if available).

- + \ No newline at end of file diff --git a/docs/core-library/coordsystems/index.html b/docs/core-library/coordsystems/index.html index 6776fa6e8..c6e5aface 100644 --- a/docs/core-library/coordsystems/index.html +++ b/docs/core-library/coordsystems/index.html @@ -4,13 +4,13 @@ Coordinate systems | H3 - +
Version: 4.x

Coordinate systems

The H3 Core Library uses the following coordinate systems internally.

IJK Coordinates

Discrete hexagon planar grid systems naturally have 3 coordinate axes spaced 120° apart. We refer to such a system as an ijk coordinate system, for the three coordinate axes i, j, and k. A single ijk coordinate triplet is represented in the H3 Core Library using the structure type CoordIJK.

Using an ijk coordinate system to address hexagon grid cells provides multiple valid addresses for each cell. Normalizing an ijk address (function _ijkNormalize) creates a unique address consisting of the minimal positive ijk components; this always results in at most two non-zero components.

FaceIJK Coordinates

The H3 Core Library centers an ijk coordinate system on each face of the icosahedron; the combination of a face number and ijk coordinates on that face's coordinate system is represented using the structure type FaceIJK.

Each grid resolution is rotated ~19.1° relative to the next coarser resolution. The rotation alternates between counterclockwise and clockwise at each successive resolution, so that each resolution will have one of two possible orientations: Class II or Class III (using a terminology coined by R. Buckminster Fuller). The base cells, which make up resolution 0, are Class II.

Hex2d Coordinates

A Hex2d coordinate system is a cartesian coordinate system associated with a specific ijk coordinate system, where:

  • the origin of the Hex2d system is centered on the origin cell of the ijk system,
  • the positive x-axis of the Hex2d system is aligned with the i-axis of the ijk system, and
  • 1.0 unit distance in the Hex2d system is the distance between adjacent cell centers in the ijk coordinate system.

Hex2d coordinates are represented using the structure type Vec2d.

Local IJ Coordinates

Algorithms working with hexagons may want to refer to grid coordinates that are not interrupted by base cells or faces. These coordinates have 2 coordinate axes spaced 120° apart, with the coordinates anchored by an origin H3 index.

  • local coordinates are only comparable when they have the same origin index.
  • local coordinates are only valid near the origin. Pratically, this is within the same base cell or a neighboring base cell, except for pentagons.
  • the coordinate space may have deleted or warped regions due to pentagon distortion.
  • there may be multiple coordinates for the same index, with the same origin.
  • the origin may not be at (0, 0) in the local coordinate space.

Local IJ coordinates are represented using the structure type CoordIJ and an associated origin H3Index.

- + \ No newline at end of file diff --git a/docs/core-library/creating-bindings/index.html b/docs/core-library/creating-bindings/index.html index 2d6165922..13120a58e 100644 --- a/docs/core-library/creating-bindings/index.html +++ b/docs/core-library/creating-bindings/index.html @@ -4,13 +4,13 @@ Creating bindings for H3 | H3 - +
Version: 4.x

Creating bindings for H3

H3 is a C library, in part to make it simpler to create bindings for different programming languages. Each language usually has its own way to bind to C functions, but this document can serve as a starting point and list of tips.

There may already be H3 bindings available for your language of choice.

Function naming

The make binding-functions target produces a file binding-functions containing a list of function in the H3 public API, one per line. You can use this as part of your build process to check how much of the H3 public API your bindings expose. This list does not include memory management functions that are needed to allocate arrays to be passed to the H3 API.

Keeping similar names and purposes for functions can make it easier for your users to use the H3 API Reference.

Community

When ready, make a pull request to add your binding to the H3 documentation website.

Documentation

To be included in the H3 API reference, your binding should:

  • Be reasonably up to date with uber/h3.
  • Include bindings for the relevant functions in the output of make binding-functions. For example, stringToH3 may not be necessary if your bindings only supports string H3 indexes.
  • Use the major and minor version of the version of H3 bound. For example, when binding H3 version 3.2.1, a valid binding version would be 3.2.0, but 4.2.1 would not be valid.
- + \ No newline at end of file diff --git a/docs/core-library/custom-alloc/index.html b/docs/core-library/custom-alloc/index.html index 389b5c63f..507a5d5bf 100644 --- a/docs/core-library/custom-alloc/index.html +++ b/docs/core-library/custom-alloc/index.html @@ -4,13 +4,13 @@ Memory allocation | H3 - +
Version: 4.x

Memory allocation

H3's approach to memory management is to rely on memory allocated by the caller as much as possible. This allows memory to be managed by an external framework.

In some cases (for example, polygonToCells), H3 allocates heap memory. When this is needed, it uses the standard C memory allocation functions.

Custom Memory Allocators

caution

On some systems, such as Windows, the undefined symbols cannot be undefined at build time. Further changes to the H3 build are needed to provide custom implementations.

caution

There are a few algorithms like kRing that still use the call stack to recurse and could run out of memory that way.

H3 supports replacing the memory management functions (malloc, calloc, realloc, free) used by the library at build time. This can be used to integrate H3 within a managed framework.

When using custom memory allocators, H3 prefixes the names of memory allocation functions with the string you specify. The application linking H3 must have the prefixed replacement functions defined, or you must change the H3 build to link against the prefixed replacement functions.

When building H3, specify the H3_ALLOC_PREFIX option to your prefix of choice, as below:

cmake -DH3_ALLOC_PREFIX=my_prefix_ .

Then, in your application using H3, implement the following functions, replacing my_prefix_ with the prefix you chose above:

void* my_prefix_malloc(size_t size);
void* my_prefix_calloc(size_t num, size_t size);
void* my_prefix_realloc(void* ptr, size_t size);
void my_prefix_free(void* ptr);
info

H3 does not currently use realloc.

Link to H3 as you would have without the custom allocators. The custom allocators will be used for allocating heap memory in H3.

- + \ No newline at end of file diff --git a/docs/core-library/filters/index.html b/docs/core-library/filters/index.html index 04af5edde..e34726084 100644 --- a/docs/core-library/filters/index.html +++ b/docs/core-library/filters/index.html @@ -4,13 +4,13 @@ Unix-style Filters for H3 | H3 - +
Version: 4.x

Unix-style Filters for H3

The directory src/apps/filters contains unix-style stdin/stdout filters that perform conversions between integer H3 indexes and other useful types. It currently contains the filters listed in the table below. See the header comments in each application source code file for more information.

Filters are experimental and are not part of the semantic version of the H3 library.

All latitude/longitude coordinates are in decimal degrees. See the H3 Index Representations page for information on the integer H3Index.

filterinputoutputs
latLngToCelllat/lngH3Index
cellToLatLngH3Indexcell center point in lat/lng
cellToBoundaryH3Indexcell boundary in lat/lng
h3ToComponentsH3Indexcomponents
gridDiskH3Indexsurrounding H3Index
gridDiskUnsafeH3Indexsurrounding H3Index, in order

Unix Command Line Examples

  • find the index for coordinates at resolution 5

    latLngToCell --resolution 5 --latitude 40.689167 --longitude -74.044444

  • output the cell center point for H3Index 845ad1bffffffff

    cellToLatLng --index 845ad1bffffffff

  • output the cell boundary for H3Index 845ad1bffffffff

    cellToBoundary --index 845ad1bffffffff

  • find the components for the H3Index 845ad1bffffffff

    h3ToComponents --index 845ad1bffffffff

  • output all indexes within distance 1 of the H3Index 845ad1bffffffff

    kRing -k 1 --origin 845ad1bffffffff

  • output all hexagon indexes within distance 2 of the H3Index 845ad1bffffffff

    hexRange -k 2 --origin 845ad1bffffffff

Note that the filters cellToLatLng and cellToBoundary take optional arguments that allow them to generate kml output. See the header comments in the corresponding source code files for details.

- + \ No newline at end of file diff --git a/docs/core-library/h3Indexing/index.html b/docs/core-library/h3Indexing/index.html index 21c2c656d..e0e51560e 100644 --- a/docs/core-library/h3Indexing/index.html +++ b/docs/core-library/h3Indexing/index.html @@ -4,7 +4,7 @@ H3 Index | H3 - + @@ -14,7 +14,7 @@ it is analogous to NaN in floating point. It should be used instead of an arbitrary Mode 0 index, due to its uniqueness and easy identifiability. A mode 0 index could also indicate an error code has been provided instead of a valid H3 index.

Bit layout of H3Index

The layout of an H3Index is shown below in table form. The interpretation of the "Mode-Dependent" field differs depending on the mode of the index.

0x0F0x0E0x0D0x0C0x0B0x0A0x090x080x070x060x050x040x030x020x010x00
0x30ReservedModeMode-DependentResolutionBase cell
0x20Base cellDigit 1Digit 2Digit 3Digit 4Digit 5
0x10Digit 5Digit 6Digit 7Digit 8Digit 9Digit 10
0x00Digit 10Digit 11Digit 12Digit 13Digit 14Digit 15
- + \ No newline at end of file diff --git a/docs/core-library/latLngToCellDesc/index.html b/docs/core-library/latLngToCellDesc/index.html index b8a0090aa..f31079c31 100644 --- a/docs/core-library/latLngToCellDesc/index.html +++ b/docs/core-library/latLngToCellDesc/index.html @@ -4,13 +4,13 @@ Conversion from latitude/longitude to containing H3 cell index | H3 - +
Version: 4.x

Conversion from latitude/longitude to containing H3 cell index

This operation is performed by function latLngToCell. See the comments in the function for more detail.

The conversion is performed as a series of coordinate system conversions described below. See the page Coordinate Systems used by the H3 Core Library for more information on each of these coordinate systems.

  1. The input latitude/longitude coordinate is first converted into the containing icosahedron face and a Hex2d coordinate on that face using function _geoToHex2d, which determines the correct face and then performs a face-centered gnomonic projection into face-centered polar coordinates. These polar coordinates are then scaled appropriately to a Hex2d coordinate on the input grid resolution r.

  2. The Hex2d coordinate is converted into resolution r normalized ijk coordinates using function _hex2dToCoordIJK.

  3. The face and face-centered ijk coordinates are then converted into an H3Index representation using the following steps:

    1. The H3 index digits are calculated from resolution r up to 0, adjusting the ijk coordinates at each successively coarser resolution.
    2. When resolution 0 is reached, if the remaining ijk coordinates are (0,0,0) then the base cell centered on the face is chosen for the index.
    3. If the remaining resolution 0 ijk coordinates are not (0,0,0), then a lookup operation is performed to find the appropriate base cell and the required rotation (if any) to orient the cell in that base cell's coordinate system. The index is then translated and rotated into the coordinate system centered on the new base cell.
- + \ No newline at end of file diff --git a/docs/core-library/overview/index.html b/docs/core-library/overview/index.html index 00a8d85bd..82b22a7d2 100644 --- a/docs/core-library/overview/index.html +++ b/docs/core-library/overview/index.html @@ -4,13 +4,13 @@ Overview of the H3 Geospatial Indexing System | H3 - +
Version: 4.x

Overview of the H3 Geospatial Indexing System

The H3 geospatial indexing system is a discrete global grid system (see Sahr et al., 2003) consisting of a multi-precision hexagonal tiling of the sphere with hierarchical indexes.

The hexagonal grid system is created on the planar faces of a sphere-circumscribed icosahedron, and the grid cells are then projected to the surface of the sphere using an inverse face-centered polyhedral gnomonic projection. The coordinate reference system (CRS) is spherical coordinates with the WGS84/EPSG:4326 authalic radius. It is common to use WGS84 CRS data with the H3 library.

The icosahedron is fixed relative to the sphere using a Dymaxion orientation (due to R. Buckminster Fuller). This orientation of a spherical icosahedron places all 12 icosahedron vertices in the ocean. (At the time of H3's development, this was the only known orientation with this property. Others have since been found.)

The H3 grid is constructed on the icosahedron by recursively creating increasingly higher precision hexagon grids until the desired resolution is achieved. Note that it is impossible to tile the sphere/icosahedron completely with hexagons; each resolution of an icosahedral hexagon grid must contain exactly 12 pentagons at every resolution, with one pentagon centered on each of the icosahedron vertices.

The first H3 resolution (resolution 0) consists of 122 cells (110 hexagons and 12 icosahedron vertex-centered pentagons), referred to as the base cells. These were chosen to capture as much of the symmetry of the spherical icosahedron as possible. These base cells are assigned numbers from 0 to 121 based on the latitude of their center points; base cell 0 has the northern most center point, while base cell 121 has the southern most center point.

Each subsequent resolution beyond resolution 0 is created using an aperture 7 resolution spacing (aperture refers to the number of cells in the next finer resolution grid for each cell); as resolution increases the unit length is scaled by sqrt(7) and each hexagon has 1/7th the area of a hexagon at the next coarser resolution (as measured on the icosahedron). H3 provides 15 finer grid resolutions in addition to the resolution 0 base cells. The finest resolution, resolution 15, has cells with an area of less than 1 m2. A table detailing the average cell area for each H3 resolution is available here.

Note: you can create KML files to visualize the H3 grids by running the kml make target. It will place the files in the KML output sub-directory.

- + \ No newline at end of file diff --git a/docs/core-library/restable/index.html b/docs/core-library/restable/index.html index cd3131ffe..62ac1a22e 100644 --- a/docs/core-library/restable/index.html +++ b/docs/core-library/restable/index.html @@ -4,7 +4,7 @@ Tables of Cell Statistics Across Resolutions | H3 - + @@ -50,7 +50,7 @@ average cell area table and the min/max area table.

- + \ No newline at end of file diff --git a/docs/core-library/testing/index.html b/docs/core-library/testing/index.html index 38c65cd7b..98c0cfdcb 100644 --- a/docs/core-library/testing/index.html +++ b/docs/core-library/testing/index.html @@ -4,14 +4,14 @@ Testing strategy | H3 - +
Version: 4.x

Testing strategy

The H3 developers try to ensure the robustness and reliability of the H3 library. Tools used to do this include defensive code, unit tests with coverage reporting, and fuzzing.

The H3 library may despite these efforts behave unexpectedly; in these cases the developers welcome feedback and contributions.

Unit testing

Github Actions are used to run the H3 test suite for every commit. A variety of configurations, described below, are tested.

Coverage information is collected in Coveralls. Because of the self-contained nature of the H3 library, we seek to have as close to 100% code coverage as possible.

Operating systemCompilerBuild typeProcessor architectureSpecial notes
Linux (Ubuntu)ClangDebug, Releasex64clang-format-14 is used to ensure all code is consistently formatted
LinuxClangDebugx64An additional copy of the job runs with Valgrind
LinuxClangDebugx64An additional copy of the job runs with coverage reporting, and excerising the H3_PREFIX mechanism.
LinuxgccDebug, Releasex64
Mac OSApple ClangDebug, Releasex64
WindowsMSVCDebug, Releasex64Static library
WindowsMSVCDebug, Releasex86Static library
WindowsMSVCDebug, Releasex64Dynamic library; testing is not run in this configuration
WindowsMSVCDebug, Releasex86Dynamic library; testing is not run in this configuration

Defensive code

H3 uses preprocessor macros borrowed from SQLite's testing methodology to include defensive code in the library. Defensive code is code that handles error conditions for which there are no known test cases to demonstrate it. The lack of known test cases means that without the macros, the defensive cases could inappropriately reduce coverage metrics, disincentivizing including them. The macros behave differently, depending on the build configuration:

  • Under release builds of the library (CMAKE_BUILD_TYPE=Release), the defensive code is included without modification. These branches are intended to be very simple (usually only returning an error code and possibly freeing some resources) and to be visually inspectable.

  • Under debug builds of the library (CMAKE_BUILD_TYPE=Debug), the defensive code is included and assert calls are included if the defensive code is invoked. Any unit test or fuzzer which can demonstrate the defensive code is actually reached will trigger a test failure and the developers can be alerted to cover the defensive code in unit tests.

  • Under coverage builds of the library (CMAKE_BUILD_TYPE=Debug ENABLE_COVERAGE=ON), the defensive code is not included by replacing its condition with a constant value. The compiler removes the defensive code and it is not counted in coverage metrics. This is intended only for determining test coverage of the library.

Benchmarks

H3 uses benchmarks to offer a comparison of the library's performance between revisions.

Benchmarks are automatically run on Linux x64 with Clang and GCC compilers for each commit in Github Actions.

Fuzzers

H3 uses fuzzers to find novel inputs that crash or result in other undefined behavior.

On each commit, CI is triggered to run OSS-Fuzz for H3. OSS-Fuzz regularly runs fuzzers against the latest development version of H3 and reports newly discovered issues to the H3 core maintainers.

- + \ No newline at end of file diff --git a/docs/core-library/usage/index.html b/docs/core-library/usage/index.html index 6b91eedb9..d0377a4af 100644 --- a/docs/core-library/usage/index.html +++ b/docs/core-library/usage/index.html @@ -4,7 +4,7 @@ Public API | H3 - + @@ -12,7 +12,7 @@
Version: 4.x

Public API

The public API of the H3 Core Library is defined in the file h3api.h.

API Versioning

The functions defined in h3api.h adhere to Semantic Versioning.

Header preprocessing

The file h3api.h.in is preprocessed into the file h3api.h as part of H3's build process. The preprocessing inserts the correct values for the H3_VERSION_MAJOR, H3_VERSION_MINOR, and H3_VERSION_PATCH macros.

API preconditions

The H3 API expects valid input. Behavior of the library may be undefined when given invalid input. Indexes should be validated with isValidCell or isValidDirectedEdge as appropriate.

The library attempts to validate inputs and return useful error codes if input is invalid. Which inputs are validated, and how precisely they are validated, may change between versions of the library. As a result the specific error code returned may change.

Function renaming

The H3_PREFIX exists to rename all functions in the H3 public API with a prefix chosen at compile time. The default is to have no prefix. This can be needed when linking multiple copies of the H3 library in order to avoid naming collisions. Internal functions and symbols are not renamed.

- + \ No newline at end of file diff --git a/docs/faq/index.html b/docs/faq/index.html index 2b5986d56..e1d8d6538 100644 --- a/docs/faq/index.html +++ b/docs/faq/index.html @@ -4,13 +4,13 @@ Frequently Asked Questions | H3 - +
- + \ No newline at end of file diff --git a/docs/highlights/aggregation/index.html b/docs/highlights/aggregation/index.html index bd04a7652..2621d8604 100644 --- a/docs/highlights/aggregation/index.html +++ b/docs/highlights/aggregation/index.html @@ -4,13 +4,13 @@ Aggregation | H3 - +
Version: 4.x

Aggregation

Analysis of location data, such as locations of cars in a city, can be done by bucketing locations. (Sahr et al., 2003) Using a regular grid provides smooth gradients and the ability to measure differences between cells.

The cell shape of that grid system is an important consideration. For simplicity, it should be a polygon that tiles regularly: the triangle, the square, or the hexagon. Of these, triangles and squares have neighbors with different distances. Triangles have three different distances, and squares have two different distances. For hexagons, all neighbors are equidistant.

TriangleSquareHexagon
Triangles have 12 neighborsSquares have 8 neighborsHexagons have 6 neighbors

This property allows for simpler analysis of movement. Hexagons have the property of expanding rings of neighbors approximating circles:


All six neighbors of a hexagon (ring 1)

Hexagons are also optimally space-filling. On average, a polygon may be filled with hexagon tiles with a smaller margin of error than would be present with square tiles.

References

- + \ No newline at end of file diff --git a/docs/highlights/flowmodel/index.html b/docs/highlights/flowmodel/index.html index 6ab01a5b5..ac67faffa 100644 --- a/docs/highlights/flowmodel/index.html +++ b/docs/highlights/flowmodel/index.html @@ -4,13 +4,13 @@ Flow Modelling | H3 - +
Version: 4.x

Flow Modelling

H3's hexagonal grid is well suited to analyzing movement. In addition to the benefits of the hexagonal grid shape, H3 includes other features for modelling flow.

H3 can create indexes that refer to the movement from one cell to a neighbor. These directed edge indexes share the advantages with their cell index counterparts, such as being 64 bit integers. The use of directed edges makes it possible to associate a weight with a movement in the grid.

(A planned improvement for the H3 system is to create indexes that refer to the edge between two cells without regards of direction.)

- + \ No newline at end of file diff --git a/docs/highlights/indexing/index.html b/docs/highlights/indexing/index.html index 3946d87db..787724cb8 100644 --- a/docs/highlights/indexing/index.html +++ b/docs/highlights/indexing/index.html @@ -4,13 +4,13 @@ Indexing | H3 - +
Version: 4.x

Indexing

H3 is a hierarchical geospatial index. H3 indexes refer to cells by the spatial hierarchy. Every hexagonal cell, up to the maximum resolution supported by H3, has seven child cells below it in this hierarchy. This subdivision is referred to as aperture 7.


A parent hexagon approximately contains seven children

Hexagons do not cleanly subdivide into seven finer hexagons. However, by alternating the orientation of grids a subdivision into seven cells can be approximated. This makes it possible to truncate the precision within a fixed margin of error of an H3 index. It is also possible to determine all the children of a parent H3 index.

Approximate containment only applies when truncating the precision of an H3 index. The borders of hexagons indexed at a specific resolution are not approximate and not affected by these considerations. For example, indexing points to cells at a certain resolution and finding those cell's neighbors is not affected by approximate containment.

While geographic containment is approximate, logical containment in the index is exact. It is possible to use H3 as an exact logical index on top of data indexed at a specific resolution.

This approximation allows for efficiently relating datasets indexed at different resolutions of the H3 grid. The functions for changing precision (h3ToParent, h3ToChildren) are implemented with only a few bitwise operations, making them very fast. The structure of the H3 index means that geographically close locations will tend to have numerically close indexes.

The hierarchical structure can also be used in analysis, when the precision or uncertainty for a location needs to be encoded in the spatial index. For example, a point from a GPS receiver could be indexed at a coarser resolution when the precision of the signal is lower, or some cells could be aggregated to a parent cell when there are too few data points in each of the finer cells.

Hierarchical containment allows for use cases like making contiguous sets of cells "compact" with compactCells. It is then possible to uncompactCells to the same input set of cells, or to test whether a cell is contained by the compact set.

Uncompacted (dense)Compacted (sparse)
California represented by 10633 uncompacted cellsCalifornia represented by 901 compacted cells

In use cases where exact boundaries are needed applications must take care to handle the hierarchical concerns. This can be done by taking care to use the hierarchy as a logical one rather than geographic. Another useful approach is using the grid system as an optimization in addition to a more precise point-in-polygon check.

- + \ No newline at end of file diff --git a/docs/highlights/joining/index.html b/docs/highlights/joining/index.html index 3f7f6e307..0518d716d 100644 --- a/docs/highlights/joining/index.html +++ b/docs/highlights/joining/index.html @@ -4,13 +4,13 @@ Joining | H3 - +
Version: 4.x

Joining

H3, acting as a standard unit of analysis, can be used to join disparate data sets.

The H3 library contains support for indexing points, lines, and regions into the grid. Other data formats, such as rasters, can be indexed into H3 using combinations of these basic indexing operations. Once data is indexed into H3 indexes, it can be easily joined with other datasets on the H3 index.

References

- + \ No newline at end of file diff --git a/docs/highlights/ml/index.html b/docs/highlights/ml/index.html index 09362ebcf..3605310f9 100644 --- a/docs/highlights/ml/index.html +++ b/docs/highlights/ml/index.html @@ -4,13 +4,13 @@ Machine Learning | H3 - +
Version: 4.x

Machine Learning

H3 is well suited to applying machine learning to geospatial data. Techniques from computer vision, such as convolution, can be applied to the pixel grid defined by H3.

H3 has functions for finding neighbors (kRing) for use in performing convolution, and functions for transforming indexes to a two dimensional IJ coordinate space on which other computer vision algorithms can be run.

- + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 74fcd1d0a..f89964434 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,13 +4,13 @@ Introduction | H3 - +
Version: 4.x

Introduction

H3 is a geospatial indexing system that partitions the world into hexagonal cells. H3 is open source under the Apache 2 license.

The H3 Core Library implements the H3 grid system. It includes functions for converting from latitude and longitude coordinates to the containing H3 cell, finding the center of H3 cells, finding the boundary geometry of H3 cells, finding neighbors of H3 cells, and more.

Highlights

Comparisons

  • S2, an open source, hierarchical, discrete, and global grid system using square cells.
  • Geohash, a system for encoding locations using a string of characters, creating a hierarchical, square grid system (a quadtree).
  • Hexbin, the process of taking coordinates and binning them into hexagonal cells in analytics or mapping software.
  • Admin Boundaries, officially designated areas used for aggregating and analyzing data.
  • Placekey, a system for encoding points of interest (POIs) which incorporates H3 in its POI identifier.
- + \ No newline at end of file diff --git a/docs/installation/index.html b/docs/installation/index.html index 41d4a16cf..2670849d6 100644 --- a/docs/installation/index.html +++ b/docs/installation/index.html @@ -4,14 +4,14 @@ Installation | H3 - +
Version: 4.x

Installation

We recommend using prebuilt bindings if they are available for your programming language. Bindings for Go, Java, JavaScript, Python, and others are available.

Package managers

Using PyPi, run:

pip install h3

Using Conda, run:

conda config --add channels conda-forge
conda install h3-py

Install from source

First, clone the repository or download the source and check out the latest release:

git clone https://github.com/uber/h3.git
cd h3
git checkout v$(<VERSION)

Note: You must install build dependencies for your operating system.

First make sure you have the developer tools installed and then run:

# Installing the bare build requirements
brew install cmake
# Installing useful tools for development
brew install clang-format lcov doxygen

Next, build the library:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .

Optionally, to run H3's test suite, run:

ctest

By default, the filter applications are built when you build H3. Confirm they are working by running:

./bin/latLngToCell --lat 14 --lng -42 --resolution 2
- + \ No newline at end of file diff --git a/docs/library/errors/index.html b/docs/library/errors/index.html index c26a81398..cf0fb017c 100644 --- a/docs/library/errors/index.html +++ b/docs/library/errors/index.html @@ -4,7 +4,7 @@ Error handling | H3 - + @@ -12,7 +12,7 @@
Version: 4.x

Error handling

H3 does it's best to be robust to system failures or unexpected inputs, but some times these cannot be recovered from. H3's way of doing this is to return an error code to the caller.

Example

This code example checks for an error when calling an H3 function and prints a message if the call did not succeed:

H3Error err;
H3Index result;

err = latLngToCell(lat, lng, res, &result);
if (err) {
fprintf(stderr, "Error: %d", err);
}

H3Error type

The type returned by most H3 functions is H3Error, a 32 bit integer type with the following properties:

  • H3Error will be an integer type of 32 bits, i.e. uint32_t.
  • H3Error with value 0 indicates success (no error).
  • No H3Error value will set the most significant bit.
  • As a result of these properties, no H3Error value will set the bits that correspond with the Mode bit field in an H3Index.

32 bit return codes with the high bit never set allows for mixing error codes and resulting indexes if desired by the application, after copying the error codes into the result buffer.

Table of error codes

ValueNameDescription
0E_SUCCESSSuccess (no error)
1E_FAILEDThe operation failed but a more specific error is not available
2E_DOMAINArgument was outside of acceptable range (when a more specific error code is not available)
3E_LATLNG_DOMAINLatitude or longitude arguments were outside of acceptable range
4E_RES_DOMAINResolution argument was outside of acceptable range
5E_CELL_INVALIDH3Index cell argument was not valid
6E_DIR_EDGE_INVALIDH3Index directed edge argument was not valid
7E_UNDIR_EDGE_INVALIDH3Index undirected edge argument was not valid
8E_VERTEX_INVALIDH3Index vertex argument was not valid
9E_PENTAGONPentagon distortion was encountered which the algorithm could not handle it
10E_DUPLICATE_INPUTDuplicate input was encountered in the arguments and the algorithm could not handle it
11E_NOT_NEIGHBORSH3Index cell arguments were not neighbors
12E_RES_MISMATCHH3Index cell arguments had incompatible resolutions
13E_MEMORY_ALLOCNecessary memory allocation failed
14E_MEMORY_BOUNDSBounds of provided memory were not large enough
15E_OPTION_INVALIDMode or flags argument was not valid

The H3 library may always add additional error messages. Error messages not recognized by the application should be treated as E_FAILED.

Bindings

Bindings translate error codes into the error handling mechanism appropriate to their language. For example, Java will convert error codes into Java Exceptions.

When possible, it is preferable to retain the error code. When this is not possible it is fine to elide them. Language bindings should include error messages that are formatted as is usual in their language.

References

- + \ No newline at end of file diff --git a/docs/library/index/cell/index.html b/docs/library/index/cell/index.html index 26b95f3b5..0f41e8fae 100644 --- a/docs/library/index/cell/index.html +++ b/docs/library/index/cell/index.html @@ -4,13 +4,13 @@ Cell mode | H3 - +
Version: 4.x

Cell mode

The H3 system assigns a unique hierarchical index to each cell. The H3 index of a resolution r cell begins with the appropriate resolution 0 base cell number. This is followed by a sequence of r digits 0-6, where each ith digit di specifies one of the 7 cells centered on the cell indicated by the coarser resolution digits d1 through di-1. A local hexagon coordinate system is assigned to each of the resolution 0 base cells and is used to orient all hierarchical indexing child cells of that base cell. The assignment of digits 0-6 at each resolution uses a Central Place Indexing arrangement (see Sahr, 2014). In the case of the 12 pentagonal cells the indexing hierarchy produced by sub-digit 1 is removed at all resolutions.

Child hexagons are linearly smaller than their parent hexagons.

H3 Cell Index

An H3 Cell index (mode 1) represents a cell (hexagon or pentagon) in the H3 grid system at a particular resolution. The components of the H3 Cell index are packed into a 64-bit integer in order, highest bit first, as follows:

  • 1 bit reserved and set to 0,
  • 4 bits to indicate the H3 Cell index mode,
  • 3 bits reserved and set to 0,
  • 4 bits to indicate the cell resolution 0-15,
  • 7 bits to indicate the base cell 0-121,
  • 3 bits to indicate each subsequent digit 0-6 from resolution 1 up to the resolution of the cell (45 bits total are reserved for resolutions 1-15)

The three bits for each unused digit are set to 7.

Bit layout of H3Index for cells

The layout of an H3Index is shown below in table form. The interpretation of the "Mode-Dependent" field differs depending on the mode of the index.

0x0F0x0E0x0D0x0C0x0B0x0A0x090x080x070x060x050x040x030x020x010x00
0x30Reserved (0)Mode (1)Reserved (0)ResolutionBase cell
0x20Base cellDigit 1Digit 2Digit 3Digit 4Digit 5
0x10Digit 5Digit 6Digit 7Digit 8Digit 9Digit 10
0x00Digit 10Digit 11Digit 12Digit 13Digit 14Digit 15
- + \ No newline at end of file diff --git a/docs/library/index/directededge/index.html b/docs/library/index/directededge/index.html index 55d9504a5..c5e779bc5 100644 --- a/docs/library/index/directededge/index.html +++ b/docs/library/index/directededge/index.html @@ -4,13 +4,13 @@ Directed edge mode | H3 - +
Version: 4.x

Directed edge mode

An H3 Directed Edge index (mode 2) represents a single directed edge between two cells (an "origin" cell and a neighboring "destination" cell). The components of the H3 Directed Edge index are packed into a 64-bit integer in order, highest bit first, as follows:

  • 1 bit reserved and set to 0,
  • 4 bits to indicate the H3 Unidirectional Edge index mode,
  • 3 bits to indicate the edge (1-6) of the origin cell,
  • Subsequent bits matching the index bits of the origin cell.

Bit layout of H3Index for directed edges

The layout of an H3Index is shown below in table form. The interpretation of the "Mode-Dependent" field differs depending on the mode of the index.

0x0F0x0E0x0D0x0C0x0B0x0A0x090x080x070x060x050x040x030x020x010x00
0x30Reserved (0)Mode (2)EdgeResolutionBase cell
0x20Base cellDigit 1Digit 2Digit 3Digit 4Digit 5
0x10Digit 5Digit 6Digit 7Digit 8Digit 9Digit 10
0x00Digit 10Digit 11Digit 12Digit 13Digit 14Digit 15
- + \ No newline at end of file diff --git a/docs/library/index/vertex/index.html b/docs/library/index/vertex/index.html index 21ec153a3..831890a8e 100644 --- a/docs/library/index/vertex/index.html +++ b/docs/library/index/vertex/index.html @@ -4,13 +4,13 @@ Vertex mode | H3 - +
Version: 4.x

Vertex mode

An H3 Vertex index (mode 4) represents a single topological vertex in H3 grid system, shared by three cells. Note that this does not include the distortion vertexes occasionally present in a cell's geographic boundary. An H3 Vertex is arbitrarily assigned one of the three neighboring cells as its "owner", which is used to calculate the canonical index and geographic coordinates for the vertex. The components of the H3 Vertex index are packed into a 64-bit integer in order, highest bit first, as follows:

  • 1 bit reserved and set to 0,
  • 4 bits to indicate the H3 Vertex index mode,
  • 3 bits to indicate the vertex number (0-5) of vertex on the owner cell,
  • Subsequent bits matching the index bits of the owner cell.

Bit layout of H3Index for vertexes

The layout of an H3Index for vertexes is shown below in table form. The interpretation of the "Mode-Dependent" field differs depending on the mode of the index.

0x0F0x0E0x0D0x0C0x0B0x0A0x090x080x070x060x050x040x030x020x010x00
0x30Reserved (0)Mode (4)VertexResolutionBase cell
0x20Base cellDigit 1Digit 2Digit 3Digit 4Digit 5
0x10Digit 5Digit 6Digit 7Digit 8Digit 9Digit 10
0x00Digit 10Digit 11Digit 12Digit 13Digit 14Digit 15
- + \ No newline at end of file diff --git a/docs/library/migrating-3.x/index.html b/docs/library/migrating-3.x/index.html index c87e5d7ad..d76b840b6 100644 --- a/docs/library/migrating-3.x/index.html +++ b/docs/library/migrating-3.x/index.html @@ -4,7 +4,7 @@ Migrating from H3 version 3.x | H3 - + @@ -18,7 +18,7 @@ consistent and predictable.

Error codes

The C library is being changed to more consistently report errors. This is done via the return code of functions. Users of the C library will need to adjust some function calls to pass output parameters instead of using the return value of a function.

- + \ No newline at end of file diff --git a/docs/library/migration-3.x/functions/index.html b/docs/library/migration-3.x/functions/index.html index 05acda5ba..6f00ea605 100644 --- a/docs/library/migration-3.x/functions/index.html +++ b/docs/library/migration-3.x/functions/index.html @@ -4,7 +4,7 @@ Function name changes | H3 - + @@ -19,7 +19,7 @@ that it will not fail.

Initially, we will not expose the Safe versions to users in the API. We may expose them in the future if a need becomes clear.

Distance

3.x name.4.0.0 name
h3DistancegridDistance
h3LinegridPathCells
DNEgridPathEdges
DNEgridPathDirectedEdges

Filled-In Disk With Distances

3.x name.4.0.0 nameCalls
hexRangeDistancesgridDiskDistancesUnsafeNONE
_kRingInternalgridDiskDistancesSafeNONE
kRingDistancesgridDiskDistanceshexRangeDistances, _kRingInternal

Filled-In Disk Without Distances

3.x name.4.0.0 nameCalls
hexRangegridDiskUnsafehexRangeDistances
DNEgridDiskSafe
kRinggridDiskkRingDistances
hexRangesgridDisksUnsafeN x hexRange

Hollow Ring

3.x name.4.0.0 nameCalls
hexRinggridRingUnsafeNONE
DNEgridRingSafegridDiskDistancesSafe
DNEgridRinggridRingUnsafe, gridRingSafe

Local IJ

3.x name4.0.0 name
experimentalLocalIjToH3localIjToCell
experimentalH3ToLocalIjcellToLocalIj

H3 Edge Types

Instead of UnidirectionalEdge, use the term DirectedEdge.

For a future undirected edge mode, use the term Edge.

3.x name.4.0.0 name
h3UnidirectionalEdgeIsValidisValidDirectedEdge
getH3UnidirectionalEdgecellsToDirectedEdge
getH3IndexesFromUnidirectionalEdgedirectedEdgeToCells
getH3UnidirectionalEdgesFromHexagonoriginToDirectedEdges
DNEdestinationToDirectedEdges
getH3UnidirectionalEdgeBoundarydirectedEdgeToBoundary
getOriginH3IndexFromUnidirectionalEdgegetDirectedEdgeOrigin
getDestinationH3IndexFromUnidirectionalEdgegetDirectedEdgeDestination

Area/Length Functions

3.x name.4.0.0 name
hexAreaKm2getHexagonAreaAvgKm2
hexAreaM2getHexagonAreaAvgM2
edgeLengthKmgetHexagonEdgeLengthAvgKm
edgeLengthMgetHexagonEdgeLengthAvgM
DNEgetPentagonAreaAvg*
DNEgetPentagonEdgeLengthAvg*
DNEcellAreaKm2
DNEcellAreaM2
pointDistKmgreatCircleDistanceKm
pointDistMgreatCircleDistanceM
pointDistRadsgreatCircleDistanceRads
exactEdgeLengthRadsedgeLengthRads
exactEdgeLengthKmedgeLengthKm
exactEdgeLengthMedgeLengthM

Note: cellAreaKm2 and cellAreaM2 would return the actual area of the passed-in cell.

Polygons

Data Structures

  • rename GeoBoundary to CellBoundary to indicate it is space-limited to describing the geometry of cells
3.x name4.0.0 nameNotes
GeoBoundaryCellBoundary<= 10 stack-allocated LatLngs
GeoCoordLatLng
GeofenceGeoLoopheap-allocated LatLngs
GeoPolygonGeoPolygon
GeoMultiPolygonGeoMultiPolygoncurrently not used

Functions

3.x name4.0.0 nameNotes
h3ToGeoBoundarycellToBoundaryreturns CellBoundary
DNEcellToLoopreturns GeoLoop
DNEloopToBoundary
DNEboundaryToLoop
getH3UnidirectionalEdgeBoundarydirectedEdgeToBoundaryreturns CellBoundary
h3SetToLinkedGeocellsToLinkedMultiPolygonreturns LinkedGeoPolygon
h3SetToMultiPolygoncellsToMultiPolygonbindings only
- + \ No newline at end of file diff --git a/docs/library/terminology/index.html b/docs/library/terminology/index.html index 2f5ed6798..e133b3545 100644 --- a/docs/library/terminology/index.html +++ b/docs/library/terminology/index.html @@ -4,7 +4,7 @@ Terminology | H3 - + @@ -15,7 +15,7 @@ This should be expected in casual, informal discussions of H3. However, when precision is required, we advise the use of strict technical terms like "index", "cell", "hexagon", "pentagon", etc. In the codebase and in the documentation, strictly correct terminology should always be used, as many functions and algorithms distinguish between hexagons and pentagons.

References

- + \ No newline at end of file diff --git a/docs/quickstart/index.html b/docs/quickstart/index.html index 9de5856fc..9b00bfcd4 100644 --- a/docs/quickstart/index.html +++ b/docs/quickstart/index.html @@ -4,7 +4,7 @@ Quick Start | H3 - + @@ -99,7 +99,7 @@ } }
Result
Loading...
- + \ No newline at end of file diff --git a/index.html b/index.html index bcb4ed844..e0ec11948 100644 --- a/index.html +++ b/index.html @@ -4,13 +4,13 @@ Home | H3 - +

H3 indexes points and shapes into a hexagonal grid.


H3 is a discrete global grid system for indexing geographies into a hexagonal grid, developed at Uber.

Coordinates can be indexed to cell IDs that each represent a unique cell.

Indexed data can be quickly joined across disparate datasets and aggregated at different levels of precision.

H3 enables a range of algorithms and optimizations based on the grid, including nearest neighbors, shortest path, gradient smoothing, and more.

- + \ No newline at end of file