Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/relations processing #490

Merged
merged 24 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b81daed
Relations refactor, all tests passed
emi420 Mar 27, 2024
9b8389f
Code improvement
emi420 Mar 27, 2024
61863aa
Fixes for Relations/MultiLineString/MultiPolygon
emi420 Mar 27, 2024
8ecf0be
Working in Relations/multigeometries
emi420 Mar 28, 2024
7ef963a
Merge branch 'master' into feature/relationsProcessing
emi420 Apr 2, 2024
9b6da04
Fixes for processing relations/multigeometries
emi420 Apr 2, 2024
3560eef
Fixes for processing relations/multigeometries
emi420 Apr 3, 2024
2601bdd
Remove unused code
emi420 Apr 3, 2024
a8b5b06
Merge branch 'master' into feature/relationsProcessing
emi420 Apr 3, 2024
6f0a19b
Merge branch 'master' into feature/relationsProcessing
emi420 Apr 4, 2024
cd141b4
Merge branch 'feature/relationsProcessing' of github.com:hotosm/under…
emi420 Apr 4, 2024
3a66efc
Fix for config path
emi420 Apr 4, 2024
5daa466
Delete outdated geometries, fix for Relations multigeometries, add ve…
emi420 Apr 8, 2024
a261b91
Fix for using changeseturl only. Small fix for warning on Node class
emi420 Apr 8, 2024
0a453a2
Fix modification of referenced var inside a function
emi420 Apr 8, 2024
9a0713b
Update copyright notice
emi420 Apr 8, 2024
62acc6e
Save timestamp when a relation geometry was modified
emi420 Apr 8, 2024
4fbfa3e
Save timestamp when a way geometry was modified, fix
emi420 Apr 8, 2024
9698831
Commenting code, add some fixes for Raw data and a new test case for …
emi420 Apr 16, 2024
6fd1dfc
Working on fixes and improvements for Raw data processing
emi420 Apr 17, 2024
b94ff62
Clear linestring when way is closed and it's a polygon. Remove debug …
emi420 Apr 24, 2024
85fb8e7
Fix for saving relation member ref type, remove debug code
emi420 Apr 24, 2024
33fd7c1
Remove unnecessary conditions, check for empty geometries
emi420 May 6, 2024
b1ac29b
Merge branch 'master' into feature/relationsProcessing
emi420 May 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/bootstrap/bootstrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Bootstrap::start(const underpassconfig::UnderpassConfig &config) {

processWays();
processNodes();
// processRelations();
processRelations();

}

Expand Down Expand Up @@ -358,7 +358,7 @@ Bootstrap::threadBootstrapRelationTask(RelationTask relationTask)
BootstrapTask task;
int processed = 0;

// auto relationval = std::make_shared<std::vector<std::shared_ptr<ValidateStatus>>>();
auto relationval = std::make_shared<std::vector<std::shared_ptr<ValidateStatus>>>();

// Proccesing relations
for (size_t i = taskIndex * page_size; i < (taskIndex + 1) * page_size; ++i) {
Expand Down
58 changes: 22 additions & 36 deletions src/data/pq.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2020, 2021, 2023 Humanitarian OpenStreetMap Team
// Copyright (c) 2020, 2021, 2023, 2024 Humanitarian OpenStreetMap Team
//
// This file is part of Underpass.
//
Expand Down Expand Up @@ -160,48 +160,34 @@ Pq::query(const std::string &query)
std::string
Pq::escapedString(const std::string &s)
{
std::string newstr;
size_t i = 0;
while (i < s.size()) {
// Single quote (')
if (s[i] == '\'') {
newstr += "''";
// Slash (\)
} else if (s[i] == '\\') {
newstr += "\\\\";
} else {
newstr += s[i];
}
i++;
}
return sdb->esc(newstr);
return sdb->esc(s);
}

std::string
Pq::escapedJSON(const std::string &s) {
std::ostringstream o;
for (auto c = s.cbegin(); c != s.cend(); c++) {
switch (*c) {
case '\x00': o << "\\u0000"; break;
case '\x01': o << " "; break;
case '\x02': o << " "; break;
case '\x03': o << " "; break;
case '\x04': o << " "; break;
case '\x05': o << " "; break;
case '\x06': o << " "; break;
case '\x07': o << " "; break;
case '\x08': o << " "; break;
case '\x09': o << " "; break;
case '\x0a': o << "\\n"; break;
case '\x0b': o << " "; break;
case '\x0c': o << " "; break;
case '\x0d': o << " "; break;
case '\x0e': o << " "; break;
case '\xfe': o << " "; break;
case '\x1f': o << "\\u001f"; break;
case '\x22': o << "\\\""; break;
case '\x5c': o << "\\\\"; break;
default: o << *c;
case '\x00': o << "\\u0000"; break;
case '\x01': o << " "; break;
case '\x02': o << " "; break;
case '\x03': o << " "; break;
case '\x04': o << " "; break;
case '\x05': o << " "; break;
case '\x06': o << " "; break;
case '\x07': o << " "; break;
case '\x08': o << " "; break;
case '\x09': o << " "; break;
case '\x0a': o << "\n"; break;
case '\x0b': o << " "; break;
case '\x0c': o << " "; break;
case '\x0d': o << " "; break;
case '\x0e': o << " "; break;
case '\xfe': o << " "; break;
case '\x1f': o << "\\u001f"; break;
case '\x22': o << "\""; break;
case '\x5c': o << "\\"; break;
default: o << *c;
}
}
return o.str();
Expand Down
2 changes: 1 addition & 1 deletion src/osm/changeset.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2020, 2021, 2022, 2023 Humanitarian OpenStreetMap Team
// Copyright (c) 2020, 2021, 2022, 2023, 2024 Humanitarian OpenStreetMap Team
//
// This file is part of Underpass.
//
Expand Down