Skip to content

Commit

Permalink
chore: update h3 dependency to v4 (#55)
Browse files Browse the repository at this point in the history
Moving from RC to release!
  • Loading branch information
jogly authored Sep 8, 2022
1 parent 1665ba6 commit 85023b1
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 54 deletions.
2 changes: 1 addition & 1 deletion H3_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v4.0.0-rc4
v4.0.0
20 changes: 10 additions & 10 deletions h3.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,32 +334,32 @@ func HexagonEdgeLengthAvgM(resolution int) float64 {
return float64(out)
}

// ExactEdgeLengthRads returns the exact edge length of specific unidirectional
// edge in radians.
func ExactEdgeLengthRads(e DirectedEdge) float64 {
// EdgeLengthRads returns the exact edge length of specific unidirectional edge
// in radians.
func EdgeLengthRads(e DirectedEdge) float64 {
var out C.double

C.exactEdgeLengthRads(C.H3Index(e), &out)
C.edgeLengthRads(C.H3Index(e), &out)

return float64(out)
}

// ExactEdgeLengthKm returns the exact edge length of specific unidirectional
// EdgeLengthKm returns the exact edge length of specific unidirectional
// edge in kilometers.
func ExactEdgeLengthKm(e DirectedEdge) float64 {
func EdgeLengthKm(e DirectedEdge) float64 {
var out C.double

C.exactEdgeLengthKm(C.H3Index(e), &out)
C.edgeLengthKm(C.H3Index(e), &out)

return float64(out)
}

// ExactEdgeLengthM returns the exact edge length of specific unidirectional
// EdgeLengthM returns the exact edge length of specific unidirectional
// edge in meters.
func ExactEdgeLengthM(e DirectedEdge) float64 {
func EdgeLengthM(e DirectedEdge) float64 {
var out C.double

C.exactEdgeLengthM(C.H3Index(e), &out)
C.edgeLengthM(C.H3Index(e), &out)

return float64(out)
}
Expand Down
18 changes: 13 additions & 5 deletions h3_algos.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 33 additions & 16 deletions h3_bbox.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions h3_bbox.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion h3_constants.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions h3_h3api.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions h3_latLng.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions h3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,22 +481,22 @@ func TestHexagonEdgeLengthM(t *testing.T) {
})
}

func TestExactEdgeLengthRads(t *testing.T) {
func TestEdgeLengthRads(t *testing.T) {
t.Parallel()
assertEqualEps(t, float64(0.001569665746947077), ExactEdgeLengthRads(validEdge))
assertEqualEps(t, float64(0.001569665746947077), EdgeLengthRads(validEdge))
}

func TestExactEdgeLengthKm(t *testing.T) {
func TestEdgeLengthKm(t *testing.T) {
t.Parallel()

distance := ExactEdgeLengthKm(validEdge)
distance := EdgeLengthKm(validEdge)
assertEqualEps(t, float64(10.00035174544159), distance)
}

func TestExactEdgeLengthM(t *testing.T) {
func TestEdgeLengthM(t *testing.T) {
t.Parallel()

distance := ExactEdgeLengthM(validEdge)
distance := EdgeLengthM(validEdge)
assertEqualEps(t, float64(10000.351745441589), distance)
}

Expand Down
3 changes: 1 addition & 2 deletions h3_vertex.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 85023b1

Please sign in to comment.