Commit 50567d58 authored by Jean-Benoist Leger's avatar Jean-Benoist Leger

elevation_db in a scope

parent 8025f5af
......@@ -223,7 +223,9 @@ int main(int argc, char ** argv)
unsigned int iter = 0;
while(1)
{
unsigned int modified=0;
unsigned int modified;
modified = 0;
iter++;
for(auto ways_it = ways.begin();
ways_it != ways.end();
......@@ -263,9 +265,6 @@ int main(int argc, char ** argv)
char zreq[RV_ZCHAR_LENGTH];
char zfilename[RV_ZCHAR_LENGTH];
// elevation_db (read-only)
elevation elevation_db(argv[2]);
// cleaning (without checking status, lmdb will check after and fail if this
// is not goot)
......@@ -288,14 +287,19 @@ int main(int argc, char ** argv)
RV_BLANKLINE;
fprintf(stderr,"Computing elevation on nodes\n");
for(auto nodes_it = nodes.begin();
nodes_it != nodes.end();
nodes_it++)
{
nodes_it->second.elevation = elevation_db.get_elevation(
nodes_it->second.lon,
nodes_it->second.lat);
// elevation_db (read-only)
elevation elevation_db(argv[2]);
for(auto nodes_it = nodes.begin();
nodes_it != nodes.end();
nodes_it++)
{
nodes_it->second.elevation = elevation_db.get_elevation(
nodes_it->second.lon,
nodes_it->second.lat);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment