Feat: Implement logic for processing professional vender's pbf with OSRM

- Increase bits for node id due to definition in internal pbf is 64
bit range
- There are some very long tags in internal pbf, increase upper limit
for string definition.
- Add additional logs to debug pbf with long tags

Closes #7.
This commit is contained in:
CoderBear801 2019-06-14 15:49:43 -07:00 committed by Jay
parent fa37e1f618
commit df383d7e56
3 changed files with 4 additions and 2 deletions

View File

@ -11,7 +11,7 @@ namespace extractor
namespace detail namespace detail
{ {
template <storage::Ownership Ownership> template <storage::Ownership Ownership>
using PackedOSMIDs = util::detail::PackedVector<OSMNodeID, 33, Ownership>; using PackedOSMIDs = util::detail::PackedVector<OSMNodeID, 63, Ownership>;
} }
using PackedOSMIDsView = detail::PackedOSMIDs<storage::Ownership::View>; using PackedOSMIDsView = detail::PackedOSMIDs<storage::Ownership::View>;

View File

@ -105,6 +105,8 @@ namespace osmium {
while (pbf_string_table.next(OSMFormat::StringTable::repeated_bytes_s, protozero::pbf_wire_type::length_delimited)) { while (pbf_string_table.next(OSMFormat::StringTable::repeated_bytes_s, protozero::pbf_wire_type::length_delimited)) {
const auto str_view = pbf_string_table.get_view(); const auto str_view = pbf_string_table.get_view();
if (str_view.size() > osmium::max_osm_string_length) { if (str_view.size() > osmium::max_osm_string_length) {
std::cout<< "### Overlong string error(max-size, overlong-string-size, overlong-string-content)" << str_view.size() << " "
<< osmium::max_osm_string_length << " " << str_view.data() << std::endl;
throw osmium::pbf_error{"overlong string in string table"}; throw osmium::pbf_error{"overlong string in string table"};
} }
m_stringtable.emplace_back(str_view.data(), osmium::string_size_type(str_view.size())); m_stringtable.emplace_back(str_view.data(), osmium::string_size_type(str_view.size()));

View File

@ -66,7 +66,7 @@ namespace osmium {
using changeset_comment_size_type = uint32_t; using changeset_comment_size_type = uint32_t;
// maximum of 256 characters of max 4 bytes each (in UTF-8 encoding) // maximum of 256 characters of max 4 bytes each (in UTF-8 encoding)
constexpr const int max_osm_string_length = 256 * 4; constexpr const int max_osm_string_length = 256 * 128;
} // namespace osmium } // namespace osmium