Directed edge functions
Directed edges allow encoding the directed (that is, which cell is the origin and which is the destination can be determined) edge from one cell to a neighboring cell.
areNeighborCells
- C
- Python
- Java
- JavaScript (Live)
H3Error areNeighborCells(H3Index origin, H3Index destination, int *out);
h3.are_neighbor_cells(origin, destination)
boolean areNeighborCells(long origin, long destination);
boolean areNeighborCells(String origin, String destination);
h3.areNeighborCells(origin, destination)
Returns whether or not the provided H3 cell indexes are neighbors.
out
will be 1 if the indexes are neighbors, 0 otherwise.
cellsToDirectedEdge
- C
- Python
- Java
- JavaScript (Live)
H3Error cellsToDirectedEdge(H3Index origin, H3Index destination, H3Index *out);
h3.cells_to_directed_edge(origin, destination)
long cellsToDirectedEdge(long origin, long destination);
String cellsToDirectedEdge(String origin, String destination);
h3.cellsToDirectedEdge(h3Index)
Returns a unidirectional edge H3 index based on the provided origin and destination.
Returns 0 on success.
isValidDirectedEdge
- C
- Python
- Java
- JavaScript (Live)
int isValidDirectedEdge(H3Index edge);
h3.is_valid_directed_edge(edge)
boolean isValidDirectedEdge(long edge);
boolean isValidDirectedEdge(String edgeAddress);
h3.isValidDirectedEdge(edge)
Determines if the provided H3Index is a valid unidirectional edge index.
Returns 1 if it is a unidirectional edge H3Index, otherwise 0.
getDirectedEdgeOrigin
- C
- Python
- Java
- JavaScript (Live)
H3Error getDirectedEdgeOrigin(H3Index edge, H3Index *out);
h3.get_directed_edge_origin(edge)
long getDirectedEdgeOrigin(long edge);
String getDirectedEdgeOrigin(String edgeAddress);
h3.getDirectedEdgeOrigin(h3Index)
Returns the origin hexagon from the unidirectional edge H3Index.
getDirectedEdgeDestination
- C
- Python
- Java
- JavaScript (Live)
H3Error getDirectedEdgeDestination(H3Index edge, H3Index *out);
h3.get_directed_edge_destination(edge)
long getDirectedEdgeDestination(long edge);
String getDirectedEdgeDestination(String edgeAddress);
h3.getDirectedEdgeDestination(edge)
Returns the destination hexagon from the unidirectional edge H3Index.
directedEdgeToCells
- C
- Python
- Java
- JavaScript (Live)
H3Error directedEdgeToCells(H3Index edge, H3Index* originDestination);
h3.directed_edge_to_cells(edge)
List<Long> directedEdgeToCells(long edge);
List<String> directedEdgeToCells(String edgeAddress);
h3.directedEdgeToCells(edge)
Returns the origin, destination pair of hexagon IDs for the given edge ID, which are placed at originDestination[0]
and
originDestination[1]
respectively.
originToDirectedEdges
- C
- Python
- Java
- JavaScript (Live)
H3Error originToDirectedEdges(H3Index origin, H3Index* edges);
h3.origin_to_directed_edges(h)
List<Long> originToDirectedEdges(long h3);
List<String> originToDirectedEdges(String h3);
h3.originToDirectedEdges(h3Index)
Provides all of the directed edges from the current H3Index. edges
must be of length 6,
and the number of directed edges placed in the array may be less than 6. If this is the case,
one of the members of the array will be 0
.
directedEdgeToBoundary
- C
- Python
- Java
- JavaScript (Live)
H3Error directedEdgeToBoundary(H3Index edge, CellBoundary* gb);
h3.directed_edge_to_boundary(edge, geo_json=False)
List<LatLng> directedEdgeToBoundary(long edge);
List<LatLng> directedEdgeToBoundary(String edgeAddress);
h3.directedEdgeToBoundary(edge, [formatAsGeoJson])
Provides the coordinates defining the unidirectional edge.