forked from organicmaps/organicmaps
Fix illegal instruction when
This commit is contained in:
parent
9956de52ea
commit
69d59a86a4
4 changed files with 7 additions and 16 deletions
|
@ -234,7 +234,7 @@ public:
|
|||
vector<char> m_data;
|
||||
uint32_t m_offset;
|
||||
|
||||
read_source_t(...) : m_offset(0) {}
|
||||
read_source_t() : m_offset(0) {}
|
||||
|
||||
void assign(char const * data, uint32_t size)
|
||||
{
|
||||
|
|
|
@ -31,18 +31,17 @@ namespace feature
|
|||
template <class ToDo>
|
||||
void ForEachFromDatRawFormat(string const & fName, ToDo & toDo)
|
||||
{
|
||||
typedef ReaderSource<FileReader> source_t;
|
||||
|
||||
FileReader reader(fName);
|
||||
source_t src(reader);
|
||||
typename FeatureGeom::read_source_t buffer(fName);
|
||||
ReaderSource<FileReader> src(reader);
|
||||
|
||||
// skip header
|
||||
uint64_t currPos = feature::GetSkipHeaderSize(reader);
|
||||
src.Skip(currPos);
|
||||
|
||||
uint64_t const fSize = reader.Size();
|
||||
|
||||
// read features one by one
|
||||
typename FeatureGeom::read_source_t buffer;
|
||||
while (currPos < fSize)
|
||||
{
|
||||
FeatureGeom f;
|
||||
|
|
|
@ -89,22 +89,14 @@ namespace feature
|
|||
|
||||
FeaturesCollectorRef collector(datFilePath);
|
||||
|
||||
FeatureGeom::read_source_t buffer;
|
||||
for (size_t i = 0; i < midPoints.m_vec.size(); ++i)
|
||||
{
|
||||
ReaderSource<FileReader> src(reader);
|
||||
|
||||
// move to position
|
||||
src.Skip(midPoints.m_vec[i].second);
|
||||
|
||||
// read feature bytes
|
||||
uint32_t const sz = ReadVarUint<uint32_t>(src);
|
||||
FeatureGeom::read_source_t buffer;
|
||||
buffer.m_data.resize(sz);
|
||||
src.Read(&buffer.m_data[0], sz);
|
||||
|
||||
// FeatureGeom -> FeatureBuilderTypes
|
||||
FeatureGeom f;
|
||||
f.Deserialize(buffer);
|
||||
feature::ReadFromSource(src, f, buffer);
|
||||
|
||||
FeatureBuilderType fb;
|
||||
f.InitFeatureBuilder(fb);
|
||||
|
|
|
@ -16,4 +16,4 @@ then
|
|||
fi
|
||||
|
||||
$PV ../../../omim-maps/$2.osm.bz2 | bzip2 -d | $INDEXER_TOOL --generate_intermediate_data=true --generate_final_data=false --use_light_nodes=true --generate_index=false --intermediate_data_path=$TMPDIR
|
||||
$PV ../../../omim-maps/$2.osm.bz2 | bzip2 -d | $INDEXER_TOOL --generate_intermediate_data=false --generate_final_data=true --use_light_nodes=true --generate_index=true --sort_features --intermediate_data_path=$TMPDIR --output=$2 --bucketing_level=0
|
||||
$PV ../../../omim-maps/$2.osm.bz2 | bzip2 -d | $INDEXER_TOOL --generate_intermediate_data=false --generate_final_data=true --use_light_nodes=true --generate_index=true --sort_features=true --intermediate_data_path=$TMPDIR --output=$2 --bucketing_level=0
|
||||
|
|
Loading…
Add table
Reference in a new issue