Skip to content

Commit db971cf

Browse files
committed
No need to pass params which are referenced in osmObject
1 parent e14072b commit db971cf

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/shared_data.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,9 @@ class SharedData
3232
}
3333

3434
// ---- Read all config details from JSON file
35-
// TODO: should be able to get cachedGeometryNames and indices from osmObject,
36-
// rather than needing them to be passed as parameters
3735

3836
void readConfig(rapidjson::Document &jsonConfig, bool hasClippingBox, Box &clippingBox,
39-
map< uint, vector<OutputObject> > &tileIndex,
40-
map< uint, string > &cachedGeometryNames,
41-
map< string, RTree > &indices) {
37+
map< uint, vector<OutputObject> > &tileIndex) {
4238
baseZoom = jsonConfig["settings"]["basezoom"].GetUint();
4339
startZoom = jsonConfig["settings"]["minzoom" ].GetUint();
4440
endZoom = jsonConfig["settings"]["maxzoom" ].GetUint();
@@ -108,11 +104,11 @@ class SharedData
108104
}
109105
bool indexed=false; if (it->value.HasMember("index")) {
110106
indexed=it->value["index"].GetBool();
111-
indices[layerName]=RTree();
107+
osmObject.indices->operator[](layerName)=RTree();
112108
}
113109
string indexName = it->value.HasMember("index_column") ? it->value["index_column"].GetString() : "";
114110
readShapefile(it->value["source"].GetString(), sourceColumns, clippingBox, tileIndex,
115-
cachedGeometries, cachedGeometryNames, baseZoom, layerNum, layerName, indexed, indices, indexName);
111+
cachedGeometries, *osmObject.cachedGeometryNames, baseZoom, layerNum, layerName, indexed, *osmObject.indices, indexName);
116112
}
117113
}
118114
}

src/tilemaker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ int main(int argc, char* argv[]) {
403403
if (jsonConfig.HasParseError()) { cerr << "Invalid JSON file." << endl; return -1; }
404404
fclose(fp);
405405

406-
sharedData.readConfig(jsonConfig, hasClippingBox, clippingBox, tileIndex, cachedGeometryNames, indices);
406+
sharedData.readConfig(jsonConfig, hasClippingBox, clippingBox, tileIndex);
407407

408408
} catch (...) {
409409
cerr << "Couldn't find expected details in JSON file." << endl;

0 commit comments

Comments
 (0)