website/versioned_docs/version-3.x/api/uniedge.mdx
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
Unidirectional edges allow encoding the directed edge from one cell to a neighboring cell.
<Tabs groupId="language" defaultValue="c" values={[ {label: 'C', value: 'c'}, {label: 'Python', value: 'python'}, {label: 'Java', value: 'java'}, {label: 'JavaScript (Live)', value: 'javascript'}, ] }> <TabItem value="c">
int h3IndexesAreNeighbors(H3Index origin, H3Index destination);
h3.h3_indexes_are_neighbors(origin, destination)
boolean h3IndexesAreNeighbors(long origin, long destination);
boolean h3IndexesAreNeighbors(String origin, String destination);
h3.h3IndexesAreNeighbors(origin, destination)
function example() {
const origin = '85283473fffffff';
const destination = '85283477fffffff';
return String(h3v3.h3IndexesAreNeighbors(origin, destination));
}
Returns whether or not the provided H3Indexes are neighbors.
Returns 1 if the indexes are neighbors, 0 otherwise.
<Tabs groupId="language" defaultValue="c" values={[ {label: 'C', value: 'c'}, {label: 'Python', value: 'python'}, {label: 'Java', value: 'java'}, {label: 'JavaScript (Live)', value: 'javascript'}, ] }> <TabItem value="c">
H3Index getH3UnidirectionalEdge(H3Index origin, H3Index destination);
h3.get_h3_unidirectional_edge(origin, destination)
long getH3UnidirectionalEdge(long origin, long destination);
String getH3UnidirectionalEdge(String origin, String destination);
h3.getH3UnidirectionalEdge(h3Index)
function example() {
const origin = '85283473fffffff';
const destination = '85283477fffffff';
return h3v3.getH3UnidirectionalEdge(origin, destination);
}
Returns a unidirectional edge H3 index based on the provided origin and destination.
Returns 0 on error.
<Tabs groupId="language" defaultValue="c" values={[ {label: 'C', value: 'c'}, {label: 'Python', value: 'python'}, {label: 'Java', value: 'java'}, {label: 'JavaScript (Live)', value: 'javascript'}, ] }> <TabItem value="c">
int h3UnidirectionalEdgeIsValid(H3Index edge);
h3.h3_unidirectional_edge_is_valid(edge)
boolean h3UnidirectionalEdgeIsValid(long edge);
boolean h3UnidirectionalEdgeIsValid(String edgeAddress);
h3.h3UnidirectionalEdgeIsValid(edge)
function example() {
const edge = '115283473fffffff';
return String(h3v3.h3UnidirectionalEdgeIsValid(edge));
}
Determines if the provided H3Index is a valid unidirectional edge index.
Returns 1 if it is a unidirectional edge H3Index, otherwise 0.
<Tabs groupId="language" defaultValue="c" values={[ {label: 'C', value: 'c'}, {label: 'Python', value: 'python'}, {label: 'Java', value: 'java'}, {label: 'JavaScript (Live)', value: 'javascript'}, ] }> <TabItem value="c">
H3Index getOriginH3IndexFromUnidirectionalEdge(H3Index edge);
h3.get_origin_h3_index_from_unidirectional_edge(edge)
long getOriginH3IndexFromUnidirectionalEdge(long edge);
String getOriginH3IndexFromUnidirectionalEdge(String edgeAddress);
h3.getOriginH3IndexFromUnidirectionalEdge(h3Index)
function example() {
const edge = '115283473fffffff';
return h3v3.getOriginH3IndexFromUnidirectionalEdge(edge);
}
Returns the origin hexagon from the unidirectional edge H3Index.
<Tabs groupId="language" defaultValue="c" values={[ {label: 'C', value: 'c'}, {label: 'Python', value: 'python'}, {label: 'Java', value: 'java'}, {label: 'JavaScript (Live)', value: 'javascript'}, ] }> <TabItem value="c">
H3Index getDestinationH3IndexFromUnidirectionalEdge(H3Index edge);
h3.get_destination_h3_index_from_unidirectional_edge(edge)
long getDestinationH3IndexFromUnidirectionalEdge(long edge);
String getDestinationH3IndexFromUnidirectionalEdge(String edgeAddress);
h3.getDestinationH3IndexFromUnidirectionalEdge(edge)
function example() {
const edge = '115283473fffffff';
return h3v3.getDestinationH3IndexFromUnidirectionalEdge(edge);
}
Returns the destination hexagon from the unidirectional edge H3Index.
<Tabs groupId="language" defaultValue="c" values={[ {label: 'C', value: 'c'}, {label: 'Python', value: 'python'}, {label: 'Java', value: 'java'}, {label: 'JavaScript (Live)', value: 'javascript'}, ] }> <TabItem value="c">
void getH3IndexesFromUnidirectionalEdge(H3Index edge, H3Index* originDestination);
h3.get_h3_indexes_from_unidirectional_edge(edge)
List<Long> getH3IndexesFromUnidirectionalEdge(long edge);
List<String> getH3IndexesFromUnidirectionalEdge(String edgeAddress);
h3.getH3IndexesFromUnidirectionalEdge(edge)
function example() {
const edge = '115283473fffffff';
return h3v3.getH3IndexesFromUnidirectionalEdge(edge);
}
Returns the origin, destination pair of hexagon IDs for the given edge ID, which are placed at originDestination[0] and
originDestination[1] respectively.
<Tabs groupId="language" defaultValue="c" values={[ {label: 'C', value: 'c'}, {label: 'Python', value: 'python'}, {label: 'Java', value: 'java'}, {label: 'JavaScript (Live)', value: 'javascript'}, ] }> <TabItem value="c">
void getH3UnidirectionalEdgesFromHexagon(H3Index origin, H3Index* edges);
h3.get_h3_unidirectional_edges_from_hexagon(h)
List<Long> getH3UnidirectionalEdgesFromHexagon(long h3);
List<String> getH3UnidirectionalEdgesFromHexagon(String h3);
h3.getH3UnidirectionalEdgesFromHexagon(h3Index)
function example() {
const h = '85283473fffffff';
return h3v3.getH3UnidirectionalEdgesFromHexagon(h);
}
Provides all of the unidirectional edges from the current H3Index. edges must be of length 6,
and the number of unidirectional edges placed in the array may be less than 6.
<Tabs groupId="language" defaultValue="c" values={[ {label: 'C', value: 'c'}, {label: 'Python', value: 'python'}, {label: 'Java', value: 'java'}, {label: 'JavaScript (Live)', value: 'javascript'}, ] }> <TabItem value="c">
void getH3UnidirectionalEdgeBoundary(H3Index edge, GeoBoundary* gb);
h3.get_h3_unidirectional_edge_boundary(edge, geo_json=False)
List<GeoCoord> getH3UnidirectionalEdgeBoundary(long edge);
List<GeoCoord> getH3UnidirectionalEdgeBoundary(String edgeAddress);
h3.getH3UnidirectionalEdgeBoundary(edge, [formatAsGeoJson])
function example() {
const edge = '115283473fffffff';
return h3v3.getH3UnidirectionalEdgeBoundary(edge);
}
Provides the coordinates defining the unidirectional edge.