osrm-backend/third_party/libosmium/NOTES_FOR_DEVELOPERS.md

134 lines
5.7 KiB
Markdown
Raw Normal View History

Squashed 'third_party/libosmium/' changes from 2282c84..80df1d6 80df1d6 Release v2.9.0 110dc5c Update change log. 6ad5829 Better handling of areas with duplicate segments. f5985ed Better exception message for invalid areas. fa09300 Explicit cast to make intent clear. 6f9b522 Fix name of struct stat on Windows. 6b0a47b Clean up code in data tests. aa1226c Fix progress bar. 3663a19 Extend ProgressBar class so that it works with multiple files. 40c4d5a Add version of file_size() taking a file name. 43a2fac Merge pull request #162 from osmcode/windows-build-scripts cc2305d [skip travis] 1st iteration of new build scripts 7abe4e1 Clean up disk location cache examples. 48841d5 Update change log. cf854e9 Change timestamp parser. 01aa8c7 Add examples osmium_pub_names and osmium_road_length. 483c9f2 Benchmark code cleanup. 3ffea2d Cleaned up some test code. 80f0ff7 Explicit conversion from int to bool. 0ba5918 Write space after progress bar to defend against glitches in output. 8584423 Change progress bar to take max_size on construction. d2c7585 Only call gzoffset when compiling with zlib > 1.2.4. 1b417e5 Add support for a progress report in osmium::io::Reader(). 3b4c8c8 Minor cleanup of appveyor config. d787e25 Fix OPL parser: Relation member without role at end of line. 53ca080 Make lots of variables const. d776ab2 Add to change log. eec3b62 Properly initialize m_data field. cc607e1 Take argument by const ref. be1e346 Remove unused function. 2a356ee Make lots of one-argument constructors explicit. adca74f Add comments to and cleanup up examples. 381e535 Simplify WKB code. b49efd8 Fix opl_parse_changeset_id() return type. bb52e57 Use uint64_t for line count and column to be on the safe side. 243f6a7 Use parentheses to make sure the right precedence is used. 5a7648e Consistently catch by const ref unless var needs to be non-const. e3be990 Avoid some warnings. c436d92 Do not include unistd.h on Windows. 95b228c Add dummy function to avoid warnings. f276ca3 Fixed includes and changelog update. 8c54bd9 Change timestamp error message. 27e1d5c Add OPL parser. 1d2caab Add more includes to osm.hpp to make usual osmium use simpler. 9d88361 More tests for area CRC. 4f8964d Initialize Item::m_diff member on construction. f2b648b Parse coordinates in scientific notations ourselves. b01323f More include fixes. 69f39d4 Fix some includes. 156536d Make padded_length a plain function, not a template function. 65cd1dc Extend functions to set Location lon/lat. 98b7b17 Update to protozero 1.4.2. a6420cf Add diff indicator to items and use for diff opl and debug output. 0ef02a3 Add workaround for YCM. 3a986f4 Update protozero version. 5245c5b Document osmium_count example program and add memory usage output. 796ca13 Document handler class. 2ba1c1f Add example for mercator projection and tiles. 201f744 Restrict tiles to zoom <= 30. 202291d Add member_type_string class. 494ed6e Cleaned up Tile tests. af13a8b Add documentation and range checks to Tile struct. 9df5d91 Some small changes to avoid conversion warnings. afac031 Explicit cast to avoid warning. 8188f66 Better contribution info. fa89d1d Fixed a problem limiting cache file sizes on Windows to 32 bit. 23a89df Remove obsolete info about versioning from CONTRIBUTING.md file. 115ae23 Release v2.8.0 4174b3c Style fix. 1795dcb Function wait_and_pop_with_timeout() is not needed any more. 4a3a71b Fix for possible threading problem. cc85925 Updated change log. 67bc8b1 Use unordered_map instead of map in PBF string table code. 18b7b66 Set better default for string table chunk size and document it. e6d7410 Remove dependency on sparsehash and boost program_options for examples. 14d92d6 Fix regression: Debug output of invalid location works again. ef91ce1 Bugfix: PBF String table corruption when there are many strings. 649af78 Remove DeltaEncodeIterator completely. 56e5ac2 Function getting queue sizes from environment uses default when getting 0. bfaab7d Add change log. d260339 Remove use of PROTOZERO_STRICT_API macro. c61722d Remove use of DeltaEncodeIterator simplifying code. f7c60b6 Updates for new protozero. 0bdfb9d Updated change log. bb56cbb Switch to newest protozero 1.4.0. 9e19a82 Add ccache support to CMake cnfig, better travis builds. 00d8868 Make I/O max queue sizes configurable via environment. dc7e504 Remove unused debugging code. 13f66a0 Track pop() calls and queue underruns when OSMIUM_DEBUG_QUEUE_SIZE is set. 5c2e367 Add EWKT support. 8f7c7d3 Automatically set correct SRID when creating geometries. ff11893 Better check of optional components in CMake config. 4562429 Use fallback implementation for coordinates given in scientific notation. 3bdf46e Mark enable_debug_output() as deprecated. ea1093e Update catch unit test framework. 8623f1e Release v2.7.2 e135dd8 Fix data corruption regression in mmap based indexes. adbd3b0 Do not output empty discussion tags in changeset XML output. 8126fbb Formatting. c6970fd Fix coordinate output. 3471b4b Resize output string once in output_int(). 0ddf0e7 Use our own function to convert integers to strings instead of printf. f9a1dd3 Reading and writing coordinates is now independant of locale. 8104294 Use hand-crafted function for hex output (faster than printf). 0bb452a Fix links in change log. 1862d06 Release v2.7.1 8bfe2ba Release v2.7.0 c3604f3 Use 64bit counter in area stats. 9e589b3 Update gdalcpp.hpp from upstream. fd55d9b Cleanup of OGR-related code. d0c53e0 Fix bug: Relation wasn't found correctly from member. 24145f9 Use make_iterator helper function. a8a287d Refactor count_not_removed function. (No template necessary.) 389332a Also print removed flag from member_meta. 5e7c5d0 Remove unnecessary overload of begin() and end() function in iterator_range. 2ec007f Do not add rings to invalid area, even if create_empty_areas is set. fee8b73 Optionally keep type tag in area assembler. Better doc for config. c7e1f8a Fix timer output in assembler code. 032ab40 Update change log. dcfa439 Node location store keeps track of whether node ids are ordered. 54d5eb8 Add tests for new file based index code. 4fe5b30 Use correct empty value when initializing index. 40b5c79 Static or not static, that is the question. aaa9b46 Open index file with minimum size, because zero-sized mmap is not allowed. fea2337 Fix for disk-based indexes. 428a413 More tests of corner cases for id to location index. 9d2a31b Add config option to areas assembler for only creating some areas. d11bf8d Count and report inner rings with the same tags as relation/outer rings. bde10c4 Speed up copy of tags. e4c9f87 Revert "Consistently remove some tags from area." 9cd7a03 Set areas assembly config setting create_empty_areas to true by default. 660fb63 Better ordering of OSMObjects. b4199c2 Use std::strcmp instead of just strcmp. 579c34b Better field width/precision in problem reporter. a2ebeeb Use field names with 8 characters or less in OGR problem reporter. ef523fe Switch remaining "typedef"s to "using". 19425f8 Switching from "typedef" to "using" in geom code. b13c2be More cases of switching from "typedef" to "using". 7f53977 Refactoring iterators: Not derived from std::iterator any more. 1922224 Consistently remove some tags from area. 295495f Fix check for detecting wrong role. 9aa6d46 Report more IDs in problem reporters. d7a5da7 Remove now unused spike segment reporter. 0666d66 Only report duplicate segments if they belong to the same way. 9e17f89 Improved error reporting for area assembler. e983a48 More code cleanup and docs. 927eeda Replace awkward std::pair construct by real class. d0543b9 Various area code refactorings. 0ae8f07 Do not build areas for ways with tag area=no. d4cabe7 Add some convenience functions to check for tags in TagList. 99f4be9 Add missing include. a8dda78 Travis: Only run tests if build succeeded. 9db3034 Add missing "nodes" fields. 50e9fcb Report ways that are in multiple rings as errors. 58a3669 Add some paranoia asserts. 3958c1d Use iterator_range to make equal_range results easier to use. c12c710 Add for_each_member() function to iterate over members of an mp relation. ca35452 Change argument order in create_area() functions. 4473ae1 Keep stats on multipolygons with no tags on the relation. 12c5335 Bugfix: Check that there is a problem reporter before using it. ec2afce Update change log. 5af2ec9 Use new area assembler interface in multipolygon collector. 73e3440 Some code cleanup in area code and new interface for calling assembler. 7737479 Add the number of nodes in area to problem reporter. b4f9343 Use const_iterator where possible. 02372b2 Simplify code that checks for open rings. 8d6099e Pull out location_to_ring_map into details ns and add == and < ops. 1a05042 Mixed code cleanups and added comments. 4b8d1be Ignore empty role when checking inner/outer roles on multipolygons. e22f573 Now GCC is complaining about the clang pragma... 48000c0 Add some missing includes and forward declarations. ba9504a Workaround for bug in old libc. a138265 Completely new algorithm for assembling multipolygons. 74054bd Add specialization of std::hash function for Location. 5ed4c90 Use newest gdalcpp.hpp with implicit transaction support. 676949e Add "locations_on_ways" support for OPL format, too. ce05c19 Add support for reading/writing XML/PBF files with locations on ways. 62b2ee4 Fix checksum test. bd512a8 Added "add_crc32" file option for adding CRC32 checksum to debug output. 3a100fa Incorporate locations in NodeRefs into CRC32 checksum. ac02f86 Update catch.hpp to newest version. Removed outdated info in README. 481f48b When assembling areas ignore ways containing no or only a single node. a0ae33a Fix unsigned overflow in pool.hpp. 91b8adf Fix undefined behaviour in WKB writer. 697f460 Check results of dynamic casts. f1e4571 Fix from_item_type() implementation so it also works with undefined type. 65df99b Add future_queue_type alias to simplify code. 4340e4d Removed SortedQueue implementation which was never used. cdd8f8c Add version.hpp with macros defining version of the library. ff5d42a Update to newest gdalcpp.hpp. a184f66 Update change log. 0ea76f7 Add osmium::Area::outer_rings() and inner_rings() functions. b0404b7 New ItemIteratorRange class for iteration over buffers and subitems. eff8a7c Add default type to string_to_object_id for IDs without type prefix. e877a6f Clean up code inner vs. outer ring in geometry factory. 9224be5 Disable use of XML entities in OSM files. 9d9fa08 Output operator of location shows full precision of coordinates. 9a8e7c0 Documentation fixes. git-subtree-dir: third_party/libosmium git-subtree-split: 80df1d6850bdfa661587839b77dcea0ab8fc814a
2016-10-03 13:08:59 -04:00
# Notes for Developers
Read this if you want to contribute to Libosmium.
## Namespace
All Osmium code MUST be in the `osmium` namespace or one of its sub-namespaces.
## Include-Only
Osmium is a include-only library. You can't compile the library itself. There
is no libosmium.so.
One drawback ist that you can't have static data in classes, because there
is no place to put this data.
All free functions must be declared `inline`.
## Coding Conventions
These coding conventions have been changing over time and some code is still
different.
* All include files have `#ifdef` guards around them, macros are the path name
in all uppercase where the slashes (`/`) have been changed to underscore (`_`).
* Class names begin with uppercase chars and use CamelCase. Smaller helper
classes are usually defined as struct and have lowercase names.
* Macros (and only macros) are all uppercase. Use macros sparingly, usually
a simple (maybe constexpr) inline function is better. Undef macros after use
if possible.
* Macros should only be used for controlling which parts of the code should be
included when compiling or to avoid major code repetitions.
* Variables, attributes, and function names are lowercase with
`underscores_between_words`.
* Class attribute names start with `m_` (member).
* Use `descriptive_variable_names`, exceptions are well-established conventions
like `i` for a loop variable. Iterators are usually called `it`.
* Declare variables where they are first used (C++ style), not at the beginning
of a function (old C style).
* Names from external namespaces (even `std`) are always mentioned explicitly.
Do not use `using` (except for `std::swap`). This way we can't even by
accident pollute the namespace of the code using Osmium.
* Always use the standard swap idiom: `using std::swap; swap(foo, bar);`.
* `#include` directives appear in three "blocks" after the copyright notice.
The blocks are separated by blank lines. First block contains `#include`s for
standard C/C++ includes, second block for any external libs used, third
block for osmium internal includes. Within each block `#include`s are usually
sorted by path name. All `#include`s use `<>` syntax not `""`.
* Names not to be used from outside the library should be in a namespace
called `detail` under the namespace where they would otherwise appear. If
whole include files are never meant to be included from outside they should
be in a subdirectory called `detail`.
* All files have suffix `.hpp`.
* Closing } of all classes and namespaces should have a trailing comment
with the name of the class/namespace.
* All constructors with one (or more arguments if they have a default) should
be declared "explicit" unless there is a reason for them not to be. Document
that reason.
* If a class has any of the special methods (copy/move constructor/assigment,
destructor) it should have all of them, possibly marking them as default or
deleted.
* Typedefs have `names_like_this_type` which end in `_type`. Typedefs should
use the new `using foo_type = bar` syntax instead of the old
`typedef bar foo_type`.
* Template parameters are single uppercase letters or start with uppercase `T`
and use CamelCase.
* Always use `typename` in templates, not `class`: `template <typename T>`.
* The ellipsis in variadic template never has a space to the left of it and
always has a space to the right: `template <typename... TArgs>` etc.
Squashed 'third_party/libosmium/' changes from d5ecf4d..c1f34c4 c1f34c4 Release v2.11.0 d3b72e0 Updated change log. 2982b8d Update embedded Protozero to version 1.5.1. cc1ab2a Add non-const WayNodeList::operator[]. 3da372e Add missing example to examples/README.md. 30604ba Add OSMIUM_USE_SLOW_MERCATOR_PROJECTION define. 47a92e0 Clearer CheckOrder handler doc. f11106d Formatting fixes. a870737 Use faster implementation of web mercator projection. 041bb42 Test cleanups. 8933bc5 Cleanup *Map::get() functions. 6b989ca Document that (Multipolygon)Collectors only work with unique Ids. 8fb5bd2 Updated included Protozero to version 1.5.0. 76e153d Removed Makefile. 35d7ec9 Update copyright date. a7f8126 Rename guard define to common scheme. a923c69 Cleanup I/O tests. d353993 Add Map::get_noexcept() method for all index maps. 94fa5ac Add const overload for mmap_vector_base::operator[]. 3cf9184 Add default constructed "invalid" Coordinates. 358f170 Add Tile constructor from web mercator coordinates. 006aa4c Add index::RelationsMap(Stash|Index) classes. 9cc842e Updated catch to v1.5.9. bd8c3b6 Use initializer_list trick instead of recursive template. 2c82a6f Merge pull request #183 from daniel-j-h/rvalue-apply 0bf5404 Implements rvalue handler support for apply, resolves #180. ccaab08 Merge pull request #182 from AMDmi3/freebsd-endianess bffe626 Handle endianess on FreeBSD properly 7250222 Code formatting and test cleanup. 6652436 Merge pull request #179 from oxidase/add_match_key_std_regex afadf5b Rename centroid variables and function in example. 8355284 Add envelope() functions to NodeRefList, Way, and Area. fc83d2e Remove unnecessary include. 9ddd00e Add match_key<std::regex> tag 9c54a53 Update README. Moved some infos to manual. 89a90a6 Update readme and developer docs. c3446ec Simplify subitem iteration code and made it more flexible. 542b07c Add some static_asserts. f0fd690 Memory reporting on M68k doesn't work properly. e8957c6 Compare doubles in test using Approx(). 58ae4a6 Add amenity_list example. 53783f8 Fix doxygen config for reproducible builds. de4e52d Release v2.10.3 0cc42a2 ObjectPointerCollection constructor can't be noexcept. 4472dfb Round out ObjectPointerCollection implementation and test it. 28cb35d Build with XCode 8 and GCC 6 on travis. 03e3e66 Upgrade to new protozero version 1.4.5. 2102c2f Add assertion in queue handling code. git-subtree-dir: third_party/libosmium git-subtree-split: c1f34c45507e233a2b9028663906679c610fe179
2017-01-20 08:05:21 -05:00
Keep to the indentation and other styles used in the code.
Squashed 'third_party/libosmium/' changes from 2282c84..80df1d6 80df1d6 Release v2.9.0 110dc5c Update change log. 6ad5829 Better handling of areas with duplicate segments. f5985ed Better exception message for invalid areas. fa09300 Explicit cast to make intent clear. 6f9b522 Fix name of struct stat on Windows. 6b0a47b Clean up code in data tests. aa1226c Fix progress bar. 3663a19 Extend ProgressBar class so that it works with multiple files. 40c4d5a Add version of file_size() taking a file name. 43a2fac Merge pull request #162 from osmcode/windows-build-scripts cc2305d [skip travis] 1st iteration of new build scripts 7abe4e1 Clean up disk location cache examples. 48841d5 Update change log. cf854e9 Change timestamp parser. 01aa8c7 Add examples osmium_pub_names and osmium_road_length. 483c9f2 Benchmark code cleanup. 3ffea2d Cleaned up some test code. 80f0ff7 Explicit conversion from int to bool. 0ba5918 Write space after progress bar to defend against glitches in output. 8584423 Change progress bar to take max_size on construction. d2c7585 Only call gzoffset when compiling with zlib > 1.2.4. 1b417e5 Add support for a progress report in osmium::io::Reader(). 3b4c8c8 Minor cleanup of appveyor config. d787e25 Fix OPL parser: Relation member without role at end of line. 53ca080 Make lots of variables const. d776ab2 Add to change log. eec3b62 Properly initialize m_data field. cc607e1 Take argument by const ref. be1e346 Remove unused function. 2a356ee Make lots of one-argument constructors explicit. adca74f Add comments to and cleanup up examples. 381e535 Simplify WKB code. b49efd8 Fix opl_parse_changeset_id() return type. bb52e57 Use uint64_t for line count and column to be on the safe side. 243f6a7 Use parentheses to make sure the right precedence is used. 5a7648e Consistently catch by const ref unless var needs to be non-const. e3be990 Avoid some warnings. c436d92 Do not include unistd.h on Windows. 95b228c Add dummy function to avoid warnings. f276ca3 Fixed includes and changelog update. 8c54bd9 Change timestamp error message. 27e1d5c Add OPL parser. 1d2caab Add more includes to osm.hpp to make usual osmium use simpler. 9d88361 More tests for area CRC. 4f8964d Initialize Item::m_diff member on construction. f2b648b Parse coordinates in scientific notations ourselves. b01323f More include fixes. 69f39d4 Fix some includes. 156536d Make padded_length a plain function, not a template function. 65cd1dc Extend functions to set Location lon/lat. 98b7b17 Update to protozero 1.4.2. a6420cf Add diff indicator to items and use for diff opl and debug output. 0ef02a3 Add workaround for YCM. 3a986f4 Update protozero version. 5245c5b Document osmium_count example program and add memory usage output. 796ca13 Document handler class. 2ba1c1f Add example for mercator projection and tiles. 201f744 Restrict tiles to zoom <= 30. 202291d Add member_type_string class. 494ed6e Cleaned up Tile tests. af13a8b Add documentation and range checks to Tile struct. 9df5d91 Some small changes to avoid conversion warnings. afac031 Explicit cast to avoid warning. 8188f66 Better contribution info. fa89d1d Fixed a problem limiting cache file sizes on Windows to 32 bit. 23a89df Remove obsolete info about versioning from CONTRIBUTING.md file. 115ae23 Release v2.8.0 4174b3c Style fix. 1795dcb Function wait_and_pop_with_timeout() is not needed any more. 4a3a71b Fix for possible threading problem. cc85925 Updated change log. 67bc8b1 Use unordered_map instead of map in PBF string table code. 18b7b66 Set better default for string table chunk size and document it. e6d7410 Remove dependency on sparsehash and boost program_options for examples. 14d92d6 Fix regression: Debug output of invalid location works again. ef91ce1 Bugfix: PBF String table corruption when there are many strings. 649af78 Remove DeltaEncodeIterator completely. 56e5ac2 Function getting queue sizes from environment uses default when getting 0. bfaab7d Add change log. d260339 Remove use of PROTOZERO_STRICT_API macro. c61722d Remove use of DeltaEncodeIterator simplifying code. f7c60b6 Updates for new protozero. 0bdfb9d Updated change log. bb56cbb Switch to newest protozero 1.4.0. 9e19a82 Add ccache support to CMake cnfig, better travis builds. 00d8868 Make I/O max queue sizes configurable via environment. dc7e504 Remove unused debugging code. 13f66a0 Track pop() calls and queue underruns when OSMIUM_DEBUG_QUEUE_SIZE is set. 5c2e367 Add EWKT support. 8f7c7d3 Automatically set correct SRID when creating geometries. ff11893 Better check of optional components in CMake config. 4562429 Use fallback implementation for coordinates given in scientific notation. 3bdf46e Mark enable_debug_output() as deprecated. ea1093e Update catch unit test framework. 8623f1e Release v2.7.2 e135dd8 Fix data corruption regression in mmap based indexes. adbd3b0 Do not output empty discussion tags in changeset XML output. 8126fbb Formatting. c6970fd Fix coordinate output. 3471b4b Resize output string once in output_int(). 0ddf0e7 Use our own function to convert integers to strings instead of printf. f9a1dd3 Reading and writing coordinates is now independant of locale. 8104294 Use hand-crafted function for hex output (faster than printf). 0bb452a Fix links in change log. 1862d06 Release v2.7.1 8bfe2ba Release v2.7.0 c3604f3 Use 64bit counter in area stats. 9e589b3 Update gdalcpp.hpp from upstream. fd55d9b Cleanup of OGR-related code. d0c53e0 Fix bug: Relation wasn't found correctly from member. 24145f9 Use make_iterator helper function. a8a287d Refactor count_not_removed function. (No template necessary.) 389332a Also print removed flag from member_meta. 5e7c5d0 Remove unnecessary overload of begin() and end() function in iterator_range. 2ec007f Do not add rings to invalid area, even if create_empty_areas is set. fee8b73 Optionally keep type tag in area assembler. Better doc for config. c7e1f8a Fix timer output in assembler code. 032ab40 Update change log. dcfa439 Node location store keeps track of whether node ids are ordered. 54d5eb8 Add tests for new file based index code. 4fe5b30 Use correct empty value when initializing index. 40b5c79 Static or not static, that is the question. aaa9b46 Open index file with minimum size, because zero-sized mmap is not allowed. fea2337 Fix for disk-based indexes. 428a413 More tests of corner cases for id to location index. 9d2a31b Add config option to areas assembler for only creating some areas. d11bf8d Count and report inner rings with the same tags as relation/outer rings. bde10c4 Speed up copy of tags. e4c9f87 Revert "Consistently remove some tags from area." 9cd7a03 Set areas assembly config setting create_empty_areas to true by default. 660fb63 Better ordering of OSMObjects. b4199c2 Use std::strcmp instead of just strcmp. 579c34b Better field width/precision in problem reporter. a2ebeeb Use field names with 8 characters or less in OGR problem reporter. ef523fe Switch remaining "typedef"s to "using". 19425f8 Switching from "typedef" to "using" in geom code. b13c2be More cases of switching from "typedef" to "using". 7f53977 Refactoring iterators: Not derived from std::iterator any more. 1922224 Consistently remove some tags from area. 295495f Fix check for detecting wrong role. 9aa6d46 Report more IDs in problem reporters. d7a5da7 Remove now unused spike segment reporter. 0666d66 Only report duplicate segments if they belong to the same way. 9e17f89 Improved error reporting for area assembler. e983a48 More code cleanup and docs. 927eeda Replace awkward std::pair construct by real class. d0543b9 Various area code refactorings. 0ae8f07 Do not build areas for ways with tag area=no. d4cabe7 Add some convenience functions to check for tags in TagList. 99f4be9 Add missing include. a8dda78 Travis: Only run tests if build succeeded. 9db3034 Add missing "nodes" fields. 50e9fcb Report ways that are in multiple rings as errors. 58a3669 Add some paranoia asserts. 3958c1d Use iterator_range to make equal_range results easier to use. c12c710 Add for_each_member() function to iterate over members of an mp relation. ca35452 Change argument order in create_area() functions. 4473ae1 Keep stats on multipolygons with no tags on the relation. 12c5335 Bugfix: Check that there is a problem reporter before using it. ec2afce Update change log. 5af2ec9 Use new area assembler interface in multipolygon collector. 73e3440 Some code cleanup in area code and new interface for calling assembler. 7737479 Add the number of nodes in area to problem reporter. b4f9343 Use const_iterator where possible. 02372b2 Simplify code that checks for open rings. 8d6099e Pull out location_to_ring_map into details ns and add == and < ops. 1a05042 Mixed code cleanups and added comments. 4b8d1be Ignore empty role when checking inner/outer roles on multipolygons. e22f573 Now GCC is complaining about the clang pragma... 48000c0 Add some missing includes and forward declarations. ba9504a Workaround for bug in old libc. a138265 Completely new algorithm for assembling multipolygons. 74054bd Add specialization of std::hash function for Location. 5ed4c90 Use newest gdalcpp.hpp with implicit transaction support. 676949e Add "locations_on_ways" support for OPL format, too. ce05c19 Add support for reading/writing XML/PBF files with locations on ways. 62b2ee4 Fix checksum test. bd512a8 Added "add_crc32" file option for adding CRC32 checksum to debug output. 3a100fa Incorporate locations in NodeRefs into CRC32 checksum. ac02f86 Update catch.hpp to newest version. Removed outdated info in README. 481f48b When assembling areas ignore ways containing no or only a single node. a0ae33a Fix unsigned overflow in pool.hpp. 91b8adf Fix undefined behaviour in WKB writer. 697f460 Check results of dynamic casts. f1e4571 Fix from_item_type() implementation so it also works with undefined type. 65df99b Add future_queue_type alias to simplify code. 4340e4d Removed SortedQueue implementation which was never used. cdd8f8c Add version.hpp with macros defining version of the library. ff5d42a Update to newest gdalcpp.hpp. a184f66 Update change log. 0ea76f7 Add osmium::Area::outer_rings() and inner_rings() functions. b0404b7 New ItemIteratorRange class for iteration over buffers and subitems. eff8a7c Add default type to string_to_object_id for IDs without type prefix. e877a6f Clean up code inner vs. outer ring in geometry factory. 9224be5 Disable use of XML entities in OSM files. 9d9fa08 Output operator of location shows full precision of coordinates. 9a8e7c0 Documentation fixes. git-subtree-dir: third_party/libosmium git-subtree-split: 80df1d6850bdfa661587839b77dcea0ab8fc814a
2016-10-03 13:08:59 -04:00
## C++11
Osmium uses C++11 and you can use its features such as auto, lambdas,
threading, etc. There are a few features we do not use, because even modern
compilers don't support them yet. This list might change as we get more data
about which compilers support which feature and what operating system versions
or distributions have which versions of these compilers installed.
Use `include/osmium/util/compatibility.hpp` if there are compatibility problems
between compilers due to different C++11 support.
## Operating systems
Usually all code must work on Linux, OSX, and Windows. Execptions are allowed
for some minor functionality, but please discuss this first.
## Checking your code
The Osmium makefiles use pretty draconian warning options for the compiler.
This is good. Code MUST never produce any warnings, even with those settings.
If absolutely necessary pragmas can be used to disable certain warnings in
specific areas of the code.
If the static code checker `cppcheck` is installed, the CMake configuration
will add a new build target `cppcheck` that will check all `.cpp` and `.hpp`
files. Cppcheck finds some bugs that gcc/clang doesn't. But take the result
with a grain of salt, it also sometimes produces wrong warnings.
Set `BUILD_HEADERS=ON` in the CMake config to enable compiling all include
files on their own to check whether dependencies are all okay. All include
files MUST include all other include files they depend on.
Call `cmake/iwyu.sh` to check for proper includes and forward declarations.
This uses the clang-based `include-what-you-use` program. Note that it does
produce some false reports and crashes often. The `osmium.imp` file can be
used to define mappings for iwyu. See the IWYU tool at
<http://code.google.com/p/include-what-you-use/>.
## Testing
There are a unit tests using the Catch Unit Test Framework in the `test`
directory and some data tests in `test/osm-testdata`. They are built by the
default cmake config. Run `ctest` to run them. Many more tests are needed.
## Documenting the code
All namespaces, classes, functions, attributes, etc. should be documented.
Squashed 'third_party/libosmium/' changes from d5ecf4d..c1f34c4 c1f34c4 Release v2.11.0 d3b72e0 Updated change log. 2982b8d Update embedded Protozero to version 1.5.1. cc1ab2a Add non-const WayNodeList::operator[]. 3da372e Add missing example to examples/README.md. 30604ba Add OSMIUM_USE_SLOW_MERCATOR_PROJECTION define. 47a92e0 Clearer CheckOrder handler doc. f11106d Formatting fixes. a870737 Use faster implementation of web mercator projection. 041bb42 Test cleanups. 8933bc5 Cleanup *Map::get() functions. 6b989ca Document that (Multipolygon)Collectors only work with unique Ids. 8fb5bd2 Updated included Protozero to version 1.5.0. 76e153d Removed Makefile. 35d7ec9 Update copyright date. a7f8126 Rename guard define to common scheme. a923c69 Cleanup I/O tests. d353993 Add Map::get_noexcept() method for all index maps. 94fa5ac Add const overload for mmap_vector_base::operator[]. 3cf9184 Add default constructed "invalid" Coordinates. 358f170 Add Tile constructor from web mercator coordinates. 006aa4c Add index::RelationsMap(Stash|Index) classes. 9cc842e Updated catch to v1.5.9. bd8c3b6 Use initializer_list trick instead of recursive template. 2c82a6f Merge pull request #183 from daniel-j-h/rvalue-apply 0bf5404 Implements rvalue handler support for apply, resolves #180. ccaab08 Merge pull request #182 from AMDmi3/freebsd-endianess bffe626 Handle endianess on FreeBSD properly 7250222 Code formatting and test cleanup. 6652436 Merge pull request #179 from oxidase/add_match_key_std_regex afadf5b Rename centroid variables and function in example. 8355284 Add envelope() functions to NodeRefList, Way, and Area. fc83d2e Remove unnecessary include. 9ddd00e Add match_key<std::regex> tag 9c54a53 Update README. Moved some infos to manual. 89a90a6 Update readme and developer docs. c3446ec Simplify subitem iteration code and made it more flexible. 542b07c Add some static_asserts. f0fd690 Memory reporting on M68k doesn't work properly. e8957c6 Compare doubles in test using Approx(). 58ae4a6 Add amenity_list example. 53783f8 Fix doxygen config for reproducible builds. de4e52d Release v2.10.3 0cc42a2 ObjectPointerCollection constructor can't be noexcept. 4472dfb Round out ObjectPointerCollection implementation and test it. 28cb35d Build with XCode 8 and GCC 6 on travis. 03e3e66 Upgrade to new protozero version 1.4.5. 2102c2f Add assertion in queue handling code. git-subtree-dir: third_party/libosmium git-subtree-split: c1f34c45507e233a2b9028663906679c610fe179
2017-01-20 08:05:21 -05:00
Osmium uses the [Doxygen](http://www.doxygen.org) source code documentation
system. If it is installed, the CMake configuration will add a new build
target, so you can build it with `make doc`.
Squashed 'third_party/libosmium/' changes from 2282c84..80df1d6 80df1d6 Release v2.9.0 110dc5c Update change log. 6ad5829 Better handling of areas with duplicate segments. f5985ed Better exception message for invalid areas. fa09300 Explicit cast to make intent clear. 6f9b522 Fix name of struct stat on Windows. 6b0a47b Clean up code in data tests. aa1226c Fix progress bar. 3663a19 Extend ProgressBar class so that it works with multiple files. 40c4d5a Add version of file_size() taking a file name. 43a2fac Merge pull request #162 from osmcode/windows-build-scripts cc2305d [skip travis] 1st iteration of new build scripts 7abe4e1 Clean up disk location cache examples. 48841d5 Update change log. cf854e9 Change timestamp parser. 01aa8c7 Add examples osmium_pub_names and osmium_road_length. 483c9f2 Benchmark code cleanup. 3ffea2d Cleaned up some test code. 80f0ff7 Explicit conversion from int to bool. 0ba5918 Write space after progress bar to defend against glitches in output. 8584423 Change progress bar to take max_size on construction. d2c7585 Only call gzoffset when compiling with zlib > 1.2.4. 1b417e5 Add support for a progress report in osmium::io::Reader(). 3b4c8c8 Minor cleanup of appveyor config. d787e25 Fix OPL parser: Relation member without role at end of line. 53ca080 Make lots of variables const. d776ab2 Add to change log. eec3b62 Properly initialize m_data field. cc607e1 Take argument by const ref. be1e346 Remove unused function. 2a356ee Make lots of one-argument constructors explicit. adca74f Add comments to and cleanup up examples. 381e535 Simplify WKB code. b49efd8 Fix opl_parse_changeset_id() return type. bb52e57 Use uint64_t for line count and column to be on the safe side. 243f6a7 Use parentheses to make sure the right precedence is used. 5a7648e Consistently catch by const ref unless var needs to be non-const. e3be990 Avoid some warnings. c436d92 Do not include unistd.h on Windows. 95b228c Add dummy function to avoid warnings. f276ca3 Fixed includes and changelog update. 8c54bd9 Change timestamp error message. 27e1d5c Add OPL parser. 1d2caab Add more includes to osm.hpp to make usual osmium use simpler. 9d88361 More tests for area CRC. 4f8964d Initialize Item::m_diff member on construction. f2b648b Parse coordinates in scientific notations ourselves. b01323f More include fixes. 69f39d4 Fix some includes. 156536d Make padded_length a plain function, not a template function. 65cd1dc Extend functions to set Location lon/lat. 98b7b17 Update to protozero 1.4.2. a6420cf Add diff indicator to items and use for diff opl and debug output. 0ef02a3 Add workaround for YCM. 3a986f4 Update protozero version. 5245c5b Document osmium_count example program and add memory usage output. 796ca13 Document handler class. 2ba1c1f Add example for mercator projection and tiles. 201f744 Restrict tiles to zoom <= 30. 202291d Add member_type_string class. 494ed6e Cleaned up Tile tests. af13a8b Add documentation and range checks to Tile struct. 9df5d91 Some small changes to avoid conversion warnings. afac031 Explicit cast to avoid warning. 8188f66 Better contribution info. fa89d1d Fixed a problem limiting cache file sizes on Windows to 32 bit. 23a89df Remove obsolete info about versioning from CONTRIBUTING.md file. 115ae23 Release v2.8.0 4174b3c Style fix. 1795dcb Function wait_and_pop_with_timeout() is not needed any more. 4a3a71b Fix for possible threading problem. cc85925 Updated change log. 67bc8b1 Use unordered_map instead of map in PBF string table code. 18b7b66 Set better default for string table chunk size and document it. e6d7410 Remove dependency on sparsehash and boost program_options for examples. 14d92d6 Fix regression: Debug output of invalid location works again. ef91ce1 Bugfix: PBF String table corruption when there are many strings. 649af78 Remove DeltaEncodeIterator completely. 56e5ac2 Function getting queue sizes from environment uses default when getting 0. bfaab7d Add change log. d260339 Remove use of PROTOZERO_STRICT_API macro. c61722d Remove use of DeltaEncodeIterator simplifying code. f7c60b6 Updates for new protozero. 0bdfb9d Updated change log. bb56cbb Switch to newest protozero 1.4.0. 9e19a82 Add ccache support to CMake cnfig, better travis builds. 00d8868 Make I/O max queue sizes configurable via environment. dc7e504 Remove unused debugging code. 13f66a0 Track pop() calls and queue underruns when OSMIUM_DEBUG_QUEUE_SIZE is set. 5c2e367 Add EWKT support. 8f7c7d3 Automatically set correct SRID when creating geometries. ff11893 Better check of optional components in CMake config. 4562429 Use fallback implementation for coordinates given in scientific notation. 3bdf46e Mark enable_debug_output() as deprecated. ea1093e Update catch unit test framework. 8623f1e Release v2.7.2 e135dd8 Fix data corruption regression in mmap based indexes. adbd3b0 Do not output empty discussion tags in changeset XML output. 8126fbb Formatting. c6970fd Fix coordinate output. 3471b4b Resize output string once in output_int(). 0ddf0e7 Use our own function to convert integers to strings instead of printf. f9a1dd3 Reading and writing coordinates is now independant of locale. 8104294 Use hand-crafted function for hex output (faster than printf). 0bb452a Fix links in change log. 1862d06 Release v2.7.1 8bfe2ba Release v2.7.0 c3604f3 Use 64bit counter in area stats. 9e589b3 Update gdalcpp.hpp from upstream. fd55d9b Cleanup of OGR-related code. d0c53e0 Fix bug: Relation wasn't found correctly from member. 24145f9 Use make_iterator helper function. a8a287d Refactor count_not_removed function. (No template necessary.) 389332a Also print removed flag from member_meta. 5e7c5d0 Remove unnecessary overload of begin() and end() function in iterator_range. 2ec007f Do not add rings to invalid area, even if create_empty_areas is set. fee8b73 Optionally keep type tag in area assembler. Better doc for config. c7e1f8a Fix timer output in assembler code. 032ab40 Update change log. dcfa439 Node location store keeps track of whether node ids are ordered. 54d5eb8 Add tests for new file based index code. 4fe5b30 Use correct empty value when initializing index. 40b5c79 Static or not static, that is the question. aaa9b46 Open index file with minimum size, because zero-sized mmap is not allowed. fea2337 Fix for disk-based indexes. 428a413 More tests of corner cases for id to location index. 9d2a31b Add config option to areas assembler for only creating some areas. d11bf8d Count and report inner rings with the same tags as relation/outer rings. bde10c4 Speed up copy of tags. e4c9f87 Revert "Consistently remove some tags from area." 9cd7a03 Set areas assembly config setting create_empty_areas to true by default. 660fb63 Better ordering of OSMObjects. b4199c2 Use std::strcmp instead of just strcmp. 579c34b Better field width/precision in problem reporter. a2ebeeb Use field names with 8 characters or less in OGR problem reporter. ef523fe Switch remaining "typedef"s to "using". 19425f8 Switching from "typedef" to "using" in geom code. b13c2be More cases of switching from "typedef" to "using". 7f53977 Refactoring iterators: Not derived from std::iterator any more. 1922224 Consistently remove some tags from area. 295495f Fix check for detecting wrong role. 9aa6d46 Report more IDs in problem reporters. d7a5da7 Remove now unused spike segment reporter. 0666d66 Only report duplicate segments if they belong to the same way. 9e17f89 Improved error reporting for area assembler. e983a48 More code cleanup and docs. 927eeda Replace awkward std::pair construct by real class. d0543b9 Various area code refactorings. 0ae8f07 Do not build areas for ways with tag area=no. d4cabe7 Add some convenience functions to check for tags in TagList. 99f4be9 Add missing include. a8dda78 Travis: Only run tests if build succeeded. 9db3034 Add missing "nodes" fields. 50e9fcb Report ways that are in multiple rings as errors. 58a3669 Add some paranoia asserts. 3958c1d Use iterator_range to make equal_range results easier to use. c12c710 Add for_each_member() function to iterate over members of an mp relation. ca35452 Change argument order in create_area() functions. 4473ae1 Keep stats on multipolygons with no tags on the relation. 12c5335 Bugfix: Check that there is a problem reporter before using it. ec2afce Update change log. 5af2ec9 Use new area assembler interface in multipolygon collector. 73e3440 Some code cleanup in area code and new interface for calling assembler. 7737479 Add the number of nodes in area to problem reporter. b4f9343 Use const_iterator where possible. 02372b2 Simplify code that checks for open rings. 8d6099e Pull out location_to_ring_map into details ns and add == and < ops. 1a05042 Mixed code cleanups and added comments. 4b8d1be Ignore empty role when checking inner/outer roles on multipolygons. e22f573 Now GCC is complaining about the clang pragma... 48000c0 Add some missing includes and forward declarations. ba9504a Workaround for bug in old libc. a138265 Completely new algorithm for assembling multipolygons. 74054bd Add specialization of std::hash function for Location. 5ed4c90 Use newest gdalcpp.hpp with implicit transaction support. 676949e Add "locations_on_ways" support for OPL format, too. ce05c19 Add support for reading/writing XML/PBF files with locations on ways. 62b2ee4 Fix checksum test. bd512a8 Added "add_crc32" file option for adding CRC32 checksum to debug output. 3a100fa Incorporate locations in NodeRefs into CRC32 checksum. ac02f86 Update catch.hpp to newest version. Removed outdated info in README. 481f48b When assembling areas ignore ways containing no or only a single node. a0ae33a Fix unsigned overflow in pool.hpp. 91b8adf Fix undefined behaviour in WKB writer. 697f460 Check results of dynamic casts. f1e4571 Fix from_item_type() implementation so it also works with undefined type. 65df99b Add future_queue_type alias to simplify code. 4340e4d Removed SortedQueue implementation which was never used. cdd8f8c Add version.hpp with macros defining version of the library. ff5d42a Update to newest gdalcpp.hpp. a184f66 Update change log. 0ea76f7 Add osmium::Area::outer_rings() and inner_rings() functions. b0404b7 New ItemIteratorRange class for iteration over buffers and subitems. eff8a7c Add default type to string_to_object_id for IDs without type prefix. e877a6f Clean up code inner vs. outer ring in geometry factory. 9224be5 Disable use of XML entities in OSM files. 9d9fa08 Output operator of location shows full precision of coordinates. 9a8e7c0 Documentation fixes. git-subtree-dir: third_party/libosmium git-subtree-split: 80df1d6850bdfa661587839b77dcea0ab8fc814a
2016-10-03 13:08:59 -04:00