libosmscout  1.1.1
Classes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
osmscout::AreaIndexGenerator< Object > Class Template Referenceabstract

#include <libosmscout-import/include/osmscout/import/AreaIndexGenerator.h>

Inheritance diagram for osmscout::AreaIndexGenerator< Object >:
Inheritance graph
[legend]
Collaboration diagram for osmscout::AreaIndexGenerator< Object >:
Collaboration graph
[legend]

Classes

struct  TypeData
 

Protected Types

using CoordCountMap = std::map< TileId, size_t >
 
using CoordOffsetsMap = std::map< TileId, std::list< FileOffset > >
 

Protected Member Functions

 AreaIndexGenerator (const std::string &typeName, const std::string &typeNamePlural, const std::string &dataFile, const std::string &indexFile)
 
virtual bool FitsIndexCriteria (Progress &progress, const TypeInfo &typeInfo, const CoordCountMap &cellFillCount) const
 
void CalculateStatistics (const MagnificationLevel &level, TypeData &typeData, const CoordCountMap &cellFillCount) const
 
bool CalculateDistribution (const TypeConfig &typeConfig, const ImportParameter &parameter, Progress &progress, const std::vector< TypeInfoRef > &types, std::vector< TypeData > &typeData, const MagnificationLevel &minLevelParam, const MagnificationLevel &maxLevelParam, bool useMmap, MagnificationLevel &maxLevel) const
 
bool WriteBitmap (Progress &progress, FileWriter &writer, const TypeInfo &typeInfo, const TypeData &typeData, const CoordOffsetsMap &typeCellOffsets)
 
virtual void WriteTypeId (const TypeConfigRef &typeConfig, const TypeInfoRef &type, FileWriter &writer) const =0
 
bool MakeAreaIndex (const TypeConfigRef &typeConfig, const ImportParameter &parameter, Progress &progress, const std::vector< TypeInfoRef > &types, const MagnificationLevel &areaIndexMinMag, const MagnificationLevel &areaIndexMaxLevel, bool useMmap)
 

Protected Attributes

std::string typeName
 
std::string typeNamePlural
 
std::string dataFile
 
std::string indexFile
 

Additional Inherited Members

- Public Member Functions inherited from osmscout::ImportModule
virtual ~ImportModule ()=default
 
virtual void GetDescription (const ImportParameter &parameter, ImportModuleDescription &description) const
 
virtual bool Import (const TypeConfigRef &typeConfig, const ImportParameter &parameter, Progress &progress)=0
 

Detailed Description

template<typename Object>
class osmscout::AreaIndexGenerator< Object >

Generic Area index generator

Member Typedef Documentation

◆ CoordCountMap

template<typename Object>
using osmscout::AreaIndexGenerator< Object >::CoordCountMap = std::map<TileId, size_t>
protected

◆ CoordOffsetsMap

template<typename Object>
using osmscout::AreaIndexGenerator< Object >::CoordOffsetsMap = std::map<TileId, std::list<FileOffset> >
protected

Constructor & Destructor Documentation

◆ AreaIndexGenerator()

template<typename Object>
osmscout::AreaIndexGenerator< Object >::AreaIndexGenerator ( const std::string &  typeName,
const std::string &  typeNamePlural,
const std::string &  dataFile,
const std::string &  indexFile 
)
inlineprotected

Member Function Documentation

◆ CalculateDistribution()

template<typename Object >
bool osmscout::AreaIndexGenerator< Object >::CalculateDistribution ( const TypeConfig &  typeConfig,
const ImportParameter &  parameter,
Progress progress,
const std::vector< TypeInfoRef > &  types,
std::vector< TypeData > &  typeData,
const MagnificationLevel &  minLevelParam,
const MagnificationLevel &  maxLevelParam,
bool  useMmap,
MagnificationLevel &  maxLevel 
) const
protected

◆ CalculateStatistics()

template<typename Object >
void osmscout::AreaIndexGenerator< Object >::CalculateStatistics ( const MagnificationLevel &  level,
TypeData typeData,
const CoordCountMap cellFillCount 
) const
protected

Calculate internal statistics that are the base for deciding if the given object type is indexed at the given index level.

Parameters
level
typeData
cellFillCount

◆ FitsIndexCriteria()

template<typename Object >
bool osmscout::AreaIndexGenerator< Object >::FitsIndexCriteria ( Progress progress,
const TypeInfo &  typeInfo,
const CoordCountMap cellFillCount 
) const
protectedvirtual

◆ MakeAreaIndex()

template<typename Object >
bool osmscout::AreaIndexGenerator< Object >::MakeAreaIndex ( const TypeConfigRef typeConfig,
const ImportParameter &  parameter,
Progress progress,
const std::vector< TypeInfoRef > &  types,
const MagnificationLevel &  areaIndexMinMag,
const MagnificationLevel &  areaIndexMaxLevel,
bool  useMmap 
)
protected

◆ WriteBitmap()

template<typename Object >
bool osmscout::AreaIndexGenerator< Object >::WriteBitmap ( Progress progress,
FileWriter &  writer,
const TypeInfo &  typeInfo,
const TypeData typeData,
const CoordOffsetsMap typeCellOffsets 
)
protected

For each cell we store a file offset to the bitmap data or 0, if there is no data for the cell. The bitmap entry itself contains the number of offsets followed by the offsets themselves (delta-encoded).

Parameters
progress
writer
typeInfo
typeData
typeCellOffsets
Returns

◆ WriteTypeId()

template<typename Object>
virtual void osmscout::AreaIndexGenerator< Object >::WriteTypeId ( const TypeConfigRef typeConfig,
const TypeInfoRef type,
FileWriter &  writer 
) const
protectedpure virtual

Member Data Documentation

◆ dataFile

template<typename Object>
std::string osmscout::AreaIndexGenerator< Object >::dataFile
protected

◆ indexFile

template<typename Object>
std::string osmscout::AreaIndexGenerator< Object >::indexFile
protected

◆ typeName

template<typename Object>
std::string osmscout::AreaIndexGenerator< Object >::typeName
protected

◆ typeNamePlural

template<typename Object>
std::string osmscout::AreaIndexGenerator< Object >::typeNamePlural
protected

The documentation for this class was generated from the following file: