# Accurate Collaborative Globally-Referenced Digital Mapping with Standard GNSS
## 4 Globally-Referenced Electro-Optical SLAM (GEOSLAM)
### Multi-Session Mapping
#### 4.3.1 Map Database  
Storage and reuse of maps is a pre-requisite for multi-session mapping. For a given session, the SLAM map is created in the \(\mathcal{S}\) frame. However, such a map is not readily usable in successive mapping sessions since the \(\mathcal{S}\) frame is distinct for each session. Fortunately, the integration of visual SLAM with GNSS enables transformation of the SLAM map in to the \(\mathcal{G}\) frame.  
At the end of the \(p\)th mapping session in the local frame \(\mathcal{S}_{p}\), GEOSLAM stores the data to a map database after applying the \(\left(R_{\mathcal{G}}^{\mathcal{S}_{p}},\mathbf{t}_{\mathcal{G}}^{\mathcal{S}_{p }}\right)\) transformation, as estimated during initialization for the \(p\)th session, to all map point positions, all keyframe poses, and all GNSS measurements associated with each keyframe:  
\[\mathbf{x}_{\mathcal{C}_{n}}^{\mathcal{G}} =\left(R_{\mathcal{G}}^{\mathcal{S}_{p}}\right)^{T}\left(\mathbf{x}_{ \mathcal{C}_{n}}^{\mathcal{S}_{p}}-\mathbf{t}_{\mathcal{G}}^{\mathcal{S}_{p}} \right);\quad R\left(\mathbf{\theta}_{\mathcal{C}_{n}}^{\mathcal{G}}\right)=\left( R_{\mathcal{G}}^{\mathcal{S}_{p}}\right)^{T}R\left(\mathbf{\theta}_{\mathcal{C}_{n}}^{ \mathcal{S}_{p}}\right),\] \[\mathbf{x}_{p_{m}}^{\mathcal{G}} =\left(R_{\mathcal{G}}^{\mathcal{S}_{p}}\right)^{T}\left(\mathbf{x}_{ p_{m}}^{\mathcal{S}_{p}}-\mathbf{t}_{\mathcal{G}}^{\mathcal{S}_{p}}\right),\] \[\mathbf{z}_{\mathcal{C}_{n}}^{\mathcal{G}} =\left(R_{\mathcal{G}}^{\mathcal{S}_{p}}\right)^{T}\left(\mathbf{z}_{ \mathcal{C}_{n}}^{\mathcal{S}_{p}}-\mathbf{t}_{\mathcal{G}}^{\mathcal{S}_{p}} \right).\]  
At the beginning of the \((p+1)\)th session, GEOSLAM again estimates the \(\left(R_{\mathcal{G}}^{\mathcal{S}_{p+1}},\mathbf{t}_{\mathcal{G}}^{\mathcal{S}_{ p+1}}\right)\) transformation during initialization. The map database from previous session(s) is then loaded after applying the transformation for the \(p+1\) session, such that the prior map points, keyframes, and measurements are rendered in the \(\mathcal{S}_{p+1}\) frame:  
\[\mathbf{x}_{\mathcal{C}_{n}}^{\mathcal{S}_{p+1}} =R_{\mathcal{G}}^{\mathcal{S}_{p+1}}\mathbf{x}_{\mathcal{C}_{n}}^{ \mathcal{G}}+\mathbf{t}_{\mathcal{G}}^{\mathcal{S}_{p+1}};\quad R\left(\mathbf{\theta}_ {\mathcal{C}_{n}}^{\mathcal{S}_{p+1}}\right)=\left(R_{\mathcal{G}}^{\mathcal{ S}_{p+1}}\right)R\left(\mathbf{\theta}_{\mathcal{C}_{n}}^{\mathcal{G}}\right),\] \[\mathbf{x}_{p_{m}}^{\mathcal{S}_{p+1}} =R_{\mathcal{G}}^{\mathcal{S}_{p+1}}\mathbf{x}_{p_{m}}^{\mathcal{G}}+ \mathbf{t}_{\mathcal{G}}^{\mathcal{S}_{p+1}},\] \[\mathbf{z}_{\mathcal{C}_{n}}^{\mathcal{S}_{p+1}} =R_{\mathcal{G}}^{\mathcal{S}_{p+1}}\mathbf{z}_{\mathcal{C}_{n}}^{ \mathcal{G}}+\mathbf{t}_{\mathcal{G}}^{\mathcal{S}_{p+1}}.\]  
After loading the prior map, the standard GEOSLAM pipeline is executed for each stereo image pair in the \((p+1)\)th session. In addition, GEOSLAM attempts to detect if the vehicle is currently passing through a previously-mapped region. If so, a map merge is declared and the current and prior keyframes are jointly optimized, as detailed in Section 4.3.2. Finally, at the end of the mapping session, the combined map is stored back in the database as described before.