Skip to content

Commit

Permalink
Merge 9917a2e into b6b8cf0
Browse files Browse the repository at this point in the history
  • Loading branch information
keisar committed Apr 24, 2020
2 parents b6b8cf0 + 9917a2e commit 8a96f7a
Show file tree
Hide file tree
Showing 74 changed files with 780 additions and 456 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Expand Up @@ -26,3 +26,9 @@ _testmain.go

# Editor cruft
*.sw[op]

# Workspace files
.idea

# Intellij project files
.idea
6 changes: 3 additions & 3 deletions h3.go
Expand Up @@ -21,11 +21,11 @@ package h3
/*
#cgo CFLAGS: -std=c99
#cgo CFLAGS: -DH3_HAVE_VLA=1
#cgo CFLAGS: -I ${SRCDIR}/include
#cgo CFLAGS: -I ${SRCDIR}
#cgo LDFLAGS: -lm
#include <stdlib.h>
#include <h3api.h>
#include <h3Index.h>
#include <h3_h3api.h>
#include <h3_h3Index.h>
*/
import "C"
import (
Expand Down
22 changes: 11 additions & 11 deletions h3_algos.c
Expand Up @@ -17,21 +17,21 @@
* @brief Hexagon grid algorithms
*/

#include "algos.h"
#include "h3_algos.h"
#include <float.h>
#include <math.h>
#include <stdbool.h>
#include <stdlib.h>
#include "baseCells.h"
#include "bbox.h"
#include "faceijk.h"
#include "geoCoord.h"
#include "h3Index.h"
#include "h3api.h"
#include "linkedGeo.h"
#include "polygon.h"
#include "stackAlloc.h"
#include "vertexGraph.h"
#include "h3_baseCells.h"
#include "h3_bbox.h"
#include "h3_faceijk.h"
#include "h3_geoCoord.h"
#include "h3_h3Index.h"
#include "h3_h3api.h"
#include "h3_linkedGeo.h"
#include "h3_polygon.h"
#include "h3_stackAlloc.h"
#include "h3_vertexGraph.h"

/*
* Return codes from hexRange and related functions.
Expand Down
10 changes: 5 additions & 5 deletions include/algos.h → h3_algos.h
Expand Up @@ -20,11 +20,11 @@
#ifndef ALGOS_H
#define ALGOS_H

#include "bbox.h"
#include "coordijk.h"
#include "h3api.h"
#include "linkedGeo.h"
#include "vertexGraph.h"
#include "h3_bbox.h"
#include "h3_coordijk.h"
#include "h3_h3api.h"
#include "h3_linkedGeo.h"
#include "h3_vertexGraph.h"

// neighbor along the ijk coordinate system of the current face, rotated
H3Index h3NeighborRotations(H3Index origin, Direction dir, int* rotations);
Expand Down
6 changes: 3 additions & 3 deletions h3_baseCells.c
Expand Up @@ -17,8 +17,8 @@
* @brief Base cell related lookup tables and access functions.
*/

#include "baseCells.h"
#include "h3Index.h"
#include "h3_baseCells.h"
#include "h3_h3Index.h"

/** @struct BaseCellOrient
* @brief base cell at a given ijk and required rotations into its system
Expand Down Expand Up @@ -908,4 +908,4 @@ void H3_EXPORT(getRes0Indexes)(H3Index* out) {
H3_SET_BASE_CELL(baseCell, bc);
out[bc] = baseCell;
}
}
}
6 changes: 3 additions & 3 deletions include/baseCells.h → h3_baseCells.h
Expand Up @@ -20,9 +20,9 @@
#ifndef BASECELLS_H
#define BASECELLS_H

#include "constants.h"
#include "coordijk.h"
#include "faceijk.h"
#include "h3_constants.h"
#include "h3_coordijk.h"
#include "h3_faceijk.h"

/** @struct BaseCellData
* @brief information on a single base cell
Expand Down
8 changes: 4 additions & 4 deletions h3_bbox.c
Expand Up @@ -17,13 +17,13 @@
* @brief Geographic bounding box functions
*/

#include "bbox.h"
#include "h3_bbox.h"
#include <float.h>
#include <math.h>
#include <stdbool.h>
#include "constants.h"
#include "geoCoord.h"
#include "h3Index.h"
#include "h3_constants.h"
#include "h3_geoCoord.h"
#include "h3_h3Index.h"

/**
* Whether the given bounding box crosses the antimeridian
Expand Down
2 changes: 1 addition & 1 deletion v3/include/bbox.h → h3_bbox.h
Expand Up @@ -21,7 +21,7 @@
#define BBOX_H

#include <stdbool.h>
#include "geoCoord.h"
#include "h3_geoCoord.h"

/** @struct BBox
* @brief Geographic bounding box with coordinates defined in radians
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions h3_coordijk.c
Expand Up @@ -18,14 +18,14 @@
* lat/lon.
*/

#include "coordijk.h"
#include "h3_coordijk.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "constants.h"
#include "geoCoord.h"
#include "mathExtensions.h"
#include "h3_constants.h"
#include "h3_geoCoord.h"
#include "h3_mathExtensions.h"

/**
* Sets an IJK coordinate to the specified component values.
Expand Down Expand Up @@ -551,4 +551,4 @@ void cubeToIjk(CoordIJK* ijk) {
ijk->i = -ijk->i;
ijk->k = 0;
_ijkNormalize(ijk);
}
}
6 changes: 3 additions & 3 deletions v3/include/coordijk.h → h3_coordijk.h
Expand Up @@ -30,9 +30,9 @@
#ifndef COORDIJK_H
#define COORDIJK_H

#include "geoCoord.h"
#include "h3api.h"
#include "vec2d.h"
#include "h3_geoCoord.h"
#include "h3_h3api.h"
#include "h3_vec2d.h"

/** @struct CoordIJK
* @brief IJK hexagon coordinates
Expand Down
12 changes: 6 additions & 6 deletions h3_faceijk.c
Expand Up @@ -18,17 +18,17 @@
* coordinate systems.
*/

#include "faceijk.h"
#include "h3_faceijk.h"
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "constants.h"
#include "coordijk.h"
#include "geoCoord.h"
#include "h3Index.h"
#include "vec3d.h"
#include "h3_constants.h"
#include "h3_coordijk.h"
#include "h3_geoCoord.h"
#include "h3_h3Index.h"
#include "h3_vec3d.h"

/** square root of 7 */
#define M_SQRT7 2.6457513110645905905016157536392604257102L
Expand Down
6 changes: 3 additions & 3 deletions include/faceijk.h → h3_faceijk.h
Expand Up @@ -24,9 +24,9 @@
#ifndef FACEIJK_H
#define FACEIJK_H

#include "coordijk.h"
#include "geoCoord.h"
#include "vec2d.h"
#include "h3_coordijk.h"
#include "h3_geoCoord.h"
#include "h3_vec2d.h"

/** @struct FaceIJK
* @brief Face number and ijk coordinates on that face-centered coordinate
Expand Down
6 changes: 3 additions & 3 deletions h3_geoCoord.c
Expand Up @@ -17,11 +17,11 @@
* @brief Functions for working with lat/lon coordinates.
*/

#include "geoCoord.h"
#include "h3_geoCoord.h"
#include <math.h>
#include <stdbool.h>
#include "constants.h"
#include "h3api.h"
#include "h3_constants.h"
#include "h3_h3api.h"

/**
* Normalizes radians to a value between 0.0 and two PI.
Expand Down
4 changes: 2 additions & 2 deletions v3/include/geoCoord.h → h3_geoCoord.h
Expand Up @@ -23,8 +23,8 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include "constants.h"
#include "h3api.h"
#include "h3_constants.h"
#include "h3_h3api.h"

/** epsilon of ~0.1mm in degrees */
#define EPSILON_DEG .000000001
Expand Down
11 changes: 5 additions & 6 deletions h3_h3Index.c
Expand Up @@ -17,16 +17,15 @@
* @brief H3Index utility functions
* (see h3api.h for the main library entry functions)
*/
#include "h3Index.h"
#include <faceijk.h>
#include "h3_h3Index.h"
#include <inttypes.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "baseCells.h"
#include "faceijk.h"
#include "mathExtensions.h"
#include "stackAlloc.h"
#include "h3_baseCells.h"
#include "h3_faceijk.h"
#include "h3_mathExtensions.h"
#include "h3_stackAlloc.h"

/**
* Returns the H3 resolution of an H3 index.
Expand Down
4 changes: 2 additions & 2 deletions v3/include/h3Index.h → h3_h3Index.h
Expand Up @@ -20,8 +20,8 @@
#ifndef H3INDEX_H
#define H3INDEX_H

#include "faceijk.h"
#include "h3api.h"
#include "h3_faceijk.h"
#include "h3_h3api.h"

// define's of constants and macros for bitwise manipulation of H3Index's.

Expand Down
10 changes: 5 additions & 5 deletions h3_h3UniEdge.c
Expand Up @@ -19,11 +19,11 @@

#include <inttypes.h>
#include <stdbool.h>
#include "algos.h"
#include "constants.h"
#include "coordijk.h"
#include "geoCoord.h"
#include "h3Index.h"
#include "h3_algos.h"
#include "h3_constants.h"
#include "h3_coordijk.h"
#include "h3_geoCoord.h"
#include "h3_h3Index.h"

/**
* Returns whether or not the provided H3Indexes are neighbors.
Expand Down
4 changes: 2 additions & 2 deletions include/h3UniEdge.h → h3_h3UniEdge.h
Expand Up @@ -20,8 +20,8 @@
#ifndef H3UNIEDGE_H
#define H3UNIEDGE_H

#include "algos.h"
#include "h3Index.h"
#include "h3_algos.h"
#include "h3_h3Index.h"

// nothing non-public in this file

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions h3_linkedGeo.c
Expand Up @@ -17,11 +17,11 @@
* @brief Linked data structure for geo data
*/

#include "linkedGeo.h"
#include "h3_linkedGeo.h"
#include <assert.h>
#include <stdlib.h>
#include "geoCoord.h"
#include "h3api.h"
#include "h3_geoCoord.h"
#include "h3_h3api.h"

/**
* Add a linked polygon to the current polygon
Expand Down Expand Up @@ -367,7 +367,7 @@ int normalizeMultiPolygon(LinkedGeoPolygon* root) {
#define ITERATE ITERATE_LINKED_LOOP
#define IS_EMPTY IS_EMPTY_LINKED_LOOP

#include "polygonAlgos.h"
#include "h3_polygonAlgos.h"

#undef TYPE
#undef IS_EMPTY
Expand Down
6 changes: 3 additions & 3 deletions v3/include/linkedGeo.h → h3_linkedGeo.h
Expand Up @@ -21,9 +21,9 @@
#define LINKED_GEO_H

#include <stdlib.h>
#include "bbox.h"
#include "geoCoord.h"
#include "h3api.h"
#include "h3_bbox.h"
#include "h3_geoCoord.h"
#include "h3_h3api.h"

// Error codes for normalizeMultiPolygon
#define NORMALIZATION_SUCCESS 0
Expand Down
11 changes: 5 additions & 6 deletions h3_localij.c
Expand Up @@ -19,16 +19,15 @@
* These functions try to provide a useful coordinate space in the vicinity of
* an origin index.
*/
#include <faceijk.h>
#include <inttypes.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "baseCells.h"
#include "faceijk.h"
#include "h3Index.h"
#include "mathExtensions.h"
#include "stackAlloc.h"
#include "h3_baseCells.h"
#include "h3_faceijk.h"
#include "h3_h3Index.h"
#include "h3_mathExtensions.h"
#include "h3_stackAlloc.h"

/**
* Origin leading digit -> index leading digit -> rotations 60 cw
Expand Down
4 changes: 2 additions & 2 deletions v3/include/localij.h → h3_localij.h
Expand Up @@ -20,8 +20,8 @@
#ifndef LOCALIJ_H
#define LOCALIJ_H

#include "coordijk.h"
#include "h3api.h"
#include "h3_coordijk.h"
#include "h3_h3api.h"

int h3ToLocalIjk(H3Index origin, H3Index h3, CoordIJK* out);
int localIjkToH3(H3Index origin, const CoordIJK* ijk, H3Index* out);
Expand Down
2 changes: 1 addition & 1 deletion h3_mathExtensions.c
Expand Up @@ -17,7 +17,7 @@
* @brief Math functions that should've been in math.h but aren't
*/

#include "mathExtensions.h"
#include "h3_mathExtensions.h"

/**
* _ipow does integer exponentiation efficiently. Taken from StackOverflow.
Expand Down
File renamed without changes.

0 comments on commit 8a96f7a

Please sign in to comment.