diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/network/LegacyVertexMatcher.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/network/LegacyVertexMatcher.cpp index d2f22851d3..e3607dd28f 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/network/LegacyVertexMatcher.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/network/LegacyVertexMatcher.cpp @@ -136,12 +136,12 @@ double LegacyVertexMatcher::_denominatorForTie(TiePointScorePtr tie) const QSet ties; QList tie1 = _scores1.value(tie->v1); - for (const auto& tie : tie1) - ties.insert(tie); + for (const auto& t1 : tie1) + ties.insert(t1); QList tie2 = _scores2.value(tie->v2); - for (const auto& tie : tie2) - ties.insert(tie); + for (const auto& t2 : tie2) + ties.insert(t2); double sum = 0.0; for (const auto& t : ties) diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkDetails.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkDetails.cpp index be6d0b6129..f6d808dbbc 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkDetails.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkDetails.cpp @@ -681,10 +681,10 @@ Meters NetworkDetails::getSearchRadius(ConstNetworkEdgePtr e) const if (e->isStub()) { - for (const auto& e : _n2->getEdgesFromVertex(e->getFrom())) + for (const auto& element : _n2->getEdgesFromVertex(e->getFrom())) { - if (e->isStub() == false) - ce = std::max(ce, getSearchRadius(e)); + if (element->isStub() == false) + ce = std::max(ce, getSearchRadius(element)); } if (ce == -1) ce = e->getFrom()->getElement()->getCircularError(); diff --git a/hoot-core/src/main/cpp/hoot/core/criterion/InBoundsCriterion.cpp b/hoot-core/src/main/cpp/hoot/core/criterion/InBoundsCriterion.cpp index eb4b380611..40b31645be 100644 --- a/hoot-core/src/main/cpp/hoot/core/criterion/InBoundsCriterion.cpp +++ b/hoot-core/src/main/cpp/hoot/core/criterion/InBoundsCriterion.cpp @@ -120,7 +120,7 @@ bool InBoundsCriterion::_nonWayNodeInBounds(const ConstElementPtr& e) const { return _bounds->contains(geom.get()); } - catch (geos::util::TopologyException&) + catch (const geos::util::TopologyException&) { // If the contains call fails, use the envelope return _bounds->contains(geom->getEnvelope().get()); @@ -132,7 +132,7 @@ bool InBoundsCriterion::_nonWayNodeInBounds(const ConstElementPtr& e) const { return _bounds->intersects(geom.get()); } - catch (geos::util::TopologyException&) + catch (const geos::util::TopologyException&) { // If the intersects call fails, use the envelope return _bounds->intersects(geom->getEnvelope().get()); diff --git a/hoot-core/src/main/cpp/hoot/core/criterion/TagAdvancedCriterion.cpp b/hoot-core/src/main/cpp/hoot/core/criterion/TagAdvancedCriterion.cpp index 339efbb80c..a8a85a4422 100644 --- a/hoot-core/src/main/cpp/hoot/core/criterion/TagAdvancedCriterion.cpp +++ b/hoot-core/src/main/cpp/hoot/core/criterion/TagAdvancedCriterion.cpp @@ -113,7 +113,7 @@ void TagAdvancedCriterion::_loadTagFilters(const QString& tagFilterType, propTree->get_child_optional(tagFilterType.toStdString()); if (tagFilterChild) { - for (auto& tagFilterPart : propTree->get_child(tagFilterType.toStdString())) + for (const auto& tagFilterPart : propTree->get_child(tagFilterType.toStdString())) { TagFilter tagFilter = TagFilter::fromJson(tagFilterPart); LOG_VART(tagFilter); @@ -178,7 +178,7 @@ bool TagAdvancedCriterion::_hasAuxMatch(const ConstElementPtr& e, const TagFilte LOG_VART(tags); - for (auto tagItr = tags.begin(); tagItr != tags.end(); ++tagItr) + for (auto tagItr = tags.constBegin(); tagItr != tags.constEnd(); ++tagItr) { const QString tagKey = tagItr.key(); const QString tagValue = tagItr.value(); diff --git a/hoot-core/src/main/cpp/hoot/core/elements/Tags.cpp b/hoot-core/src/main/cpp/hoot/core/elements/Tags.cpp index e5ebc467e9..53c5a9c44b 100644 --- a/hoot-core/src/main/cpp/hoot/core/elements/Tags.cpp +++ b/hoot-core/src/main/cpp/hoot/core/elements/Tags.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. Maxar * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020, 2021 Maxar (http://www.maxar.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Maxar (http://www.maxar.com/) */ #include "Tags.h" @@ -42,8 +42,8 @@ namespace hoot QStringList Tags::_nameKeys; QStringList Tags::_pseudoNameKeys; -Tags::Tags(const QString& key, const QString& value) : -QHash() +Tags::Tags(const QString& key, const QString& value) + : QHash() { set(key, value); } @@ -98,7 +98,7 @@ QStringList Tags::kvpToParts(const QString& kvp) void Tags::add(const Tags& t) { - for (Tags::const_iterator it = t.constBegin(); it != t.constEnd(); ++it) + for (auto it = t.constBegin(); it != t.constEnd(); ++it) operator[](it.key()) = it.value(); } @@ -151,10 +151,10 @@ void Tags::appendValueIfUnique(const QString& k, const QStringList& v) { QStringList l = split(oldV); - for (int i = 0; i < v.size(); i++) + for (const auto& value : qAsConst(v)) { - if (!l.contains(v[i])) - l.append(v[i]); + if (!l.contains(value)) + l.append(value); } setList(k, l); @@ -182,7 +182,7 @@ void Tags::appendValueIfUnique(const QString& k, const QString& v) bool Tags::hasInformationTag() const { - for (Tags::const_iterator it = constBegin(); it != constEnd(); ++it) + for (auto it = constBegin(); it != constEnd(); ++it) { QString key = it.key(); //LOG_VART(key); @@ -202,7 +202,6 @@ QStringList Tags::getCreateUuid() { QString uuid = UuidHelper::createUuid().toString(); set(uuidKey(), uuid); - result << uuid; } @@ -343,7 +342,7 @@ Length Tags::getLength(const QString& k) const int Tags::getInformationCount() const { int count = 0; - for (Tags::const_iterator it = constBegin(); it != constEnd(); ++it) + for (auto it = constBegin(); it != constEnd(); ++it) { QString key = it.key(); //LOG_VART(key); @@ -370,7 +369,7 @@ QStringList Tags::getMatchingKeys(const QStringList& k) QString regexStr = k[i].mid(6); QRegExp regex(regexStr); - for (const_iterator it = begin(); it != end(); ++it) + for (auto it = constBegin(); it != constEnd(); ++it) { if (regex.exactMatch(it.key())) result.append(it.key()); @@ -392,12 +391,10 @@ bool Tags::haveMatchingName(const Tags& tags1, const Tags& tags2, const bool str { const QStringList tag1Names = tags1.getNames(!strictNameMatch); const QStringList tag2Names = tags2.getNames(!strictNameMatch); - for (int i = 0; i < tag1Names.size(); i++) + for (const auto& tag1Name : tag1Names) { - const QString tag1Name = tag1Names[i]; - for (int j = 0; j < tag2Names.size(); j++) + for (const auto& tag2Name : tag2Names) { - const QString tag2Name = tag2Names[j]; if (tag1Name.compare(tag2Name, Qt::CaseInsensitive) == 0) return true; } @@ -409,16 +406,16 @@ QStringList Tags::getNames(const bool includeAltName) const { QStringList result; - if (size() == 0) + if (empty()) return result; // make sure the _nameKeys field is populated. getNameKeys(); - for (int i = 0; i < _nameKeys.size(); i++) + for (auto key : _nameKeys) { - if (includeAltName || (!includeAltName && _nameKeys[i].toLower() != "alt_name")) - readValues(_nameKeys[i], result); + if (includeAltName || (!includeAltName && key.toLower() != "alt_name")) + readValues(key, result); } return result; @@ -432,9 +429,9 @@ QString Tags::getName() const else { QStringList names = getNames(); - for (int i = 0; i < names.size(); i++) + for (const auto& n : qAsConst(names)) { - name = names.at(i).trimmed(); + name = n.trimmed(); //arbitrarily returning the first name here if (!name.isEmpty()) return name; @@ -450,8 +447,8 @@ const QStringList& Tags::getNameKeys() { const vector& tags = OsmSchema::getInstance().getTagByCategory(OsmSchemaCategory::name()); - for (size_t i = 0; i < tags.size(); i++) - _nameKeys.append(tags[i].getKey()); + for (const auto& vertex : tags) + _nameKeys.append(vertex.getKey()); } return _nameKeys; @@ -461,9 +458,8 @@ QStringList Tags::getNameKeys(const Tags& tags) { QStringList nameKeysInTags; const QStringList globalNameKeys = getNameKeys(); - for (int i = 0; i < globalNameKeys.size(); i++) + for (const auto& nameKey : globalNameKeys) { - const QString nameKey = globalNameKeys.at(i); if (tags.contains(nameKey)) nameKeysInTags.append(nameKey); } @@ -473,7 +469,7 @@ QStringList Tags::getNameKeys(const Tags& tags) int Tags::getNonDebugCount() const { int count = 0; - for (Tags::const_iterator it = constBegin(); it != constEnd(); ++it) + for (auto it = constBegin(); it != constEnd(); ++it) { QString key = it.key(); if (!key.startsWith(MetadataTags::HootTagPrefix()) && key != "created_by" && it.value() != "") @@ -490,10 +486,10 @@ const QStringList& Tags::getPseudoNameKeys() const const vector& tags = OsmSchema::getInstance().getTagByCategory(OsmSchemaCategory::pseudoName()); - for (size_t i = 0; i < tags.size(); i++) + for (const auto& vertex : tags) { - LOG_TRACE("key : " << (tags[i].getKey().toStdString())); - _pseudoNameKeys.append(tags[i].getKey()); + LOG_TRACE("key : " << (vertex.getKey().toStdString())); + _pseudoNameKeys.append(vertex.getKey()); } } @@ -504,14 +500,14 @@ QStringList Tags::getPseudoNames() const { QStringList result; - if (size() == 0) + if (empty()) return result; // make sure the _nameKeys field is populated. getPseudoNameKeys(); - for (int i = 0; i < _pseudoNameKeys.size(); i++) - readValues(_pseudoNameKeys[i], result); + for (const auto& key : qAsConst(_pseudoNameKeys)) + readValues(key, result); return result; } @@ -533,7 +529,7 @@ bool Tags::operator==(const Tags& other) const if (other.size() != size()) return false; - for (const_iterator it = begin(); it != end(); ++it) + for (auto it = constBegin(); it != constEnd(); ++it) { QStringList l1 = split(it.value()); l1.sort(); @@ -562,15 +558,15 @@ int Tags::removeMetadata() // there are some other metadata keys that don't start with 'hoot:' QStringList keysToRemove; OsmSchema& schema = OsmSchema::getInstance(); - for (Tags::const_iterator it = begin(); it != end(); ++it) + for (auto it = constBegin(); it != constEnd(); ++it) { const QString key = it.key(); if (schema.isMetaData(key, it.value())) keysToRemove.append(key); } - for (int i = 0; i < keysToRemove.size(); i++) - numRemoved += remove(keysToRemove.at(i)); + for (const auto& key : qAsConst(keysToRemove)) + numRemoved += remove(key); return numRemoved; } @@ -578,10 +574,10 @@ int Tags::removeMetadata() int Tags::removeKeys(const QStringList& keys) { int numRemoved = 0; - for (int i = 0; i < keys.size(); i++) + for (const auto& key : qAsConst(keys)) { - LOG_TRACE("Removing " << keys.at(i) << "..."); - numRemoved += remove(keys.at(i)); + LOG_TRACE("Removing " << key << "..."); + numRemoved += remove(key); } return numRemoved; } @@ -589,7 +585,7 @@ int Tags::removeKeys(const QStringList& keys) int Tags::removeKey(const QRegExp& regex) { QStringList keysToRemove; - for (Tags::const_iterator it = begin(); it != end(); ++it) + for (auto it = constBegin(); it != constEnd(); ++it) { const QString key = it.key(); if (regex.exactMatch(key)) @@ -602,8 +598,8 @@ int Tags::removeKey(const QRegExp& regex) int Tags::removeKeys(const QList& regexes) { int numRemoved = 0; - for (int i = 0; i < regexes.size(); i++) - numRemoved += removeKey(regexes.at(i)); + for (const auto& regex : qAsConst(regexes)) + numRemoved += removeKey(regex); return numRemoved; } @@ -611,7 +607,7 @@ int Tags::removeKeys(const QList& regexes) int Tags::removeByTagKeyStartsWith(const QString& tagKeySubstring) { QStringList keysToRemove; - for (Tags::const_iterator it = begin(); it != end(); ++it) + for (auto it = constBegin(); it != constEnd(); ++it) { const QString key = it.key(); if (key.startsWith(tagKeySubstring)) @@ -619,15 +615,15 @@ int Tags::removeByTagKeyStartsWith(const QString& tagKeySubstring) } int numRemoved = 0; - for (int i = 0; i < keysToRemove.size(); i++) - numRemoved += remove(keysToRemove.at(i)); + for (const auto& key : qAsConst(keysToRemove)) + numRemoved += remove(key); return numRemoved; } QStringList Tags::getDataOnlyValues(const Tags& tags) const { QStringList t; - for (Tags::const_iterator it = tags.begin(); it != tags.end(); ++it) + for (auto it = tags.constBegin(); it != tags.constEnd(); ++it) { if (!it.key().startsWith(MetadataTags::HootTagPrefix())) t.append(it.value()); @@ -674,7 +670,7 @@ void Tags::readValues(const QString &k, QStringList& list) const QString regexStr = k.mid(6); QRegExp regex(regexStr); - for (const_iterator it = begin(); it != end(); ++it) + for (auto it = constBegin(); it != constEnd(); ++it) { if (regex.exactMatch(it.key())) list.append(split(it.value())); @@ -699,7 +695,7 @@ void Tags::set(const QString& key, bool v) void Tags::set(const Tags& other) { - for (Tags::const_iterator it = other.constBegin(); it != other.constEnd(); ++it) + for (auto it = other.constBegin(); it != other.constEnd(); ++it) set(it.key(), it.value()); } @@ -711,7 +707,7 @@ QStringList Tags::split(const QString& values) int strStart = 0; int last = values.length() - 1; - for (int i = 0; i < values.length(); i++) + for (int i = 0; i < values.length(); ++i) { // if there is an empty string at the beginning if (i == 0) @@ -749,7 +745,7 @@ QStringList Tags::split(const QString& values) QString Tags::toString() const { QString result; - for (Tags::const_iterator it = constBegin(); it != constEnd(); ++it) + for (auto it = constBegin(); it != constEnd(); ++it) result += it.key() + " = " + it.value() + "\n"; return result; } @@ -771,9 +767,8 @@ void Tags::_valueRegexParser(const QString& str, QString& num, QString& units) c QString Tags::getFirstMatchingKvp(const QStringList& kvps) const { - for (int i = 0; i < kvps.size(); i++) + for (const auto& kvp : qAsConst(kvps)) { - const QString kvp = kvps.at(i); if (!kvp.contains("=")) throw IllegalArgumentException("Invalid kvp: " + kvp); @@ -796,28 +791,13 @@ bool Tags::hasKvp(const QString& kvp) const bool Tags::hasAnyKvp(const QStringList& kvps) const { - for (int i = 0; i < kvps.size(); i++) - { - const QString kvp = kvps.at(i); - if (!kvp.contains("=")) - throw IllegalArgumentException("Invalid kvp: " + kvp); - - const QStringList kvpParts = kvp.split("="); - if (kvpParts.size() != 2) - throw IllegalArgumentException("Invalid kvp: " + kvp); - - const QString key = kvpParts[0]; - const QString value = kvpParts[1]; - if ((value != "*" && get(key) == value) || (value == "*" && contains(key))) - return true; - } - return false; + return !getFirstMatchingKvp(kvps).isEmpty(); } QStringList Tags::toKvps() const { QStringList kvps; - for (Tags::const_iterator it = constBegin(); it != constEnd(); ++it) + for (auto it = constBegin(); it != constEnd(); ++it) kvps.append(it.key() + "=" + it.value()); return kvps; @@ -826,7 +806,7 @@ QStringList Tags::toKvps() const QStringList Tags::toKeys() const { QStringList keys; - for (Tags::const_iterator it = constBegin(); it != constEnd(); ++it) + for (auto it = constBegin(); it != constEnd(); ++it) keys.append(it.key()); return keys; @@ -834,9 +814,9 @@ QStringList Tags::toKeys() const bool Tags::hasAnyKey(const QStringList& keys) const { - for (int i = 0; i < keys.size(); i++) + for (const auto& key : qAsConst(keys)) { - if (contains(keys.at(i))) + if (contains(key)) return true; } return false; @@ -844,9 +824,8 @@ bool Tags::hasAnyKey(const QStringList& keys) const QString Tags::getFirstMatchingKey(const QStringList& keys) const { - for (int i = 0; i < keys.size(); i++) + for (const auto& key : qAsConst(keys)) { - const QString key = keys.at(i); if (contains(key)) return key; } @@ -856,9 +835,8 @@ QString Tags::getFirstMatchingKey(const QStringList& keys) const Tags Tags::kvpListToTags(const QStringList& kvps) { Tags tagsToReturn; - for (int i = 0; i < kvps.size(); i++) + for (const auto& tagStr : qAsConst(kvps)) { - const QString tagStr = kvps.at(i); if (!tagStr.contains("=")) throw IllegalArgumentException("Invalid tag: " + tagStr); @@ -874,12 +852,8 @@ Tags Tags::kvpListToTags(const QStringList& kvps) Tags Tags::schemaVerticesToTags(const std::vector& schemaVertices) { Tags tags; - for (std::vector::const_iterator itr = schemaVertices.begin(); - itr != schemaVertices.end(); ++itr) - { - const SchemaVertex vertex = *itr; + for (const auto& vertex : schemaVertices) tags.appendValue(vertex.getKey(), vertex.getValue()); - } return tags; } diff --git a/hoot-core/src/main/cpp/hoot/core/elements/Tags.h b/hoot-core/src/main/cpp/hoot/core/elements/Tags.h index be0f499c9f..798dfbfc81 100644 --- a/hoot-core/src/main/cpp/hoot/core/elements/Tags.h +++ b/hoot-core/src/main/cpp/hoot/core/elements/Tags.h @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. Maxar * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020, 2021 Maxar (http://www.maxar.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Maxar (http://www.maxar.com/) */ #ifndef TAGS_H #define TAGS_H @@ -410,8 +410,7 @@ class Tags : public QHash * @parm strictNameMatch if true, will not consider names with the alt_name tag key * @return true if the tags have at least one matching name; false otherwise */ - static bool haveMatchingName( - const Tags& tags1, const Tags& tags2, const bool strictNameMatch = false); + static bool haveMatchingName(const Tags& tags1, const Tags& tags2, const bool strictNameMatch = false); /** * Determines whether a name exists in the set of tag * diff --git a/hoot-core/src/main/cpp/hoot/core/io/ApiDb.cpp b/hoot-core/src/main/cpp/hoot/core/io/ApiDb.cpp index b6a504cf0e..d2114c032b 100644 --- a/hoot-core/src/main/cpp/hoot/core/io/ApiDb.cpp +++ b/hoot-core/src/main/cpp/hoot/core/io/ApiDb.cpp @@ -490,8 +490,8 @@ QSqlQuery ApiDb::_exec(const QString& sql, QVariant v1, QVariant v2, QVariant v3 unsigned int ApiDb::tileForPoint(double lat, double lon) { - int lonInt = round((lon + 180.0) * 65535.0 / 360.0); - int latInt = round((lat + 90.0) * 65535.0 / 180.0); + int lonInt = static_cast(round((lon + 180.0) * 65535.0 / 360.0)); + int latInt = static_cast(round((lat + 90.0) * 65535.0 / 180.0)); unsigned int tile = 0; @@ -828,10 +828,10 @@ void ApiDb::readDbConfig(Settings& settings, const QString& config_path) QStringList sl = s.split('\n', QString::SkipEmptyParts); - for (const auto& s : qAsConst(sl)) + for (const auto& split : qAsConst(sl)) { - QString key = s.section("=", 0, 0).remove("export ").trimmed(); - QString value = s.section("=", 1).trimmed(); + QString key = split.section("=", 0, 0).remove("export ").trimmed(); + QString value = split.section("=", 1).trimmed(); if (!key.startsWith("#") && key.length() > 0) settings.set(key, value); } diff --git a/hoot-core/src/main/cpp/hoot/core/io/OgrOptions.cpp b/hoot-core/src/main/cpp/hoot/core/io/OgrOptions.cpp index c2aabc678f..06db69da2f 100644 --- a/hoot-core/src/main/cpp/hoot/core/io/OgrOptions.cpp +++ b/hoot-core/src/main/cpp/hoot/core/io/OgrOptions.cpp @@ -22,17 +22,16 @@ * This will properly maintain the copyright information. Maxar * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2017, 2021 Maxar (http://www.maxar.com/) + * @copyright Copyright (C) 2015, 2017, 2021, 2022 Maxar (http://www.maxar.com/) */ #include "OgrOptions.h" namespace hoot { -OgrOptions::OgrOptions() : -_cryptic(nullptr) +OgrOptions::OgrOptions() + : _cryptic(nullptr) { - } OgrOptions::~OgrOptions() @@ -45,9 +44,7 @@ void OgrOptions::deleteCrypticOptions() if (_cryptic) { for (size_t i = 0; _cryptic[i] != 0; ++i) - { delete[] _cryptic[i]; - } delete[] _cryptic; } } @@ -59,19 +56,18 @@ char** OgrOptions::getCrypticOptions() { deleteCrypticOptions(); - if (size() == 0) - { + if (empty()) return nullptr; - } _cryptic = new char*[size() + 1]; _cryptic[size()] = nullptr; size_t i = 0; - for (OgrOptions::const_iterator it = constBegin(); it != constEnd(); ++it) + for (auto it = constBegin(); it != constEnd(); ++it) { QByteArray s = (it.key() + "=" + it.value()).toUtf8(); _cryptic[i] = new char[s.size() + 1]; - strcpy(_cryptic[i], s.data()); + memset(_cryptic[i], 0, s.size() + 1); + strncpy(_cryptic[i], s.data(), s.size()); ++i; } diff --git a/hoot-core/src/main/cpp/hoot/core/io/OgrWriter.cpp b/hoot-core/src/main/cpp/hoot/core/io/OgrWriter.cpp index 2877bd0d6b..cf96c55747 100644 --- a/hoot-core/src/main/cpp/hoot/core/io/OgrWriter.cpp +++ b/hoot-core/src/main/cpp/hoot/core/io/OgrWriter.cpp @@ -467,9 +467,8 @@ void OgrWriter::writePartial(const ConstRelationPtr& newRelation) member.getElementId().getType().toString(), QString::number(cacheSize)); - switch (member_type) + if (member_type == ElementType::Relation) { - case ElementType::Relation: // Relation members throw that fail and aren't forced if (_failOnSkipRelation && !_forceSkipFailedRelations) throw HootException(msg); @@ -482,12 +481,12 @@ void OgrWriter::writePartial(const ConstRelationPtr& newRelation) _unwrittenFirstPassRelationIds.append(newRelation->getId()); return; } - break; - default: + } + else + { // Node and Way members throw if we don't force the skip if (!_forceSkipFailedRelations) throw HootException(msg); - break; } // Add this member to the list to remove for OGR files removeEntries.insert(member); @@ -523,7 +522,7 @@ void OgrWriter::writeElement(ElementPtr& element) return; Tags sourceTags = element->getTags(); Tags destTags; - for (auto it = sourceTags.begin(); it != sourceTags.end(); ++it) + for (auto it = sourceTags.constBegin(); it != sourceTags.constEnd(); ++it) { if (it.value() != "") destTags.appendValue(it.key(), it.value()); @@ -764,7 +763,7 @@ void OgrWriter::_addFeatureToLayer(OGRLayer* layer, const std::shared_ptrtoString(); - const char* t = (char*)wkt.data(); + const char* t = wkt.data(); OGRGeometry* geom; int errCode = OGRGeometryFactory::createFromWkt(&t, layer->GetSpatialRef(), &geom) ; if (errCode != OGRERR_NONE) diff --git a/hoot-core/src/main/cpp/hoot/core/io/OsmApiDbSqlChangesetFileWriter.cpp b/hoot-core/src/main/cpp/hoot/core/io/OsmApiDbSqlChangesetFileWriter.cpp index 0627ffbc11..16168fc902 100644 --- a/hoot-core/src/main/cpp/hoot/core/io/OsmApiDbSqlChangesetFileWriter.cpp +++ b/hoot-core/src/main/cpp/hoot/core/io/OsmApiDbSqlChangesetFileWriter.cpp @@ -216,12 +216,8 @@ void OsmApiDbSqlChangesetFileWriter::_createChangeSet() .toUtf8()); _outputSql.write( QString("INSERT INTO %1 (changeset_id, k, v) VALUES " - "(%2, '%3', '%4');\n") - .arg(ApiDb::getChangesetTagsTableName()) - .arg(_changesetId) - .arg("written_by") - .arg("Hootenanny") - .toUtf8()); + "(%2, 'written_by', 'Hootenanny');\n") + .arg(ApiDb::getChangesetTagsTableName(), QString::number(_changesetId)).toUtf8()); } ElementPtr OsmApiDbSqlChangesetFileWriter::_getChangeElement(ConstElementPtr element) const @@ -262,8 +258,8 @@ void OsmApiDbSqlChangesetFileWriter::_createNewElement(ConstElementPtr element) if (id <= 0) { throw HootException( - "SQL changesets can only create elements with positive element IDs: " + - ElementId(changeElement->getElementType(), id).toString()); + QString("SQL changesets can only create elements with positive element IDs: %1") + .arg(ElementId(changeElement->getElementType(), id).toString())); } LOG_TRACE("ID after: " << ElementId(changeElement->getElementType(), id)); @@ -277,15 +273,12 @@ void OsmApiDbSqlChangesetFileWriter::_createNewElement(ConstElementPtr element) LOG_VART(changeElement->getId()); LOG_VART(note); LOG_VART(changeElement->getVersion()); - QString commentStr = "/* create " + elementTypeStr + " " + QString::number(changeElement->getId()); - commentStr += "*/\n"; + QString commentStr = QString("/* create %1 %2 */\n").arg(elementTypeStr, QString::number(changeElement->getId())); _outputSql.write(commentStr.toUtf8()); const QString values = _getInsertValuesStr(changeElement); - _outputSql.write( - QString("INSERT INTO %1s (%2_id, %3").arg(elementTypeStr, elementTypeStr, values).toUtf8()); - _outputSql.write( - QString("INSERT INTO current_%1s (id, %2").arg(elementTypeStr, values).toUtf8()); + _outputSql.write(QString("INSERT INTO %1s (%2_id, %3").arg(elementTypeStr, elementTypeStr, values).toUtf8()); + _outputSql.write(QString("INSERT INTO current_%1s (id, %2").arg(elementTypeStr, values).toUtf8()); _createTags(changeElement); @@ -348,7 +341,7 @@ void OsmApiDbSqlChangesetFileWriter::_updateExistingElement(ConstElementPtr elem if (element->getElementId().getId() <= 0) { throw HootException( - "SQL changesets can only modify positive element IDs: " + element->getElementId().toString()); + QString("SQL changesets can only modify positive element IDs: %1").arg(element->getElementId().toString())); } LOG_TRACE("Writing update for: " << element->getElementId() << "..."); @@ -362,8 +355,8 @@ void OsmApiDbSqlChangesetFileWriter::_updateExistingElement(ConstElementPtr elem if (currentVersion < 1) { throw HootException( - "Elements being modified in an .osc.sql changeset must always have a version greater than one: " + - element->getElementId().toString()); + QString("Elements being modified in an .osc.sql changeset must always have a version greater than one: %1") + .arg(element->getElementId().toString())); } const long newVersion = currentVersion + 1; LOG_VART(newVersion); @@ -378,8 +371,7 @@ void OsmApiDbSqlChangesetFileWriter::_updateExistingElement(ConstElementPtr elem LOG_VART(changeElement->getId()); LOG_VART(note); LOG_VART(changeElement->getVersion()); - QString commentStr = "/* modify " + elementTypeStr + " " + QString::number(changeElement->getId()); - commentStr += "*/\n"; + QString commentStr = QString("/* modify %1 %2 */\n").arg(elementTypeStr, QString::number(changeElement->getId())); _outputSql.write(commentStr.toUtf8()); // table contains all version of all elements of that type in a history, so insert @@ -417,8 +409,8 @@ void OsmApiDbSqlChangesetFileWriter::_deleteExistingElement(ConstElementPtr elem if (element->getElementId().getId() <= 0) { throw HootException( - "SQL changesets can only create relation members with positive element IDs: " + - element->getElementId().toString()); + QString("SQL changesets can only create relation members with positive element IDs: %1") + .arg(element->getElementId().toString())); } const QString elementIdStr = QString::number(element->getId()); @@ -429,8 +421,8 @@ void OsmApiDbSqlChangesetFileWriter::_deleteExistingElement(ConstElementPtr elem if (currentVersion < 1) { throw HootException( - "Elements being deleted in an .osc.sql changeset must always have a version greater than one: " + - element->getElementId().toString()); + QString("Elements being deleted in an .osc.sql changeset must always have a version greater than one: %1") + .arg(element->getElementId().toString())); } const long newVersion = currentVersion + 1; @@ -443,8 +435,7 @@ void OsmApiDbSqlChangesetFileWriter::_deleteExistingElement(ConstElementPtr elem LOG_VART(changeElement->getId()); LOG_VART(note); LOG_VART(changeElement->getVersion()); - QString commentStr = "/* delete " + elementTypeStr + " " + QString::number(changeElement->getId()); - commentStr += "*/\n"; + QString commentStr = QString("/* delete %1 %2 */\n").arg(elementTypeStr, QString::number(changeElement->getId())); _outputSql.write(commentStr.toUtf8()); //OSM API DB keeps history for all elements, so the existing element in the master table is not @@ -565,7 +556,7 @@ void OsmApiDbSqlChangesetFileWriter::_createTags(ConstElementPtr element) metadataAlwaysIgnore.append(MetadataTags::HootConnectedWayOutsideBounds()); metadataAlwaysIgnore.append(MetadataTags::HootSnapped()); - for (auto it = tags.begin(); it != tags.end(); ++it) + for (auto it = tags.constBegin(); it != tags.constEnd(); ++it) { QString key = it.key(); QString val = it.value(); @@ -633,8 +624,7 @@ void OsmApiDbSqlChangesetFileWriter::_createWayNodes(ConstWayPtr way) if (nodeElementId.getId() <= 0) { throw HootException( - "SQL changesets can only create way nodes with positive element IDs: " + - nodeElementId.toString()); + QString("SQL changesets can only create way nodes with positive element IDs: %1").arg(nodeElementId.toString())); } } else if (nodeElementId.getId() <= 0) @@ -683,8 +673,8 @@ void OsmApiDbSqlChangesetFileWriter::_createRelationMembers(ConstRelationPtr rel if (memberElementId.getId() <= 0) { throw HootException( - "SQL changesets can only create relation members with positive element IDs: " + - memberElementId.toString()); + QString("SQL changesets can only create relation members with positive element IDs: %1") + .arg(memberElementId.toString())); } } else if (memberElementId.getId() <= 0) diff --git a/hoot-core/src/main/cpp/hoot/core/visitors/ImplicitTypeTaggerBase.cpp b/hoot-core/src/main/cpp/hoot/core/visitors/ImplicitTypeTaggerBase.cpp index c795a81e7d..3cf7eba008 100644 --- a/hoot-core/src/main/cpp/hoot/core/visitors/ImplicitTypeTaggerBase.cpp +++ b/hoot-core/src/main/cpp/hoot/core/visitors/ImplicitTypeTaggerBase.cpp @@ -559,7 +559,7 @@ void ImplicitTypeTaggerBase::_ensureCorrectTagSpecificity(const ElementPtr& e, T Tags updatedTags; bool tagsAdded = false; LOG_VART(_elementIsASpecificFeature); - for (auto tagItr = tagsToAdd.begin(); tagItr != tagsToAdd.end(); ++tagItr) + for (auto tagItr = tagsToAdd.constBegin(); tagItr != tagsToAdd.constEnd(); ++tagItr) { const QString implicitTagKey = tagItr.key(); LOG_VART(implicitTagKey); @@ -662,10 +662,10 @@ QStringList ImplicitTypeTaggerBase::_getNameTokens(const QStringList& names) con StringTokenizer tokenizer; QStringList nameTokens; - for (const auto& n : names) + for (const auto& n : qAsConst(names)) { QStringList words = tokenizer.tokenize(n); - for (const auto& w : words) + for (const auto& w : qAsConst(words)) { LOG_TRACE("Inserting token: " << w); nameTokens.append(w.toLower()); diff --git a/test-files/cmd/slow/serial/ServiceChangesetDeriveCmdSqlTest/changeset-1.osc.sql b/test-files/cmd/slow/serial/ServiceChangesetDeriveCmdSqlTest/changeset-1.osc.sql index b4d8b24fb5..7f90f0feca 100644 --- a/test-files/cmd/slow/serial/ServiceChangesetDeriveCmdSqlTest/changeset-1.osc.sql +++ b/test-files/cmd/slow/serial/ServiceChangesetDeriveCmdSqlTest/changeset-1.osc.sql @@ -1,12 +1,12 @@ INSERT INTO changesets (id, user_id, created_at, closed_at) VALUES (1, 1, (now() at time zone 'utc'), (now() at time zone 'utc')); INSERT INTO changeset_tags (changeset_id, k, v) VALUES (1, 'written_by', 'Hootenanny'); -/* create node 1*/ +/* create node 1 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (1, 388549524, 1048987389, 1, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (1, 388549524, 1048987389, 1, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 2*/ +/* create node 2 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (2, 388549321, 1048979050, 1, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (2, 388549321, 1048979050, 1, true, (now() at time zone 'utc'), 3852309038, 1); -/* create way 1*/ +/* create way 1 */ INSERT INTO ways (way_id, changeset_id, visible, "timestamp", version) VALUES (1, 1, true, (now() at time zone 'utc'), 1); INSERT INTO current_ways (id, changeset_id, visible, "timestamp", version) VALUES (1, 1, true, (now() at time zone 'utc'), 1); INSERT INTO current_way_tags (way_id, k, v) VALUES (1, 'highway', 'road'); diff --git a/test-files/cmd/slow/serial/ServiceChangesetDeriveCmdSqlTest/changeset-2.osc.sql b/test-files/cmd/slow/serial/ServiceChangesetDeriveCmdSqlTest/changeset-2.osc.sql index b8c9d2fdf6..7e249ef049 100644 --- a/test-files/cmd/slow/serial/ServiceChangesetDeriveCmdSqlTest/changeset-2.osc.sql +++ b/test-files/cmd/slow/serial/ServiceChangesetDeriveCmdSqlTest/changeset-2.osc.sql @@ -1,108 +1,108 @@ INSERT INTO changesets (id, user_id, created_at, closed_at) VALUES (2, 1, (now() at time zone 'utc'), (now() at time zone 'utc')); INSERT INTO changeset_tags (changeset_id, k, v) VALUES (2, 'written_by', 'Hootenanny'); -/* create node 3*/ +/* create node 3 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (3, 388541670, 1048997070, 2, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (3, 388541670, 1048997070, 2, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 4*/ +/* create node 4 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (4, 388540851, 1049014477, 2, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (4, 388540851, 1049014477, 2, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 5*/ +/* create node 5 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (5, 388542471, 1049010789, 2, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (5, 388542471, 1049010789, 2, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 6*/ +/* create node 6 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (6, 388542600, 1049005795, 2, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (6, 388542600, 1049005795, 2, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 7*/ +/* create node 7 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (7, 388549614, 1048997124, 2, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (7, 388549614, 1048997124, 2, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 8*/ +/* create node 8 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (8, 388545785, 1048997171, 2, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (8, 388545785, 1048997171, 2, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 9*/ +/* create node 9 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (9, 388542618, 1048997171, 2, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (9, 388542618, 1048997171, 2, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 10*/ +/* create node 10 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (10, 388539526, 1048996840, 2, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (10, 388539526, 1048996840, 2, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 11*/ +/* create node 11 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (11, 388536248, 1048996935, 2, true, (now() at time zone 'utc'), 3852309121, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (11, 388536248, 1048996935, 2, true, (now() at time zone 'utc'), 3852309121, 1); -/* create node 12*/ +/* create node 12 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (12, 388532583, 1048997543, 2, true, (now() at time zone 'utc'), 3852309121, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (12, 388532583, 1048997543, 2, true, (now() at time zone 'utc'), 3852309121, 1); -/* create node 13*/ +/* create node 13 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (13, 388532424, 1048996868, 2, true, (now() at time zone 'utc'), 3852309121, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (13, 388532424, 1048996868, 2, true, (now() at time zone 'utc'), 3852309121, 1); -/* create node 14*/ +/* create node 14 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (14, 388533001, 1048994529, 2, true, (now() at time zone 'utc'), 3852309121, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (14, 388533001, 1048994529, 2, true, (now() at time zone 'utc'), 3852309121, 1); -/* create node 15*/ +/* create node 15 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (15, 388533470, 1048993672, 2, true, (now() at time zone 'utc'), 3852309121, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (15, 388533470, 1048993672, 2, true, (now() at time zone 'utc'), 3852309121, 1); -/* create node 16*/ +/* create node 16 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (16, 388535166, 1048992699, 2, true, (now() at time zone 'utc'), 3852309121, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (16, 388535166, 1048992699, 2, true, (now() at time zone 'utc'), 3852309121, 1); -/* create node 17*/ +/* create node 17 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (17, 388535689, 1048990568, 2, true, (now() at time zone 'utc'), 3852309035, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (17, 388535689, 1048990568, 2, true, (now() at time zone 'utc'), 3852309035, 1); -/* create node 18*/ +/* create node 18 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (18, 388535509, 1048988321, 2, true, (now() at time zone 'utc'), 3852309035, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (18, 388535509, 1048988321, 2, true, (now() at time zone 'utc'), 3852309035, 1); -/* create node 19*/ +/* create node 19 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (19, 388536194, 1048987070, 2, true, (now() at time zone 'utc'), 3852309035, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (19, 388536194, 1048987070, 2, true, (now() at time zone 'utc'), 3852309035, 1); -/* create node 20*/ +/* create node 20 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (20, 388537204, 1048987233, 2, true, (now() at time zone 'utc'), 3852309035, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (20, 388537204, 1048987233, 2, true, (now() at time zone 'utc'), 3852309035, 1); -/* create node 21*/ +/* create node 21 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (21, 388539585, 1048989155, 2, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (21, 388539585, 1048989155, 2, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 22*/ +/* create node 22 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (22, 388541335, 1048988900, 2, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (22, 388541335, 1048988900, 2, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 23*/ +/* create node 23 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (23, 388541768, 1048987070, 2, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (23, 388541768, 1048987070, 2, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 24*/ +/* create node 24 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (24, 388542327, 1048983110, 2, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (24, 388542327, 1048983110, 2, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 25*/ +/* create node 25 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (25, 388544293, 1048980654, 2, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (25, 388544293, 1048980654, 2, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 26*/ +/* create node 26 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (26, 388546043, 1048977759, 2, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (26, 388546043, 1048977759, 2, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 27*/ +/* create node 27 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (27, 388547197, 1048973219, 2, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (27, 388547197, 1048973219, 2, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 28*/ +/* create node 28 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (28, 388548604, 1048968587, 2, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (28, 388548604, 1048968587, 2, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 29*/ +/* create node 29 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (29, 388549019, 1048964394, 2, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (29, 388549019, 1048964394, 2, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 30*/ +/* create node 30 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (30, 388549073, 1048961823, 2, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (30, 388549073, 1048961823, 2, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 31*/ +/* create node 31 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (31, 388548514, 1049005693, 2, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (31, 388548514, 1049005693, 2, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 32*/ +/* create node 32 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (32, 388549290, 1049005253, 2, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (32, 388549290, 1049005253, 2, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 33*/ +/* create node 33 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (33, 388548207, 1049008079, 2, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (33, 388548207, 1049008079, 2, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 34*/ +/* create node 34 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (34, 388543319, 1049017877, 2, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (34, 388543319, 1049017877, 2, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 35*/ +/* create node 35 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (35, 388541299, 1049023065, 2, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (35, 388541299, 1049023065, 2, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 36*/ +/* create node 36 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (36, 388540541, 1049024316, 2, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (36, 388540541, 1049024316, 2, true, (now() at time zone 'utc'), 3852309124, 1); -/* create way 2*/ +/* create way 2 */ INSERT INTO ways (way_id, changeset_id, visible, "timestamp", version) VALUES (2, 2, true, (now() at time zone 'utc'), 1); INSERT INTO current_ways (id, changeset_id, visible, "timestamp", version) VALUES (2, 2, true, (now() at time zone 'utc'), 1); INSERT INTO current_way_tags (way_id, k, v) VALUES (2, 'highway', 'road'); @@ -117,7 +117,7 @@ INSERT INTO way_nodes (way_id, node_id, version, sequence_id) VALUES (2, 6, 1, 3 INSERT INTO current_way_nodes (way_id, node_id, sequence_id) VALUES (2, 6, 3); INSERT INTO way_nodes (way_id, node_id, version, sequence_id) VALUES (2, 9, 1, 4); INSERT INTO current_way_nodes (way_id, node_id, sequence_id) VALUES (2, 9, 4); -/* create way 3*/ +/* create way 3 */ INSERT INTO ways (way_id, changeset_id, visible, "timestamp", version) VALUES (3, 2, true, (now() at time zone 'utc'), 1); INSERT INTO current_ways (id, changeset_id, visible, "timestamp", version) VALUES (3, 2, true, (now() at time zone 'utc'), 1); INSERT INTO current_way_tags (way_id, k, v) VALUES (3, 'highway', 'road'); @@ -184,7 +184,7 @@ INSERT INTO way_nodes (way_id, node_id, version, sequence_id) VALUES (3, 29, 1, INSERT INTO current_way_nodes (way_id, node_id, sequence_id) VALUES (3, 29, 29); INSERT INTO way_nodes (way_id, node_id, version, sequence_id) VALUES (3, 30, 1, 30); INSERT INTO current_way_nodes (way_id, node_id, sequence_id) VALUES (3, 30, 30); -/* create way 4*/ +/* create way 4 */ INSERT INTO ways (way_id, changeset_id, visible, "timestamp", version) VALUES (4, 2, true, (now() at time zone 'utc'), 1); INSERT INTO current_ways (id, changeset_id, visible, "timestamp", version) VALUES (4, 2, true, (now() at time zone 'utc'), 1); INSERT INTO current_way_tags (way_id, k, v) VALUES (4, 'highway', 'road'); diff --git a/test-files/cmd/slow/serial/ServiceChangesetDeriveCmdSqlTest/changeset-3.osc.sql b/test-files/cmd/slow/serial/ServiceChangesetDeriveCmdSqlTest/changeset-3.osc.sql index c945627c26..ce79610dc1 100644 --- a/test-files/cmd/slow/serial/ServiceChangesetDeriveCmdSqlTest/changeset-3.osc.sql +++ b/test-files/cmd/slow/serial/ServiceChangesetDeriveCmdSqlTest/changeset-3.osc.sql @@ -1,12 +1,12 @@ INSERT INTO changesets (id, user_id, created_at, closed_at) VALUES (3, 1, (now() at time zone 'utc'), (now() at time zone 'utc')); INSERT INTO changeset_tags (changeset_id, k, v) VALUES (3, 'written_by', 'Hootenanny'); -/* create node 37*/ +/* create node 37 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (37, 388549524, 1048987389, 3, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (37, 388549524, 1048987389, 3, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 38*/ +/* create node 38 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (38, 388549321, 1048979050, 3, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (38, 388549321, 1048979050, 3, true, (now() at time zone 'utc'), 3852309038, 1); -/* create way 5*/ +/* create way 5 */ INSERT INTO ways (way_id, changeset_id, visible, "timestamp", version) VALUES (5, 3, true, (now() at time zone 'utc'), 1); INSERT INTO current_ways (id, changeset_id, visible, "timestamp", version) VALUES (5, 3, true, (now() at time zone 'utc'), 1); INSERT INTO current_way_tags (way_id, k, v) VALUES (5, 'highway', 'road'); diff --git a/test-files/cmd/slow/serial/ServiceChangesetDeriveCmdSqlTest/changeset-4.osc.sql b/test-files/cmd/slow/serial/ServiceChangesetDeriveCmdSqlTest/changeset-4.osc.sql index 4eddd2b9b8..1b410bf28b 100644 --- a/test-files/cmd/slow/serial/ServiceChangesetDeriveCmdSqlTest/changeset-4.osc.sql +++ b/test-files/cmd/slow/serial/ServiceChangesetDeriveCmdSqlTest/changeset-4.osc.sql @@ -1,108 +1,108 @@ INSERT INTO changesets (id, user_id, created_at, closed_at) VALUES (4, 1, (now() at time zone 'utc'), (now() at time zone 'utc')); INSERT INTO changeset_tags (changeset_id, k, v) VALUES (4, 'written_by', 'Hootenanny'); -/* create node 39*/ +/* create node 39 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (39, 388541670, 1048997070, 4, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (39, 388541670, 1048997070, 4, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 40*/ +/* create node 40 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (40, 388540851, 1049014477, 4, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (40, 388540851, 1049014477, 4, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 41*/ +/* create node 41 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (41, 388542471, 1049010789, 4, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (41, 388542471, 1049010789, 4, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 42*/ +/* create node 42 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (42, 388542600, 1049005795, 4, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (42, 388542600, 1049005795, 4, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 43*/ +/* create node 43 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (43, 388549614, 1048997124, 4, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (43, 388549614, 1048997124, 4, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 44*/ +/* create node 44 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (44, 388545785, 1048997171, 4, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (44, 388545785, 1048997171, 4, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 45*/ +/* create node 45 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (45, 388542618, 1048997171, 4, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (45, 388542618, 1048997171, 4, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 46*/ +/* create node 46 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (46, 388539526, 1048996840, 4, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (46, 388539526, 1048996840, 4, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 47*/ +/* create node 47 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (47, 388536248, 1048996935, 4, true, (now() at time zone 'utc'), 3852309121, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (47, 388536248, 1048996935, 4, true, (now() at time zone 'utc'), 3852309121, 1); -/* create node 48*/ +/* create node 48 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (48, 388532583, 1048997543, 4, true, (now() at time zone 'utc'), 3852309121, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (48, 388532583, 1048997543, 4, true, (now() at time zone 'utc'), 3852309121, 1); -/* create node 49*/ +/* create node 49 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (49, 388532424, 1048996868, 4, true, (now() at time zone 'utc'), 3852309121, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (49, 388532424, 1048996868, 4, true, (now() at time zone 'utc'), 3852309121, 1); -/* create node 50*/ +/* create node 50 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (50, 388533001, 1048994529, 4, true, (now() at time zone 'utc'), 3852309121, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (50, 388533001, 1048994529, 4, true, (now() at time zone 'utc'), 3852309121, 1); -/* create node 51*/ +/* create node 51 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (51, 388533470, 1048993672, 4, true, (now() at time zone 'utc'), 3852309121, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (51, 388533470, 1048993672, 4, true, (now() at time zone 'utc'), 3852309121, 1); -/* create node 52*/ +/* create node 52 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (52, 388535166, 1048992699, 4, true, (now() at time zone 'utc'), 3852309121, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (52, 388535166, 1048992699, 4, true, (now() at time zone 'utc'), 3852309121, 1); -/* create node 53*/ +/* create node 53 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (53, 388535689, 1048990568, 4, true, (now() at time zone 'utc'), 3852309035, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (53, 388535689, 1048990568, 4, true, (now() at time zone 'utc'), 3852309035, 1); -/* create node 54*/ +/* create node 54 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (54, 388535509, 1048988321, 4, true, (now() at time zone 'utc'), 3852309035, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (54, 388535509, 1048988321, 4, true, (now() at time zone 'utc'), 3852309035, 1); -/* create node 55*/ +/* create node 55 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (55, 388536194, 1048987070, 4, true, (now() at time zone 'utc'), 3852309035, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (55, 388536194, 1048987070, 4, true, (now() at time zone 'utc'), 3852309035, 1); -/* create node 56*/ +/* create node 56 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (56, 388537204, 1048987233, 4, true, (now() at time zone 'utc'), 3852309035, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (56, 388537204, 1048987233, 4, true, (now() at time zone 'utc'), 3852309035, 1); -/* create node 57*/ +/* create node 57 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (57, 388539585, 1048989155, 4, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (57, 388539585, 1048989155, 4, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 58*/ +/* create node 58 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (58, 388541335, 1048988900, 4, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (58, 388541335, 1048988900, 4, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 59*/ +/* create node 59 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (59, 388541768, 1048987070, 4, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (59, 388541768, 1048987070, 4, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 60*/ +/* create node 60 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (60, 388542327, 1048983110, 4, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (60, 388542327, 1048983110, 4, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 61*/ +/* create node 61 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (61, 388544293, 1048980654, 4, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (61, 388544293, 1048980654, 4, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 62*/ +/* create node 62 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (62, 388546043, 1048977759, 4, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (62, 388546043, 1048977759, 4, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 63*/ +/* create node 63 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (63, 388547197, 1048973219, 4, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (63, 388547197, 1048973219, 4, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 64*/ +/* create node 64 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (64, 388548604, 1048968587, 4, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (64, 388548604, 1048968587, 4, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 65*/ +/* create node 65 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (65, 388549019, 1048964394, 4, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (65, 388549019, 1048964394, 4, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 66*/ +/* create node 66 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (66, 388549073, 1048961823, 4, true, (now() at time zone 'utc'), 3852309038, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (66, 388549073, 1048961823, 4, true, (now() at time zone 'utc'), 3852309038, 1); -/* create node 67*/ +/* create node 67 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (67, 388548514, 1049005693, 4, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (67, 388548514, 1049005693, 4, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 68*/ +/* create node 68 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (68, 388549290, 1049005253, 4, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (68, 388549290, 1049005253, 4, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 69*/ +/* create node 69 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (69, 388548207, 1049008079, 4, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (69, 388548207, 1049008079, 4, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 70*/ +/* create node 70 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (70, 388543319, 1049017877, 4, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (70, 388543319, 1049017877, 4, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 71*/ +/* create node 71 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (71, 388541299, 1049023065, 4, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (71, 388541299, 1049023065, 4, true, (now() at time zone 'utc'), 3852309124, 1); -/* create node 72*/ +/* create node 72 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (72, 388540541, 1049024316, 4, true, (now() at time zone 'utc'), 3852309124, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (72, 388540541, 1049024316, 4, true, (now() at time zone 'utc'), 3852309124, 1); -/* create way 6*/ +/* create way 6 */ INSERT INTO ways (way_id, changeset_id, visible, "timestamp", version) VALUES (6, 4, true, (now() at time zone 'utc'), 1); INSERT INTO current_ways (id, changeset_id, visible, "timestamp", version) VALUES (6, 4, true, (now() at time zone 'utc'), 1); INSERT INTO current_way_tags (way_id, k, v) VALUES (6, 'highway', 'road'); @@ -117,7 +117,7 @@ INSERT INTO way_nodes (way_id, node_id, version, sequence_id) VALUES (6, 42, 1, INSERT INTO current_way_nodes (way_id, node_id, sequence_id) VALUES (6, 42, 3); INSERT INTO way_nodes (way_id, node_id, version, sequence_id) VALUES (6, 45, 1, 4); INSERT INTO current_way_nodes (way_id, node_id, sequence_id) VALUES (6, 45, 4); -/* create way 7*/ +/* create way 7 */ INSERT INTO ways (way_id, changeset_id, visible, "timestamp", version) VALUES (7, 4, true, (now() at time zone 'utc'), 1); INSERT INTO current_ways (id, changeset_id, visible, "timestamp", version) VALUES (7, 4, true, (now() at time zone 'utc'), 1); INSERT INTO current_way_tags (way_id, k, v) VALUES (7, 'highway', 'road'); @@ -184,7 +184,7 @@ INSERT INTO way_nodes (way_id, node_id, version, sequence_id) VALUES (7, 65, 1, INSERT INTO current_way_nodes (way_id, node_id, sequence_id) VALUES (7, 65, 29); INSERT INTO way_nodes (way_id, node_id, version, sequence_id) VALUES (7, 66, 1, 30); INSERT INTO current_way_nodes (way_id, node_id, sequence_id) VALUES (7, 66, 30); -/* create way 8*/ +/* create way 8 */ INSERT INTO ways (way_id, changeset_id, visible, "timestamp", version) VALUES (8, 4, true, (now() at time zone 'utc'), 1); INSERT INTO current_ways (id, changeset_id, visible, "timestamp", version) VALUES (8, 4, true, (now() at time zone 'utc'), 1); INSERT INTO current_way_tags (way_id, k, v) VALUES (8, 'highway', 'road'); diff --git a/test-files/io/ServiceOsmApiDbSqlChangesetFileWriterTest/changeset.osc.sql b/test-files/io/ServiceOsmApiDbSqlChangesetFileWriterTest/changeset.osc.sql index 6c8f89cd46..7f57091fc5 100644 --- a/test-files/io/ServiceOsmApiDbSqlChangesetFileWriterTest/changeset.osc.sql +++ b/test-files/io/ServiceOsmApiDbSqlChangesetFileWriterTest/changeset.osc.sql @@ -1,6 +1,6 @@ INSERT INTO changesets (id, user_id, created_at, closed_at) VALUES (1, 1, (now() at time zone 'utc'), (now() at time zone 'utc')); INSERT INTO changeset_tags (changeset_id, k, v) VALUES (1, 'written_by', 'Hootenanny'); -/* modify way 1*/ +/* modify way 1 */ INSERT INTO ways (way_id, changeset_id, visible, "timestamp", version) VALUES (1, 1, true, (now() at time zone 'utc'), 2); UPDATE current_ways SET changeset_id=1, visible=true, "timestamp"=(now() at time zone 'utc'), version=2 WHERE id=1; DELETE FROM current_way_tags WHERE way_id = 1; @@ -13,39 +13,39 @@ INSERT INTO way_nodes (way_id, node_id, version, sequence_id) VALUES (1, 1, 1, 1 INSERT INTO current_way_nodes (way_id, node_id, sequence_id) VALUES (1, 1, 1); INSERT INTO way_nodes (way_id, node_id, version, sequence_id) VALUES (1, 2, 1, 2); INSERT INTO current_way_nodes (way_id, node_id, sequence_id) VALUES (1, 2, 2); -/* modify node 3*/ +/* modify node 3 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (3, -88, 69, 1, true, (now() at time zone 'utc'), 2505397589, 2); UPDATE current_nodes SET latitude=-88, longitude=69, changeset_id=1, visible=true, "timestamp"=(now() at time zone 'utc'), tile=2505397589, version=2 WHERE id=3; DELETE FROM current_node_tags WHERE node_id = 3; DELETE FROM node_tags WHERE node_id = 3; -/* delete way 2*/ +/* delete way 2 */ INSERT INTO ways (way_id, changeset_id, visible, "timestamp", version) VALUES (2, 1, false, (now() at time zone 'utc'), 2); DELETE FROM current_way_tags WHERE way_id = 2; DELETE FROM way_tags WHERE way_id = 2; DELETE FROM current_way_nodes WHERE way_id=2; DELETE FROM current_relation_members WHERE member_type='Way' AND member_id=2; UPDATE current_ways SET changeset_id=1, visible=false, version=2 WHERE id=2; -/* create node 1*/ +/* create node 1 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (1, 46, -127, 1, true, (now() at time zone 'utc'), 1789569706, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (1, 46, -127, 1, true, (now() at time zone 'utc'), 1789569706, 1); -/* delete relation 1*/ +/* delete relation 1 */ INSERT INTO relations (relation_id, changeset_id, visible, "timestamp", version) VALUES (1, 1, false, (now() at time zone 'utc'), 2); DELETE FROM current_relation_tags WHERE relation_id = 1; DELETE FROM relation_tags WHERE relation_id = 1; DELETE FROM current_relation_members WHERE relation_id=1; DELETE FROM current_relation_members WHERE member_type='Relation' AND member_id=1; UPDATE current_relations SET changeset_id=1, visible=false, version=2 WHERE id=1; -/* delete way 4*/ +/* delete way 4 */ INSERT INTO ways (way_id, changeset_id, visible, "timestamp", version) VALUES (4, 1, false, (now() at time zone 'utc'), 2); DELETE FROM current_way_tags WHERE way_id = 4; DELETE FROM way_tags WHERE way_id = 4; DELETE FROM current_way_nodes WHERE way_id=4; DELETE FROM current_relation_members WHERE member_type='Way' AND member_id=4; UPDATE current_ways SET changeset_id=1, visible=false, version=2 WHERE id=4; -/* create node 2*/ +/* create node 2 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (2, 57, -30, 1, true, (now() at time zone 'utc'), 1789569706, 1); INSERT INTO current_nodes (id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (2, 57, -30, 1, true, (now() at time zone 'utc'), 1789569706, 1); -/* modify way 5*/ +/* modify way 5 */ INSERT INTO ways (way_id, changeset_id, visible, "timestamp", version) VALUES (5, 1, true, (now() at time zone 'utc'), 2); UPDATE current_ways SET changeset_id=1, visible=true, "timestamp"=(now() at time zone 'utc'), version=2 WHERE id=5; DELETE FROM current_way_tags WHERE way_id = 5; @@ -58,7 +58,7 @@ INSERT INTO way_nodes (way_id, node_id, version, sequence_id) VALUES (5, 12, 1, INSERT INTO current_way_nodes (way_id, node_id, sequence_id) VALUES (5, 12, 1); INSERT INTO way_nodes (way_id, node_id, version, sequence_id) VALUES (5, 13, 1, 2); INSERT INTO current_way_nodes (way_id, node_id, sequence_id) VALUES (5, 13, 2); -/* create relation 1*/ +/* create relation 1 */ INSERT INTO relations (relation_id, changeset_id, visible, "timestamp", version) VALUES (1, 1, true, (now() at time zone 'utc'), 1); INSERT INTO current_relations (id, changeset_id, visible, "timestamp", version) VALUES (1, 1, true, (now() at time zone 'utc'), 1); INSERT INTO current_relation_tags (relation_id, k, v) VALUES (1, 'key2', 'value2'); @@ -67,7 +67,7 @@ INSERT INTO relation_members (relation_id, member_type, member_id, member_role, INSERT INTO current_relation_members (relation_id, member_type, member_id, member_role, sequence_id) VALUES (1, 'Node', 14, 'role1', 1); INSERT INTO relation_members (relation_id, member_type, member_id, member_role, version, sequence_id) VALUES (1, 'Way', 6, 'role2', 1, 2); INSERT INTO current_relation_members (relation_id, member_type, member_id, member_role, sequence_id) VALUES (1, 'Way', 6, 'role2', 2); -/* delete node 16*/ +/* delete node 16 */ INSERT INTO nodes (node_id, latitude, longitude, changeset_id, visible, "timestamp", tile, version) VALUES (16, -43, -6, 1, false, (now() at time zone 'utc'), 1073741823, 2); DELETE FROM current_node_tags WHERE node_id = 16; DELETE FROM node_tags WHERE node_id = 16;