From c99cad0dec4ce7f53561eea562eb3ee768a0a4bd Mon Sep 17 00:00:00 2001 From: AJ Friend Date: Tue, 29 Sep 2020 18:02:04 -0700 Subject: [PATCH] Prepare for release v3.7.0 (#395) * update changelog and fix @defgroup for exactEdgeLength * update docs * Changelog: Change CHANGELOG to match style of previous CHANGELOG changes * get reeeealy specific in the release steps --- .ycm_extra_conf.py | 92 ------------------------------------ CHANGELOG.md | 27 ++++++----- RELEASE.md | 4 +- VERSION | 2 +- docs/api/misc.md | 76 +++++++++++++++++++++++++++++ src/h3lib/include/h3api.h.in | 5 ++ 6 files changed, 101 insertions(+), 105 deletions(-) delete mode 100644 .ycm_extra_conf.py diff --git a/.ycm_extra_conf.py b/.ycm_extra_conf.py deleted file mode 100644 index a308d7db8..000000000 --- a/.ycm_extra_conf.py +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright (c) 2018, Uber Technologies, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import ycm_core - - -def DirectoryOfThisScript(): - return os.path.dirname( os.path.abspath( __file__ ) ) - - -project_dir = DirectoryOfThisScript() - -flags = [ -'-Wall', -'-Werror', -'-pedantic', -'-std=c11', -'-pthread', -'-x', -'c', -'-isystem', -'/usr/local/include', -'-I', -os.path.join(project_dir, 'src/h3lib/include'), -'-I', -os.path.join(project_dir, 'src/apps/applib/include') -] - -compilation_database_folder = os.path.join(project_dir, 'build') - -if os.path.exists( compilation_database_folder ): - database = ycm_core.CompilationDatabase( compilation_database_folder ) -else: - database = None - -SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ] - - -def IsHeaderFile( filename ): - extension = os.path.splitext( filename )[ 1 ] - return extension in [ '.h', '.hxx', '.hpp', '.hh' ] - - -def GetCompilationInfoForFile( filename ): - # The compilation_commands.json file generated by CMake does not have entries - # for header files. So we do our best by asking the db for flags for a - # corresponding source file, if any. If one exists, the flags for that file - # should be good enough. - if IsHeaderFile( filename ): - basename = os.path.splitext( filename )[ 0 ] - for extension in SOURCE_EXTENSIONS: - replacement_file = basename + extension - if os.path.exists( replacement_file ): - compilation_info = database.GetCompilationInfoForFile( - replacement_file ) - if compilation_info.compiler_flags_: - return compilation_info - return None - return database.GetCompilationInfoForFile( filename ) - - -def FlagsForFile( filename, **kwargs ): - if not database: - return { - 'flags': flags, - 'include_paths_relative_to_dir': DirectoryOfThisScript() - } - - compilation_info = GetCompilationInfoForFile( filename ) - if not compilation_info: - return None - - # Bear in mind that compilation_info.compiler_flags_ does NOT return a - # python list, but a "list-like" StringVec object. - final_flags = list( compilation_info.compiler_flags_ ) - - return { - 'flags': final_flags, - 'include_paths_relative_to_dir': compilation_info.compiler_working_dir_ - } diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ee201b36..1598defbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,17 +6,22 @@ The public API of this library consists of the functions declared in file [h3api.h.in](./src/h3lib/include/h3api.h.in). ## [Unreleased] -### Added -- area and haversine distance functions: - - cellAreaRads2 - - cellAreaKm2 - - cellAreaM2 - - pointDistRads - - pointDistKm - - pointDistM - - exactEdgeLengthRads - - exactEdgeLengthKm - - exactEdgeLengthM + +## [3.7.0] - 2020-09-28 +### Added +- Area and haversine distance functions (#377): + - `cellAreaRads2` + - `cellAreaKm2` + - `cellAreaM2` + - `pointDistRads` + - `pointDistKm` + - `pointDistM` + - `exactEdgeLengthRads` + - `exactEdgeLengthKm` + - `exactEdgeLengthM` +- Refactor `getH3UnidirectionalEdgeBoundary` for accuracy at small resolutions. (#391) + - Speeds up `getH3UnidirectionalEdgeBoundary` by about 3x. + - Implement core logic for future vertex mode. ### Fixed - Fixed building the library with custom memory allocation functions on Mac OSX. (#362) - The installed H3 CMake target should have include directories specified. (#381) diff --git a/RELEASE.md b/RELEASE.md index b22207535..3ae308b24 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -2,8 +2,10 @@ 1. Create a PR "Preparing for release X.Y.Z" against master branch * Alter CHANGELOG.md from `[Unreleased]` to `[X.Y.Z] YYYY-MM-DD` - * Run `make update-version` and give `X.Y.Z` when prompted + * Run `make update-version` and give `X.Y.Z` when prompted (this updates + the VERSION file, so don't change it manually) * Check that all merges that need to be in the changelog are present + * Get reviews and merge the PR 2. Create a release "Release X.Y.Z" on Github * Create Tag `vX.Y.Z` diff --git a/VERSION b/VERSION index 0f44168a4..7c69a55db 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.6.4 +3.7.0 diff --git a/docs/api/misc.md b/docs/api/misc.md index c607a8105..ae9912395 100644 --- a/docs/api/misc.md +++ b/docs/api/misc.md @@ -34,6 +34,30 @@ double hexAreaM2(int res); Average hexagon area in square meters at the given resolution. +## cellAreaKm2 + +``` +double cellAreaKm2(H3Index h); +``` + +Exact area of specific cell in square kilometers. + +## cellAreaM2 + +``` +double cellAreaM2(H3Index h); +``` + +Exact area of specific cell in square meters. + +## cellAreaRads2 + +``` +double cellAreaRads2(H3Index h); +``` + +Exact area of specific cell in square radians. + ## edgeLengthKm ``` @@ -50,6 +74,31 @@ double edgeLengthM(int res); Average hexagon edge length in meters at the given resolution. + +## exactEdgeLengthKm + +``` +double exactEdgeLengthKm(H3Index edge); +``` + +Exact edge length of specific unidirectional edge in kilometers. + +## exactEdgeLengthM + +``` +double exactEdgeLengthM(H3Index edge); +``` + +Exact edge length of specific unidirectional edge in meters. + +## exactEdgeLengthRads + +``` +double exactEdgeLengthRads(H3Index edge); +``` + +Exact edge length of specific unidirectional edge in radians. + ## numHexagons ``` @@ -91,3 +140,30 @@ int pentagonIndexCount(); ``` Number of pentagon **H3** indexes per resolution. This is always 12, but provided as a convenience. + +## pointDistKm + +``` +double pointDistKm(const GeoCoord *a, const GeoCoord *b); +``` + +Gives the "great circle" or "haversine" distance between pairs of +GeoCoord points (lat/lng pairs) in kilometers. + +## pointDistM + +``` +double pointDistM(const GeoCoord *a, const GeoCoord *b); +``` + +Gives the "great circle" or "haversine" distance between pairs of +GeoCoord points (lat/lng pairs) in meters. + +## pointDistRads + +``` +double pointDistRads(const GeoCoord *a, const GeoCoord *b); +``` + +Gives the "great circle" or "haversine" distance between pairs of +GeoCoord points (lat/lng pairs) in radians. diff --git a/src/h3lib/include/h3api.h.in b/src/h3lib/include/h3api.h.in index 44ba36b04..187f84378 100644 --- a/src/h3lib/include/h3api.h.in +++ b/src/h3lib/include/h3api.h.in @@ -301,7 +301,12 @@ double H3_EXPORT(edgeLengthKm)(int res); /** @brief average hexagon edge length in meters (excludes pentagons) */ double H3_EXPORT(edgeLengthM)(int res); +/** @} */ +/** @defgroup exactEdgeLength exactEdgeLength + * Functions for exactEdgeLength + * @{ + */ /** @brief exact length for a specific unidirectional edge in radians*/ double H3_EXPORT(exactEdgeLengthRads)(H3Index edge);