## 4 Mobility and Environmental Data Integration: System Overview
### Problem Formulation  
We formulate a few definitions in a sequence that assists in understanding the mechanism by which the main component of EMDI (i.e., spatial join) operates.  
**Definition 1**.: _A georeferenced dataset \(S\) is a series that contains tuples on the form (\(x,y,\) values) such that \(S=\{(x_{1},y_{1},v_{1}),\ldots\ldots\ldots,(x_{n},y_{n},v_{n})\}\), where \(x_{i}\) and \(y_{i}\) are the geographical coordinates (typically longitudes and latitudes) of a location (point, POI, etc.) \(v_{i}\) are some scalar values or otherwise categorical values associated with that location. For example, (\(x,y\)) could represent the location of a moving car in a trajectory, while 'values' represent its'speed' and 'number of riding passengers' at that location. For pollution data, (\(x,y\)) represents the location where the measurement of the pollution level has been captured (using a fixed or moving sensing station), whereas values may represent the [PM\({}_{10}\), PM\({}_{2.5}\)] at that location, in addition to the time the measurement was taken._  
**Definition 2**.: _Region data \(R\) is a georeferenced data representing a geographical area (e.g., city) in the form of shapefile or a Geojson file, where each administrative division (known as neighborhoods, districts, boroughs etc.) is known as polygon and is represented by a set of geo  
Figure 4: High level view of an integrated mobility, pollution, and meteorological data system.  
graphical coordinates on the form of \((x{r_{1}},\,{y_{1}},\,{v_{1}})\), such that \(R=\{\)P\({}_{1}\), P\({}_{2}\),...., \(P_{m}\}\) where \(P_{j}=\big{\{}\big{(}x{r_{1}},\,{y_{1}}{r_{j}},\,{v_{1}}{r_{1}}\big{)}\), \(\big{(}x{r_{2}}{r_{j}},\,{y_{2}}{r_{j}},\,{v_{2}}{r_{j}}\big{)}\),......., \(\big{(}x{n_{r}}{r_{j}},\,{y_{n}}{r_{j}},\,{v_{n}}{r_{j}}\big{)}\big{\}}\), where \(m\) is the number of polygons, \(n\) is the number of vertices (points) representing a specific polygon belonging to the region \(R\). \(x{{}_{1}}{r_{j}}\) is the \(x\) coordinate of the first point in region \(j\)._  
**Definition 3**.: _Cross-domain plain spatial join. Given two georeferenced datasets \(S\) on the form \(S=\big{\{}(xs_{1},\,ys_{1},\,vs_{1})\), \(\big{(}xs_{2},\,ys_{2},\,vs_{2})\),......., \(\big{(}xs_{n},\,ys_{n},\,vs_{n})\big{\}}\) and \(Q=\big{\{}(x{q_{1}},\,{yq_{1}},\,{vq_{1}}),(x{q_{2}},\,{yq_{2}},\,{vq_{2}})\),......., \((x{n_{n}},\,{yq_{n}},\,{vq_{n}})\big{\}}\), then cross domain spatial join can be defined as \(S\bowtie_{predicate}\)\(Q=\)\(\{\)(\(s\), \(q\)\(\mid\)\(\,s\)\(\,  
\(\left\{(xp_{1},yp_{1},gp_{1},hep_{1},vp_{1},vm_{1}),\ldots\ldots,\left(xp_{n},yp_{n},gp_{n},hep_{n}vp_{n},vm_{n}\right)\right\}\), containing values from both datasets that belong to the same geographical location, in this case within the same geohash and neighborhood (polygon).  
In this paper, joining pollution and mobility data is an example of a cross-domain spatial join. The predicate in this case is more complicated than typical spatial join predicates, such as 'within', 'touches' etc., This is so because of the difference in the granularity (resolution) of mobility and pollution data. To the best of our knowledge, this is the first application of its kind that adapts and retrofits the plain filter-and-refinement approach for joining cross-domain georeferenced datasets with QoS guarantees. The mechanism by which we have implemented this definition in our EMDI systems is better explored in Section 4.2.  
Having said that, a principal component of our system is a component that brings both datasets (mobility and pollution in this case) into the same resolution space to be able to join the two datasets. In our implementation, this resolution is represented as the geohash encoding as will be discussed shortly.