MCPcopy Create free account
hub / github.com/Tencent/TAD_Sim / updateObjectGEOM

Method updateObjectGEOM

common/map_sdk/mapdb/src/sqlite_operation.cpp:1834–1865  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1832}
1833
1834bool sqliteOperation::updateObjectGEOM(const hadmap::tx_object_geom_t& objectgeom) {
1835 char sql[512];
1836 sprintf(sql, "UPDATE " OBJECT_GEOM_TABLE " SET type = ? , style = ?, color = ?, size = ?, geom = ? WHERE pkid = %llu",
1837 objectgeom.pkid);
1838 sqliteStmtPtr stmt(dbPtr, sql);
1839 sqlite3_blob_data blob;
1840 sqlite3_bind_int(stmt, 1, objectgeom.type);
1841 sqlite3_bind_int(stmt, 2, objectgeom.style);
1842 sqlite3_bind_int(stmt, 3, objectgeom.color);
1843 if (objectgeom.geom.size() > 0) {
1844 hadmap::Points3d linestring;
1845 sqlite3_blob_data blob;
1846 std::vector<double> sizes;
1847 linestring.resize(objectgeom.geom.size());
1848 sizes.resize(objectgeom.geom.size() * 2);
1849 for (size_t k = 0; k < objectgeom.geom.size(); ++k) {
1850 linestring[k].x = objectgeom.geom[k].x;
1851 linestring[k].y = objectgeom.geom[k].y;
1852 linestring[k].z = objectgeom.geom[k].z;
1853 sizes[k * 2] = objectgeom.geom[k].w;
1854 sizes[k * 2 + 1] = objectgeom.geom[k].h;
1855 }
1856 sqlite3_bind_blob(stmt, 4, &sizes[0], sizeof(double) * sizes.size(), SQLITE_TRANSIENT);
1857 createBlob(linestring, objectgeom.srs, blob);
1858 sqlite3_bind_blob(stmt, 5, blob.data, blob.size, SQLITE_TRANSIENT);
1859 }
1860 int r = sqlite3_step(stmt);
1861 if (SQLITE_DONE != r) std::cerr << "Update Lane Link Error, Code " << r << std::endl;
1862 sqlite3_reset(stmt);
1863 return (r == SQLITE_DONE);
1864 return false;
1865}
1866
1867bool sqliteOperation::deleteRoad(const uint64_t& road_pkid) {
1868 char sql[512];

Callers

nothing calls this directly

Calls 3

createBlobFunction · 0.85
sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected