40 #define STAT_START(_X) Statistic::Get()->start(measurement, _X) 41 #define STAT_STOP(_X) Statistic::Get()->stop(measurement, _X) 42 #define STAT_STATS(_X, _Y, _Z) Statistic::Get()->setStats(measurement, _X, _Y, _Z) 43 #define STAT_WRITE() Statistic::Get()->finished(measurement) 51 Job::Job(
const shared_ptr<MetaIdentifier>& mid,
52 const shared_ptr<Configuration>&
config,
53 const shared_ptr<RequestManager>& manager,
54 const shared_ptr<RenderCanvas>& canvas)
59 , measurement(
Statistic::Get()->startNewMeasurement(mid->getStylesheetPath(), mid->getZoom()))
70 int zoom = ti->getZoom();
75 coord_t minX = std::min(x0, x1);
76 coord_t minY = std::min(y0, y1);
77 coord_t maxX = std::max(x0, x1);
78 coord_t maxY = std::max(y0, y1);
92 int zoom = ti->getIdentifiers()[0]->getZoom();
96 ti->getY() + ti->getHeight(),
99 coord_t minX = std::min(x0, x1);
100 coord_t minY = std::min(y0, y1);
101 coord_t maxX = std::max(x0, x1);
102 coord_t maxY = std::max(y0, y1);
115 const string& path =
mid->getStylesheetPath();
117 shared_ptr<Stylesheet> stylesheet =
manager->getStylesheetManager()->getStylesheet(
mid->getStylesheetPath());
119 shared_ptr<Tile> tile =
manager->getCache()->getTile(emptyID);
121 if(!tile->isRendered()) {
122 shared_ptr<std::vector<NodeId>> nodeIDs = boost::make_shared< std::vector<NodeId>>();
123 shared_ptr<std::vector<WayId>> wayIDs = boost::make_shared< std::vector<WayId>>();
124 shared_ptr<std::vector<RelId>> relationIDs = boost::make_shared< std::vector<RelId>>();
128 stylesheet->match(nodeIDs, wayIDs, relationIDs,
mid, &renderAttributes);
129 manager->getRenderer()->renderEmptyTile(renderAttributes,
canvas, tile);
141 bool rendered =
true;
142 for (
auto&
id :
mid->getIdentifiers())
144 shared_ptr<Tile> tile =
manager->getCache()->getTile(
id);
145 rendered = rendered && tile->isRendered();
146 tiles.push_back(tile);
158 shared_ptr<Geodata> geodata =
manager->getGeodata();
162 empty = !geodata->containsData(rect);
177 auto nodeIDs = geodata->getNodeIDs(rect);
181 auto wayIDs = geodata->getWayIDs(rect);
185 auto relationIDs = geodata->getRelationIDs(rect);
188 STAT_STATS(nodeIDs->size(), wayIDs->size(), relationIDs->size());
190 shared_ptr<Stylesheet> stylesheet =
manager->getStylesheetManager()->getStylesheet(
mid->getStylesheetPath());
193 stylesheet->match(nodeIDs, wayIDs, relationIDs,
mid, &renderAttributes);
196 const shared_ptr<Renderer>& renderer =
manager->getRenderer();
198 renderer->renderMetaTile(renderAttributes,
canvas,
mid);
210 for (
auto&
id :
mid->getIdentifiers())
216 const shared_ptr<Renderer>& renderer =
manager->getRenderer();
218 for (
auto& tile :
tiles) {
219 if (!tile->isRendered())
222 for (
auto& req :
requests[*tile->getIdentifier()])
#define STAT_STATS(_X, _Y, _Z)
A RenderAttributes object contains mappings from NodeIDs and WayIDs to Style objects which define how...
std::vector< shared_ptr< Tile > > tiles
initialized by initTiles
Format
Enumeration which contains all supported image formats.
TESTABLE FixedRect computeRect(const shared_ptr< TileIdentifier > &ti)
Computes an rectangle for the given TileIdentifier.
shared_ptr< RenderCanvas > canvas
supplied by worker thread
boost::unordered_map< TileIdentifier, std::list< shared_ptr< HttpRequest > > > requests
TESTABLE shared_ptr< Tile > computeEmpty()
Computes an empty Tile.
basic_rect< T > grow(T dx, T dy) const
shared_ptr< MetaIdentifier > mid
static const char * config
Option to get the configuration filename (type: string)
#define STAT_START(_X)
This file is part of alaCarte.
static shared_ptr< TileIdentifier > CreateEmptyTID(const string &stylesheetPath, TileIdentifier::Format format)
Return the TileIdentifier used for Tiles without data.
void process()
Computes a all tiles contained in the MetaIdentifier.
shared_ptr< RequestManager > manager
RequestManager which holds all important components.
Job(const shared_ptr< MetaIdentifier > &mid, const shared_ptr< Configuration > &config, const shared_ptr< RequestManager > &manager, const shared_ptr< RenderCanvas > &canvas)
Creates a new Job and sets the RequestManager.
bool initTiles()
Inits the internal list of tiles that are part of the MetaTile.