Skip to content

Commit

Permalink
initialise values
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephChotard committed Jan 18, 2025
1 parent 28ff979 commit d26e82d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/distance.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,18 @@ double haversineDistance(double th1, double ph1, double th2, double ph2) {

int main(int argc, char *argv[]) {
// 1455 Market St @ resolution 15
H3Index h3HQ1;
H3Index h3HQ1 = 0;
stringToH3("8f2830828052d25", &h3HQ1);
// 555 Market St @ resolution 15
H3Index h3HQ2;
H3Index h3HQ2 = 0;
stringToH3("8f283082a30e623", &h3HQ2);

LatLng geoHQ1, geoHQ2;
LatLng geoHQ1 = {0};
LatLng geoHQ2 = {0};
cellToLatLng(h3HQ1, &geoHQ1);
cellToLatLng(h3HQ2, &geoHQ2);

int64_t distance;
int64_t distance = 0;
assert(gridDistance(h3HQ1, h3HQ2, &distance) == E_SUCCESS);

printf(
Expand Down

0 comments on commit d26e82d

Please sign in to comment.