Autonomous Gaussian decomposition of the Galactic Ring Survey. II. The Galactic distribution of 13CO

Knowledge about the distribution of CO emission in the Milky Way is essential to understand the impact of Galactic environment on the formation and evolution of structures in the interstellar medium. However, currently our insight about the fraction of CO in spiral arm and interarm regions is still limited by large uncertainties in assumed rotation curve models or distance determination techniques. In this work we use a Bayesian approach to obtain the current best assessment of the distribution of 13CO from the Galactic Ring Survey. We performed two different distance estimates that either included or excluded a model for Galactic features. We also include a prior for the solution of the kinematic distance ambiguity that was determined from a compilation of literature distances and an assumed size-linewidth relationship. We find that the fraction of 13CO emission associated with spiral arm features varies from 76% to 84% between the two distance runs. The vertical distribution of the gas is concentrated around the Galactic midplane showing FWHM values of ~75 pc. We do not find any significant difference between gas emission properties associated with spiral arm and interarm features. In particular the distribution of velocity dispersion values of gas emission in spurs and spiral arms is very similar. We detect a trend of higher velocity dispersion values with increasing heliocentric distance, which we attribute to beam averaging effects caused by differences in spatial resolution. We argue that the true distribution of the gas emission is likely more similar to a combination of our two distance results, and highlight the importance of using complementary distance estimations to safeguard against the pitfalls of any single approach. We conclude that the methodology presented in this work is a promising way to determine distances to gas emission features in Galactic plane surveys.


Introduction
A long-standing problem in astrophysics is how molecular gas, in particular the isotopologues of carbon monoxide (CO), is distributed in the Milky Way (for reviews see e.g. Combes 1991;Heyer & Dame 2015). Knowledge about the location of the molecular gas in our Galaxy is essential to answer important open questions in interstellar medium (ISM) research, such as the impact and importance of different Galactic environments (e.g. spiral arm and interarm regions) on star formation and the origin and evolution of ISM structures.
Addressing these scientific questions in an unbiased and systematic way requires the detailed analysis of CO emission line surveys of the Galactic plane, which usually consist of hundreds of thousands to millions of spectra (e.g. Dame et al. 2001;Jackson et al. 2006;Umemoto et al. 2017;Su et al. 2019). Many studies have focussed on extracting structures from these surveys, which have been compiled into catalogues of physical objects such as molecular clouds and clumps (e.g. Solomon et al. 1987;Rathborne et al. 2009;Rice et al. 2016;Miville-Deschênes et al. * Member of the International Max-Planck Research School for Astronomy and Cosmic Physics at the University of Heidelberg (IMPRS-HD), Germany 2017; Rigby et al. 2019). Alternative approaches (e.g. Sawada et al. 2012;Roman-Duval et al. 2016;Riener et al. 2020) have focussed on an analysis of these data sets without a segmentation into pre-defined physical objects, which bypasses the step of classifying the fundamentally continuous nature of the ISM into discrete objects. However, both approaches require the determination of distances to the gas emission to permit a homogeneous analysis and comparison across different Galactic environments that accounts for differences in spatial resolution introduced by our vantage point inside the Galactic disk.
Molecular gas observations entail additional information about the radial velocity of the gas emission along the line of sight-the velocity difference to the local standard of rest or v LSRwhich many Galactic plane studies have used in conjunction with an assumed model for the rotation curve of our Galaxy to estimate distances via the kinematic distance (KD) method (e.g. Dame et al. 1986;Roman-Duval et al. 2009Elia et al. 2017;Miville-Deschênes et al. 2017). However, the KD method is based on a model for the Galactic rotation curve and thus assumes the gas to be in rotational equilibrium, whereas the Milky Way is characterised by streaming motions (e.g. Combes 1991;Reid et al. 2009; López-Corredoira & Sylos Labini 2019; Reid et al. 2019). Especially around spiral arms we expect strong de-Article number, page 1 of 27 arXiv:2006.03294v1 [astro-ph.GA] 5 Jun 2020 A&A proofs: manuscript no. grs-distribution viations from purely circular rotation that can reach values of up to 10 km s −1 and can lead to large kinematic distance uncertainties of up to 2 − 3 kpc (e.g Burton 1971;Liszt & Burton 1981;Stark & Brand 1989;Gómez 2006;Reid et al. 2009;Ramón-Fox & Bonnell 2018). Moreover, the non-axisymmetric potential introduced by the Galactic bar causes large non-circular motions in the gas within Galactocentric distances of ∼ 5 kpc (e.g. Reid et al. 2019). Towards the Galactic centre and close to the Sun the observed gas velocity has also almost no radial component which yields large distance uncertainties (see e.g. the kinematic distance avoidance zones in Fig. 1 of Ellsworth-Bowers et al. 2015).
Another big problem of the KD method is that it always yields two possible distance solutions in the inner Galaxy (i.e. for emission within the solar orbit), which has been termed the kinematic distance ambiguity (KDA). Additional information is needed to resolve the KDA and previous studies have utilised an abundance of methods to solve for it by using, for example, H i self absorption (e.g. Jackson et al. 2002;Roman-Duval et al. 2009;Wienen et al. 2012;Urquhart et al. 2018), H i absorption against ultracompact H ii regions (Fish et al. 2003), H i emission/absorption (e.g. , association with infrared dark clouds (e.g. Simon et al. 2006b, Duarte-Cabral, in prep.), or the use of scaling relationships (e.g. Rice et al. 2016;Miville-Deschênes et al. 2017).
Notwithstanding all these issues in establishing reliable distances, many studies of molecular clouds extracted from 12 CO (1-0) or 13 CO (1-0) surveys tried to identify their position within the Galaxy (Combes 1991;Heyer & Dame 2015;Rice et al. 2016;Miville-Deschênes et al. 2017) and found large variations in how well the clouds trace the gaseous spiral arm structure and the fraction of clouds located in interarm regions. In terms of star formation, we expect an enhancement in spiral arms due to effects of gravitational instabilities, cloud collisions, and orbit crowding (e.g. Elmegreen 2009). Even though sites of massive star formation seem to be predominantly associated with spiral arms (e.g. Urquhart et al. 2018), recent studies have found no significant impact of Galactic structure on the clump or star formation efficiency of dense clumps (e.g. Moore et al. 2012;Eden et al. 2013Eden et al. , 2015Ragan et al. 2016Ragan et al. , 2018, or the physical properties of filaments (Schisano et al. 2019) and molecular clumps (Rigby et al. 2019). However, the last study reported differences in the linewidths between clumps located in interarm and spiral arm structures. A recent study by Wang et al. (2020) also found clear differences in the ratio of atomic to molecular gas in arm and interarm regions.
We note that many of these studies used different Galactic rotation curve models and rotation parameters (e.g. Clemens 1985;Brand & Blitz 1993;Reid et al. 2014) in their distance estimation; also different spiral arm models (e.g. Taylor & Cordes 1993;Vallee 1995;Reid et al. 2014) have been used as a comparison. The exact number and precise locations of the spiral arms in our Milky Way is debated, even though recent years have seen huge progress in our understanding of Galactic structure (see e.g. the recent review from Xu et al. 2018). In particular, advances have been made by precise parallax measurements of masers associated with high-mass star-forming regions (e.g. Reid et al. 2009Reid et al. , 2014Reid et al. , 2019VERA collaboration et al. 2020). New distance estimation approaches have emerged that use a Bayesian approach to combine these parallax measurements with additional information from CO and H i surveys (Reid et al. 2016(Reid et al. , 2019, which has already been used in the distance estimation to molecular clouds and clumps (e.g. Rice et al. 2016;Urquhart et al. 2018;Rigby et al. 2019, Duarte-Cabral, in prep.).
Our main motivation with this work is to use the currently most precise model for the structure and rotation curve of the Milky Way from Reid et al. (2019) in conjunction with the Bayesian approach presented in Reid et al. (2016Reid et al. ( , 2019 to analyse the distribution of molecular gas within the Galactic disk. With the distance results we further can discuss variations of the gas emission properties with Galactic environment or Galactocentric distance. By using additional priors based on literature resolutions of the KDA for molecular clouds and clumps and considerations based on a size-linewidth relationship, we derive distance estimates to all Gaussian components we fitted to the data set of a large 13 CO (1-0) Galactic plane survey in the first quadrant (Riener et al. 2020). In this work we present the results of two distance runs, one including and one excluding a prior for Galactic features. This approach allows us to determine lower and upper limits for the fraction of emission within spiral arm and interarm locations, and enables us to discuss the robustness of our results in terms of how much the gas emission varies with Galactocentric distance and Galactic features.

Gaussian decomposition of the GRS
In this work we use the Gaussian decomposition results of the entire Boston University-Five College Radio Astronomy Observatory Galactic Ring Survey (GRS; Jackson et al. 2006) data set as presented in Riener et al. (2020) 1 . The GRS is a 13 CO (1-0) emission line survey that spans ranges 2 in Galactic longitude, Galactic latitude, and velocity of 14 • < < 55.7 • , |b| < 1.1 • , and −5 < v LSR < 135 km s −1 . The GRS consists of about 2.28 million spectra; the data has an angular resolution of 46 , a pixel sampling of 22 , and a spectral resolution of 0.21 km s −1 . Riener et al. (2020) used the fully automated Gaussian decomposition package GaussPy+ (Riener et al. 2019) 3 to fit all GRS spectra in their native spatial and spectral resolution, which resulted in about 4.65 million velocity fit components. They estimate that the decomposition was able to recover about 87.5% of the flux from the GRS data set, with the remaining fraction of flux being due to diffuse emission or spectra with elevated noise levels that made the extraction of signal very challenging. Riener et al. (2020) made the entire decomposition results available, and also provide quality metrics (such as the number of strongly blended components) for the fit results 1 .

Bayesian distance calculator
For the distance estimation we used the Bayesian distance calculator (BDC) tool (Reid et al. 2016(Reid et al. , 2019 that was designed for the distance calculation of spiral arm sources. For a given ( , b, v LSR ) coordinate, the BDC calculates a distance probability density function (PDF) based on multiple priors that can be selected by the user. In the current version of the BDC (v2.4, Reid et al. 2019) this includes the following priors: KD: the kinematic distance; GL: the Galactic latitude value or displacement from the Galactic midplane; PS: the proximity to parallax sources; these are high mass starforming regions, whose trigonometric parallaxes have been determined as part of the Bar and Spiral Structure Legacy (BeSSeL) Survey 4 and the Japanese VLBI Exploration of Radio Astrometry (VERA) 5 ; SA: the proximity to features from an assumed spiral arm model; these features (such as spiral arms and spurs) have been inferred from combining information from the parallax sources with archival CO and H i Galactic plane surveys; PM: the proper motion of the source.
The BDC allows users to set weights for these priors (P KD , P GL , P PS , P SA , P PM ) that can range from 0 to 1. If the weight of a prior is set to 0 it is neglected in the distance estimation. In the default settings of the BDC, all prior weights are set to 0.85, with the exception of P PS , which receives a lower weight of 0.15. In addition, users can also supply a prior for the resolution of the KDA, that means they can provide information on whether the source location is expected to be on the near or far side of the Galactic disk. The weight P far for this prior is by default set to 0.5, so that the near and far solutions of the KD prior receive equal weight. In this work we introduce two additional priors based on literature solutions of the KDA (Sect. 3.2) and a sizelinewidth relationship (Sect. 3.3) that inform the P far value for individual sources.

Distance estimation
Here we describe our method for the distance estimation. Since the BDC was designed as a distance estimator for spiral arm sources, its default settings have an inherent bias of associating ( , b, v LSR ) coordinates with the assumed spiral arm model (see Fig. 6 in Reid et al. 2016). To better characterise the impact of this bias, we decided to perform and compare distance calculations with and without the SA prior, which we refer to further on as Run A and Run B, respectively. The two distance results represent two very useful extremes in the parameter space of the distance estimation. In one case we intentionally bias the emission towards our currently best knowledge of spiral arm features or overdensities of H i and CO, which we would expect to also coincide with overdensities in 13 CO. In the other case we obtain a picture that is unbiased by an assumed spiral arm model, but is much more dominated by the chosen Galactic rotation curve and suffers more from kinematic distance uncertainties and errors introduced by streaming motions. In the following, we present our settings for these two BDC runs, detail how we incorporated additional prior information based on literature KDA information and the fitted linewidths, and discuss how we choose the final distance results.

Modification of the BDC and setting of prior weights
For the distance calculation we use the most recent version of the BDC tool (Sect. 2.2) with the default Galactic rotation curve parameters as determined by Reid et al. (2019); Table 1 lists the most important parameters. R 0 denotes the distance to the Galactic centre and Θ 0 (or a 1 ) is the estimated circular rotation speed at the position of the Sun; both values are in very good agreement with independent observations and measurements (Gravity Collaboration et al. 2019;Kawata et al. 2019). The a 1 , a 2 , and a 3 values are parameters used in the "universal" form of the rotation curve from Persic et al. (1996) that was adopted in the BDC 4 http://bessel.vlbi-astrometry.org 5 http://veraserver.mtk.nao.ac.jp  (Reid et al. 2014(Reid et al. , 2016(Reid et al. , 2019. U , V , and W denote the solar peculiar motions towards the Galactic centre, in the direction of Galactic rotation, and towards the north Galactic pole, respectively. The BDC results are strongly influenced by the choice of the spiral arm model and the included parallax measurements to maser sources. It is therefore instructive to discuss and illustrate how many spiral arm features and maser sources overlap with the GRS coverage as these will be decisive factors in the distance estimation. The left panel in Fig. 1 shows Galactic features, such as spiral arms and spurs, that were inferred from distance measurements to maser parallax sources and archival CO and H i surveys (Reid et al. 2016(Reid et al. , 2019 and are used as spiral arm model for the SA prior. The width of the spiral arm features shows the approximate extent for associations of data points with these features. In the right panel we show the position and distance uncertainties of 71 maser sources from Reid et al. (2019) that are overlapping with the spatial and spectral coverage of the GRS. These maser sources all have parallax uncertainties < 20%, which is the BDC default requirement for the inclusion of parallax sources for the PS prior. The PS prior for GRS sources is determined by associ-ation with one or more of these parallax sources (see Reid et al. 2016 for how this association is performed). Most of the measured maser sources are associated with the Scutum and Sagittarius spiral arms, thus leading to an additional emphasis of these features in the distance determination.
Since we only have access to the radial velocity component of the gas, we do not use the PM prior that would require knowledge about the proper motion of the gas. In the following, we motivate and explain the chosen settings for our two BDC runs: Run A: For this run we used all priors (KD, GL, PS, SA). We used the default weights for P KD and P PS . In test runs of the BDC, we found that the default weight of 0.85 for P SA led to a strong domination of the spiral arm model (see Appendix C.2) compared to the remaining priors. We thus opted to reduce P SA to 0.5, which led to a more balanced ratio between the priors in our tests. Since in the default settings of the BDC the priors for the spiral arm model and the Galactic latitude are combined, we also set P GL to 0.5 to keep the ratio between these priors intact. Run B: For this run we did not use the priors for the proper motion and the spiral arm model. By default, the BDC combines the SA and GL priors, which means that setting P SA = 0 has the effect of also setting P GL = 0. As the Galactic latitude information contains important prior information for the distances, we slightly modified the BDC source code so that we could use the P GL prior without using the P SA prior. However, we found that in this case the default settings of P GL = 0.85 could yield a strong bias towards the far KD solution. To reduce this bias, we opted to decrease P GL to a value of 0.5, which yielded a more balanced ratio between the priors in our tests.
In addition to these settings, we include priors that incorporate literature KDA resolutions and fold in information from the fitted linewidth in both BDC runs. These additional priors are described in more detail in the next two sections.

Prior for the kinematic distance ambiguity
For all sources located within the solar circle the KD prior yields two possible distance solutions (called the near and far distances). However, over recent years many works have already solved the KDA for many objects such as molecular clouds and clumps that overlap with the GRS coverage. Many of these studies even used the GRS data set directly in their distance estimation. To take advantage of these previous works, we implemented a new scheme that uses these literature KDA solutions to inform the P far prior of the BDC, which results in a preference for the near or far distance solution. In Appendix A we list all literature KDA solutions that we incorporated in our method and describe in detail how we use this information to determine the P far weight for individual sources. In total, this prior was used in the distance estimation of about 30% of the 13 CO fit components (see App. C.3 for more details). In Appendix A we also discuss the performance of this prior; we found that its inclusion leads to a significant increase in consistency of the BDC distance results with the reported literature distances.
We illustrate the effect of the KDA prior on the distance estimation with an example in Fig. 2, which shows the resulting distance PDFs for the individual priors. In panel (a) the spiral arm prior (P SA , in red) was switched off and no KDA prior was supplied (i.e. P far = 0.5), so the only remaining contributions to the combined distance PDF come from the priors for the kinematic distances (P KD , in blue), the association with parallax sources (P PS , in green), and the Galactic latitude (P GL , in orange). Since the source is located close to the centre of the Galaxy, the two peaks of the kinematic distance PDF are not Gaussian-shaped, but were down-weighted to reflect expected large peculiar motions near the Galactic bar (Reid et al. 2019). Distances are estimated by fitting Gaussians to the peaks of the combined distance PDF (in black); the most likely distance value corresponds to the Gaussian component with the highest integrated probability density, so the highest peak of the combined distance PDF need not result in the most likely distance estimate. The distance uncertainty is given by the standard deviation of the Gaussian fit component.
With no associated parallax sources or conclusive latitude information the two distance solutions would have corresponded to the two peaks of the kinematic distance PDF and would have received the same probability (50%). In our case, the prior incorporating the Galactic latitude position favours the far distance, but associated parallax sources shift the balance towards the near kinematic distance solution, yielding a most likely distance value for the source of ∼ 3.4 kpc. We note that even though the SA prior is switched off the BDC still gives the information of whether the distance results do overlap with locations of spiral arm and interarm features; the extent for such associations is indicated with the red-shaded areas in Fig. 2. For the example depicted in panel (a), D 1 is associated with the near portion of the Scutum spiral arm, whereas D 2 corresponds to an interarm position.
If the spiral arm prior is included (panel b), the most likely distance shifts to a higher value of about 4.2 kpc. 6 Also the distance estimate with the second highest probability corresponds to a near distance solution, which illustrates the strength of the spiral arm prior.
Finally, panel (c) shows the effect of adding a prior for the KDA, which in our case favours the far kinematic distance solution (for this example we assume P far = 0.875; see App. A for how exactly P far is determined from literature KDA solutions). Setting the KDA prior has the effect of rescaling the kinematic distance PDF, which in this example shifts the most likely distance value to a far distance solution.
This example illustrated that the KDA prior can be a decisive factor for the distance estimation. However, while the P far prior can give a strong preference for one of the kinematic distance solutions, we note that the combination with the other priors can still result in a different choice for the most likely distance.

Prior for the fitted linewidth
In our tests of the BDC, we noticed that sources with low v LSR velocities are preferentially placed at larger distances (see Fig. 3). This effect is strongest for sources with v LSR 5 km s −1 ; for sources with v LSR 0 km s −1 the KD prior permits essentially only the far distance solution. This effect can be mitigated by the inclusion of the SA prior as sources can receive a strong association with the nearby Aquila Rift cloud complex. However, since the association with Aquila Rift is only performed over a very limited distance range, this leads to narrow high peaks in the distance PDF, which in turn yield associated Gaussian fit components with a lower integrated area than for the far distance solution (Fig. 3c). This effect thus has a large impact on our distance results, since we expect strong confusion between  local emission from the solar neighbourhood and the far side of the Galactic disk at −5 < v LSR 20 km s −1 (Riener et al. 2020). However, as suggested in Riener et al. (2020), we can try to use the velocity dispersion values of the fit components as an additional prior information for the distance calculation. Figure 4 recaps the argument put forth in Riener et al. (2020): due to averaging of bigger spatial areas at larger distances, we expect broadened lines due to, for example, sub-beam structure and velocity crowding, velocity gradients of the line centroids (either along the line of sight or in the plane of the sky), or fluctuations in the non-thermal contribution to the linewidth (e.g. due to regions with higher turbulence). The example shown in Fig. 4 highlights the effect of sub-beam structure and velocity crowding. If a region with two strongly blended velocity components is located at close distances, the individual emission peaks can be well resolved and fitted with two narrow Gaussian components (bottom centre and right panels in Fig. 4). However, if the same region is located at far distances, the individual velocity components might not be resolved, leading to a decomposition with a single broad Gaussian component (top centre and right panels in Fig. 4).
Given these expected differences due to beam averaging effects, it is unlikely that very narrow fitted linewidths are associ-ated with emission at large distances. For most of the molecular gas in the GRS, the molecular gas temperatures will be about 10 to 20 K, which is the typical temperature of gas at intermediate density (∼ 10 3 cm −3 ) in molecular clouds. The thermal broadening of the spectral lines for these temperatures is about 0.2 to 0.3 km s −1 , so effectively the spectral resolution of the GRS. The physical extent of the GRS beam is ∼ 0.1 pc at the distance of the Aquila Rift complex and increases to 2 pc at distances beyond the solar radius. Therefore the physical areas covered by the beam at the nearby distances of the Aquila Rift and the far distances of the Perseus and Outer arm are different by a factor of > 400. Even in the case of no sub-beam structure and velocity crowding and no significant non-thermal contributions to the linewidth, expected variations in the line centroids across the beam-averaged area are enough to broaden the lines significantly (see Appendix B).
The effect of broader linewidths for emission originating at larger heliocentric distances is already noticeable in the fitted linewidths (Fig. 5). We would expect fit components in the interval of −5 < v LSR < 0 km s −1 (left upper panel of Fig. 5) to predominantly originate from large distances and indeed the distribution of σ v values is shifted towards larger values compared to similar v LSR ranges between 0 and 20 km s −1 (remaining pan-  els of Fig. 5). The distribution of these other ranges has a strong peak at σ v < 0.5 km s −1 , consistent with the assumption that this corresponds to emission lines originating from nearby spatially resolved regions.
Having established that the fitted velocity dispersion values can contain information about the distance to the gas emission, we will in the following explain how we implement this as prior information for our distance calculation. Similar to Riener et al. (2020), we will use the size-linewidth relationship established by Solomon et al. (1987) for molecular clouds in the Galactic disk to inform our decision about whether a fitted σ v value is more likely associated with a region at near or far distances. This sizelinewidth relationship has the form of: with γ = 0.5 and σ v, 0 = 0.7 (corrected for the most recent distance estimates to the Galactic centre; Gravity Collaboration et al. 2019; Reid et al. 2019). In Fig. 6 we show the expected velocity dispersion values based on this relation as a function of physical extents of the beam (d beam ) with the solid red line. The shaded red areas indicate 1σ, 2σ, and 3σ intervals for the size-linewidth relation assuming variations in γ and σ v, 0 of ±0.1. The magnitude of these variations was motivated for consistency with results obtained from more local molecular clouds (Larson 1981;Shetty et al. 2012). We use this size-linewidth relationship to inform the KDA prior as follows. We first calculate the physical extent of the beam (d beam ) for the two kinematic distance solutions that are always obtained for positive v LSR values in the inner Galaxy. We then use the size-linewidth relationship to calculate the expected velocity dispersions for both d beam values. Subsequently, we compare the actual fitted velocity dispersion with these expected velocity dispersion values to decide whether it is more consistent with the near or far distance value. This decision is driven by how close the fitted σ v value is to the expected values from the near and far distances. We calculate for both distances the difference between the fitted and expected σ v values; if the difference is within the 3σ interval indicated in Fig. 6 we give it the corresponding weight from a normalised Gaussian function: whereσ is the standard deviation for σ exp v . From this we calculate values for the P far prior as: with w near σ and w far σ indicating the weights for the near and far distance value. If the fitted σ v value falls above the 3σ interval, we set the corresponding weight w σ to zero. If the fitted σ v value falls below the 3σ interval for the far distance but is not above the 3σ interval for the near distance, we automatically assume P far = 0.
We illustrate this procedure for four different cases in Fig. 6; for all these cases the kinematic distance solution and the corresponding d beam values are the same but the values of the fitted σ v values (horizontal blue lines) vary. For the first case (panel a) the σ v value is more consistent with the near distance; we obtain w near σ = 0.76 and w far σ = 0.04, yielding P far = 0.14 and thus strongly favouring the near distance. In the second case (panel b) the far distance is favoured, as w near σ = 0.17 and w far σ = 0.24. In the third case, the fitted σ v value is much lower than the expected σ v value and falls below the 3σ range (w far σ = 0); in such cases we always assume P far = 0 unless the σ v value is above the 3σ interval for the near distance (in which case P far would be 0.5). Finally, the last case (panel d) yields no P far prior as the fitted σ v value is much higher than the expected σ v values for both the near (w near σ = 0) and far (w far σ = 0) distance. This ensures that we do not exclude the possibility that a source with high σ v value can come from a nearby region with high non-thermal contributions to the linewidth.
Recent studies have found large dispersions of the sizelinewidth relation across the Galactic disk (e.g. Heyer et al. 2009;Miville-Deschênes et al. 2017) and advocate a scaling relation that also takes the surface density into account. Moreover, especially in the inner part of the Galaxy, linewidths can be systematically higher than predicted by the size-linewidth relation, indicating that σ v is at least partly set by Galactic environment (Shetty et al. 2012;Henshaw et al. 2016;Rice et al. 2016;Henshaw et al. 2019). We want to emphasize here that we do not use the size-linewidth relation to make conclusive decisions about the distance to a gas emission peak, but only use it as additional prior KDA information for sources with v LSR < 20 km s −1 . For sources with larger v LSR values the difference between the σ exp v values for the two KD solutions gets smaller and the size-linewidth prior might bias components with narrower fitted linewidths to be preferentially placed at the near distance solution. We also do not use the σ v prior in case the literature solutions for the KDA (Sect. 3.2) already yielded a P far value 0.5.

Choice of distance solution
The distance calculation with the BDC yields multiple alternative distance solutions with corresponding estimates of their probability. These probabilities are obtained from Gaussian fits to the combined distance PDF (Reid et al. 2016). By default, the Gaussian distance component with the highest integrated area is chosen as the most likely distance value. So even if the distance PDF shows a clear peak, this need not correspond to the selected most likely distance value. Our tests showed that this could be problematic, as very broad Gaussian components with low peak values can be selected as the most probable distance component, resulting in unlikely distance solutions (Fig. 7). For our BDC runs we found that such broad components with low  Fig. 7. Example of distance choice in case one of the distance components has a high integrated area but low peak amplitude value. The meaning of the lines and symbols is the same as in Fig. 2.
peak values would be chosen as the preferred distance value in ∼ 2.5% (Run A) and ∼ 9% (Run B) of the distance assignments.
To avoid the selection of such broad components with low peak values, we adapted the choice for the most likely distance as follows. In case of two reported distance solutions (as is the default in v2.4 of the BDC), we first check whether the peaks of the individual Gaussian fit components exceed a pre-defined limit. We set this limit to 0.12, which corresponds to three times the value of a flat distance PDF 7 . If one of the distance components does not satisfy this criterion, we choose the remaining distance solution, regardless of whether its integrated area was less (see Fig. 7). If both of the distance components exceed or fail the amplitude limit, we choose the distance component with the highest assigned probability (i.e. the Gaussian fit component having the highest integrated area). In case both distance components have the same assigned probability, we choose the distance solution with the lower absolute distance error. If both components are also tied in the distance errors (as can happen if the combined distance PDF is dominated strongly by the KD prior), we choose the distance component with the lower distance value. The last two conditions were only used in ∼ 1% of the distance choices for the two BDC runs (see App. C.3 for more details).

Galactic distribution of the gas emission
In this section we report the distance results obtained for the BDC runs including (Run A) and excluding (Run B) the prior for the spiral arm model (Sect. 3.1). In the subsections discussing the results, we always show and compare both BDC runs; if not indicated otherwise, the left-and right-hand panels depict the results of Run A and B, respectively. We first present an overview of the results and then discuss the differences in terms of the face-on and vertical distribution of the gas emission and its variation with heliocentric and Galactocentric distance. Finally, we discuss problems and biases of the two distance runs and compare our results with previous studies.

Catalogue description
With this work, we also make a catalogue of all our distance results for the GRS available. In this section we describe the en-7 The distance PDF is evaluated from 0 to 25 kpc. Requiring that the integrated area of a flat distance PDF is equal to unity yields a value of 0.04 for the PDF at all distances.
Article number, page 7 of 27 A&A proofs: manuscript no. grs-distribution tries of the catalogue, which includes useful parameters that help gauge the performance of the distance results.
We show a subset of the distance results in Table 2. Each row corresponds to a single Gaussian fit component; a spectrum fitted with eight Gaussian components thus occupies eight consecutive rows in the table.
Columns (1) and (2) show the Galactic coordinate values and column (3) gives the mean position v LSR of the fit component. Columns (4-11) list the parameters of the distance results for Run A. Columns (4) and (5) give the heliocentric distance d and its associated uncertainty ∆d , and column (6) gives the Galactocentric distance R gal . Columns (7) and (8) give the estimated probabilities P and the associated Galactic features (Arm) for the distance results. Column (9) and (10) list the probability P far that was used for the KDA prior and the corresponding reference for an associated literature distance (P far = 0.5 corresponds to the default value, in case no literature sources could be associated; see Sect. 3.2 and App. A) for more details. Column (11) gives the flag that indicates which criterion was used for the choice of the final distance solutions (see Sect. 3.4 and App. C.3 for more details). Columns (12-19) list the same parameters as columns (4-11), but for the distance results of Run B.

Face-on view of the 13 CO emission
We show face-on view maps of the integrated 13 CO emission, the number of Gaussian fit components, and the median σ v value in Figs. 8-10. Comparing the maps of the 13 CO emission (Fig. 8), we can clearly see the effect of the SA prior in the left panel, which tends to concentrate most of the emission close to the Galactic features as they are defined in the spiral arm model (Fig. 1). By neglecting the SA prior we get a distribution of the 13 CO emission that is much more spread out and extends over a much larger area in between the arms, which can also be clearly observed in Fig. 9. This spreading of the emission to interarm locations is to a large part due to our use of archival KDA solutions to inform the P far prior. We present a comparison of the face-on map of 13 CO emission with and without the use of archival KDA solutions in Appendix C.2. While we find only moderate differ- ences in the fraction of emission assigned to interarm locations, the distribution of the gas emission itself changes significantly. Even though Run B shows a larger spreading of emission into interarm regions, we can still identify 13 CO overdensities at the positions of the Galactic features of the SA model (right panels of Figs. 8 and 9). This is not surprising, as Run B has still a contribution from the maser parallax sources, which tend to be concentrated at spiral arms and spurs as well (cf. right panel in Fig. 1). Moreover, the Galactic features for the spiral arm model are also based on overdensities in archival H i and 12 CO Galactic plane surveys, so we would expect that the 13 CO emission is also present at these same locations. Looking at the maps of the median σ v values ( Fig. 10), we qualitatively observe that spiral arm features seem to be associated with 13 CO components with larger linewidths. In general, we can see increased median σ v values within Galactocentric distances 6 kpc; as already speculated in Riener et al. (2020), these increasing σ v values towards the inner Galaxy could be due to the presence of the Galactic bar and the observed overdensity of star-forming regions (Anderson et al. 2017;Ragan et al. 2018), but could also partly result from our inability to correctly decompose strongly blended emission lines. We can further see an increase of the median σ v values with heliocentric distance; for emission lines with v LSR < 20 km s −1 this is partly due to our use of the size-linewidth prior (Sect. 3.3). However, this effect is also present if we do not use this prior (see Appendix C.2 for a comparison between the maps of median σ v values obtained with and without the size-linewidth prior).
Figures 8-10 also show a persistent feature at a Galactic longitude range of 29 • 38 • that seemingly connects the Perseus and Outer arm 8 . This is very likely emission originating close to the Sun that has been erroneously placed at far distances. We can find evidence for this in Fig. 10, where the median σ v value shows significantly lower values ( 0.5 km s −1 ) at these locations than for most of the other parts of the Perseus arm. This erroneously placed local emission is also clearly identifiable in the offset positions from the Galactic midplane, which we will discuss in Sect. 4.7. 8 The position of this feature is indicated with a yellow dashed ellipse in Fig. 21.

Comparison of the distance results
Comparing the resulting distances of the two BDC runs, we find that 68.2% are compatible with each other within their estimated uncertainties. 9 The distance uncertainties are given by the standard deviation of the chosen Gaussian component fit to the combined distance PDF (see Sect. 3.4). In terms of differences in absolute distance uncertainty values, 67.2%, 78.8%, and 83.8% of the distance results are compatible within ±0.5, ±1.0, and ±1.5 kpc, respectively. We thus conclude that for the majority of the GRS fit components the two distance runs yielded similar results. We can use the PDFs of the estimated heliocentric distances and corresponding distance uncertainties (Fig. 11) to identify where the distance estimates deviated. For example, Run B yielded more distances above 8 kpc (21.2%) but produced fewer distance assignments < 0.5 kpc (1.2%) compared to Run A (17.1% and 2.4%, respectively).
The difference between the BDC runs is even more pronounced in the distance uncertainties. Half of the distance assignments of Run A have distance uncertainties < 0.5 kpc, but only a quarter of the distance assignments for Run B are below this distance uncertainty threshold. This difference is also reflected in the estimated probabilities of the distances: about 44% of the results from Run A have high-confidence probabilities > 0.75; for Run B only ∼ 34% of the distance results exceed this probability threshold (see App. C.3 for more details). We caution that the estimated uncertainties and probabilities do not allow for a straightforward comparison of the quality of the distance results. Strongly favouring the distance assignments towards a particular prior may yield small uncertainties and high probabilities but the prior itself may lead to biased distance results. We discuss these issues further in Sect. 4.8.
In the top panels of Fig. 12 we show how the intensity and velocity dispersion values of the Gaussian fit components vary with heliocentric distance for both BDC runs. While the intensity values cover a large range, their median values stay flat over all considered distances.
The bottom panels in Fig. 12 show how the σ v values of the fit components vary with their estimated distances. We can see a clear increase in the median σ v values up until heliocentric distances of about 3.5 kpc, after which it stays at increased values of > 1 km s −1 , until it drops again at distances 11.5 kpc.  This drop at the largest distances is due to a bias in the distance calculation that erroneously puts emission from nearby regions at large distances from the Sun (see Sect. 4.2). We also show the median σ v values we would have gotten if we had not used the size-linewidth prior (Sect. 3.3), which shows an even bigger drop at these large distances. However, for d < 4 kpc we recover a similar trend of increased linewidths with larger heliocentric distances, indicating that beam averaging effects play a crucial role in producing these increased linewidths. Another explanation could be a larger non-thermal contribution to the linewidth for emission located in the inner part of the Galaxy. The comparison of the median σ v curve with the size-linewidth relationship from Eq. 1 shows that most of the fit components have linewidths that are significantly larger than those expected values. In Fig. 12 we also indicate the median intensity and velocity dispersion values without the use of the size-linewidth prior (black dotted lines). Since we restricted the use of the size-linewidth prior to v LSR values < 20 km s −1 , the distribution does not change between 2 d 10 kpc. However, we can see that in absence of the size-linewidth prior the distribution of the velocity dispersion values (bottom panels) contain much more gas emission with σ v < 1 km s −1 at heliocentric distances d > 11 kpc, which based on our considerations in Sect. 3.3 is likely not correct. We thus conclude that while we need to exercise caution in the use of the size-linewidth prior its restricted use for v LSR values < 20 km s −1 led to significant improvements.

Gas fraction in spiral arm and interarm regions
In this section we discuss the fraction of 13 CO residing in spiral arm and interarm environments, which also serves to give a more quantitative overview of the distance results. In Table 3 we split our distance results into different subsamples that correspond to the determined association with Galactic features (left panel in Fig. 1) by the BDC. This association is based on the ( , b, v LSR ) coordinates and the position and extents of the spiral arm and interarm features (see Sect. 2.1 in Reid et al. 2016 for more details about this association). For each subsample we report the fraction of the total integrated 13 CO intensity (W CO ), the fraction of the total number of fit components (N comp ), and the median velocity dispersion value (σ v, med. ) with the corresponding interquartile range (IQR) in brackets. We also list the combined values for all spiral arm (3kF, N1F, N1N, Out, Per, ScF, ScN, SgF, and SgN) and interarm (AqR, AqS, LoS, N/A) features as Spiral arm and Interarm, respectively.
In the two BDC runs, about 76 − 84% of the integrated 13 CO emission and 66 − 76% of the 13 CO fit components were associated with spiral arm features, mostly with the Norma, Scutum, and Sagittarius arms. Run B placed about 1.5 times more 13 CO emission in interarm regions not associated with any of the Galactic features shown in Fig. 1. To put these numbers into perspective and check whether also the gas distribution in Run B shows a significant concentration towards spiral arm features, we determined the fraction of 13 CO gas in spiral arms based on only kinematic distances. We calculate the kinematic distances using methods contained in the BDC v2.4 and solve for the KDA by using the Monte Carlo approach outlined in Sect. 3.1 of Roman-Duval et al. (2016), assuming a Gaussian vertical density profile of the molecular gas with a FWHM of 110 pc as was done in that study. For these pure kinematic distance solutions we find that ∼ 58% of the integrated 13 CO emission and ∼ 52% of the fit components overlap with the positions of spiral arms from our assumed model. These results demonstrate that compared to pure kinematic distances both our BDC runs contain a signifi- Notes. To further check the robustness of our results we also looked at the distance results of only the ∼ 75% of fit components that had a signal-to-noise (S/N) ratio > 3. We do not find significant deviations from the trends presented in Table 3. In particular, we recover the same difference in σ v, med. between the Galactic features, which we discuss in the next section.

Velocity dispersion in spiral arm and interarm regions
One interesting exercise is to look for possible variations of the gas velocity dispersion between spiral arm and interarm regions, which has been observed for the nearby spiral galaxy M51 (Colombo et al. 2014). To split our data points into spiral arm and interarm features, we again use the BDC assignment with Galactic features from the previous section. Figure 13 shows σ v -PDFs for these Galactic features and Table 3 gives the corresponding median values and interquartile ranges for these distributions. Generally speaking, spiral arm structures are associated with larger σ v values than interarm structures, with the spiral arm PDF peaking at larger σ v values. We note that the PDF labelled Interarm contains also associations with the spur features (AqS, LoS) and the nearby Aquila Rift complex (AqR). To check how this might skew the results, we also show PDFs for interarm emission not associated with any of the Galactic features from the SA model (labelled Interarm (N/A)) and emission only associated with spur features (Spurs). Interestingly, the PDF for   the spurs is almost indistinguishable from the PDF of the spiral arms.
We make a more detailed comparison between emission associated with spiral arm and spur structures in Fig. 13c-f. The emission associated with the two major spiral structures covered by the GRS, the Scutum and Sagittarius arms, essentially has identical σ v -PDFs apart from the near portion of the Sagittarius arm (SgN), whose distribution peaks at much lower σ v values and is more similar to the PDF of the Local Spur (LoS) and the interarm PDFs in panel (a) and (b). Other structures in the inner Galaxy -the Norma arm (N1N, N1F), the far portion of the 3-kpc-arm (3kF), and the Aquila spur (AqS) -all show a very similar σ v distribution that is essentially identical to the PDFs of the Scutum arm and the far portion of the Sagittarius arm. Since the near portion of the Sagittarius arm and the Local Spur are located at the highest longitude ranges covered by the GRS, this might point to real differences in terms of the linewidth distribution in the innermost and more outer parts of the GRS coverage. However, since parts of the SgN are also located close to the Sun (d < 3 kpc), its emission lines might simply be better resolved spatially, leading to narrower linewidths (see also discussion in Sect. 3.3). The difference in the σ v -PDFs might also be explained by difficulties in the decomposition of strongly blended emission lines in the inner Galaxy, which could have led to higher fitted σ v values.
The bottom panels (g, h) show PDFs for the Aquila Rift (AqR) complex and the Perseus (Per) and Outer (Out) arms. As already mentioned, we are not able to fully separate the near and far contribution of this emission with low v LSR values. This problem is reflected in the shape of the PDFs, which are moreover impacted by our use of the size-linewidth prior. For comparison, we also show how the PDFs would look like if we did not use the size-linewidth prior (small insets in panels g and h). In this case their σ v -PDFs become more similar, which is in contrast to expectations based on beam averaging effects (see Sect. 3.3 and Appendix B) and the other spiral arm PDFs, which show much higher σ v values. We currently also have no reason to suspect that the Perseus and Outer arms should be peculiar in terms of their linewidth distribution compared to other spiral arms.
To further check the significance of the difference in the σ v -PDFs of spiral arm and interarm structures, we looked at the σ v -PDFs in 2 kpc heliocentric bins (Fig. 14). About one third of the fit components associated with interarm structures have distances < 2 kpc (panels a, b), compared to a much lower fraction of fit components associated with spiral arms in this distance range. This difference seems to be the major cause for the difference in the total σ v -PDFs in Fig. 13 (a) and (b). The remaining interarm distributions in Fig. 14 show much closer resemblance to the spiral arm PDFs, and indicate no consistent or considerable trend towards lower linewidths. Figure 14 once more highlights the problem of confusion between emission originating from the near and far side of the Galactic disk. For most of the PDFs in Fig. 14 (a)-(j) we do see a shift towards higher linewidths with increasing distance ranges, which would match our expectations based on beam averaging effects. The interarm PDFs in panels (g) and (i) show a deviation from this trend, which could be indicative of an increased confusion between near and far emission at these distance bins. The second bump at low σ v values (< 0.2 km s −1 ) in panel (d) is due to an instrumental artefact in the GRS data set that led to the fitting of very narrow components (see Appendix A.4 in Riener et al. 2020).
The strong confusion for emission at low v LSR values (< 20 km s −1 ) also becomes apparent again in panels (a), (b), and (k-p) of Fig. 14, which also highlight the effect of the sizelinewidth prior. While we do find artefacts induced by the prior in these σ v -PDFs, the distributions are nonetheless more consistent with the trend of higher σ v values with increasing heliocentric distance. So even though Figs. 13 and 14 show that we need to be careful in interpreting the distance results for the emission features with low v LSR values, we conclude that the use of the size-linewidth prior was justified and successful in disentangling part of the confusion between near and far emission.

Galactocentric variation of the gas properties
We now focus on the distribution of intensity and velocity dispersion values of the 13 CO fit components with Galactocentric distance (Fig. 15). These distributions also reveal some intriguing differences between the BDC runs. For example, for Run A we can identify an accumulation of data points at the approximate R gal extent of the far portion of the 3-kpc arm (3kF), which however is almost entirely missing in Run B. Indeed, a comparison with Fig. 8 confirms that Run B puts significantly less emission at the location of the 3kF arm than Run A. This is most likely due to very large non-circular motions near the Galactic bar that introduces errors and large uncertainties for Run B, which depends mostly on the KD assumption of circular motions (see Sect. 4.8).
In addition, there is large uncertainty in the rotation velocity at small Galactocentric radii, which also contributes to increased uncertainty for KD estimates. Another striking difference occurs at an R gal value of ∼ 8 kpc, where Run A shows large peaks that are missing in Run B. This emission corresponds to the position of the nearby Aquila Rift complex, but in Run B most of its emission is allocated to R gal distances of ∼ 7.5 kpc. We can confirm this in the top panels, where the accumulation of data points < 0.5 kpc for Run A is shifted to higher distances (between 0.5 and 1 kpc) in Run B.
The intensity distribution (top panels in Fig. 15) shows large variation but an almost constant median value with no significant trends, similar to Fig. 12. The σ v distributions (bottom panels Fig. 15) show a more interesting behaviour; the median σ v value stays at a large value of ∼ 1.5 km s −1 from 3 R gal 6 kpc, after which it drops significantly to a value of ∼ 0.5 km s −1 . As mentioned before, this could indicate that in the inner Galaxy the 13 CO components have higher non-thermal contributions or that there are increased problems in the decomposition of strongly blended emission in the inner parts of the GRS. We can however also interpret this trend as yet another indication that most of the emission at R gal 6.5 kpc is associated with regions close to the Sun and thus has better resolved emission lines (Sect. 3.3).

Vertical distribution of the 13 CO emission
The Galactic plane has long been known to show a warp towards positive z gal values in the first quadrant at Galactocentric dis-tances R gal 7 kpc (Gum et al. 1960) 10 . In Fig. 16 we show a face-on view of the median z gal values of our estimated distances, which clearly shows this warp of the molecular gas disk at R gal 7 kpc. However, we can also see patches of negative z gal values (< −100 pc) for regions that coincide with the Perseus and Outer arms. A comparison with Fig. 10 shows that these patches also correspond to the anomalously low σ v values we already pointed out in Sect. 4.2. This confirms our suspicion that these patches most likely correspond to gas emission that originates from very nearby regions that were erroneously assigned to large distances 11 .
Another conspicuous feature is the presence of substantial negative z gal values at the location of the Sagittarius arm at Galactic longitude values of 35 • 50 • and 5 kpc R gal 7 kpc. More quantitatively, the estimated vertical heights for gas emission for these and R gal ranges associated with the far portion of the Sagittarius arm have a median value of z gal = −34 pc and span an IQR of −58 to −8 pc for both distance runs. This bend towards negative z gal values at this longitude range is already clearly visible in the zeroth moment maps of the GRS data set (cf. Fig. 2 in Riener et al. 2020) and has also been observed in the Herschel Hi-GAL survey (Molinari et al. 2016). Since this distortion seems to be mainly present in the diffuse ISM component of the Milky Way, Molinari et al. (2016) speculated that it might be due to interaction with gas flows that originate from the Galactic halo or the Galactic fountain. However, instead of a 10 The BDC takes into account the effects of this warping in its calculation for the GL prior. 11 We note that the presence of these incorrect distance assignments do not change our general conclusion about the warp of the Galactic disk towards positive z gal values.  global phenomenon these negative z gal values could also simply indicate substructure of the Sagittarius arm.
In Fig. 17 we present PDFs for the estimated z gal values, which have very similar shapes in both BDC runs. The most notable difference is that Run A shows a higher concentration at z gal = 0, whereas Run B shows a dip at this position. This difference is mostly due to the association of sources with the Aquila Rift complex in Run A.
In our calculations we assumed that the Sun is located in the Galactic midplane, which is consistent with results from the most recent studies (Anderson et al. 2019;Reid et al. 2019). However, previous studies and observations found that the Sun has a vertical offset of z offset ∼ 25 pc from the IAU definition of the Galactic midplane (Goodman et al. 2014;Bland-Hawthorn & Gerhard 2016). Figure 17 shows how the PDFs would change if we correct for this assumed vertical offset of the Sun using Eq. C3 from Ellsworth-Bowers et al. (2013). Accounting for such an offset leads to a shift of the distribution towards positive z gal values, with an asymmetric peak at z gal ∼ 25 pc introduced by emission originating close to the Sun ( 1 kpc).
A Gaussian fit to the PDFs in Fig. 17 yields full-width at halfmaximum (FWHM) values of 72 and 77 pc with corresponding mean or peak positions at z gal = −5 and −6 pc for Run A and B, respectively. If a z offset value of 25 pc is factored in, the FWHM values increase slightly to values of 78 and 83 pc and the centroid position changes to z gal = 10 and 8 pc, respectively. Our FWHM estimate is lower by about one third than the value of 110 pc Roman-Duval et al. (2016) found for the dense gas (corresponding to H 2 surface densities 25 M pc −2 ) in the inner Milky Way. However, our results correspond very well with scale heights of ∼ 30 to 40 pc and peak values of −4 to −10 pc that have been determined from high mass star forming regions, H ii regions, and dust emission surveys in the far-infrared (see Table 1 in Anderson et al. 2019 for a compilation of literature results). A peak position at z gal = −5 pc also agrees well with z offset ∼ 5 pc as found by Anderson et al. (2019) and Reid et al. (2019). We also note that the scale height of the H i cold neutral medium (∼ 150 pc; Kalberla 2003) significantly exceeds our determined scale height for the 13 CO gas by about a factor of five. To check whether our results are impacted by the inclusion of both near and far emission, we also estimated the FWHM estimates for individual 1 kpc bins in the R gal range of 3 − 6 kpc. We find a maximum FWHM extent of ∼ 90 pc for 5 < R gal < 6 kpc and FWHM values of 70 − 75 pc at lower R gal bins. Figure 18 shows the distribution of σ v values with vertical height z gal . For both distance results we can see a clear concen-  tration of data points towards the midplane. The decrease in the median σ v value around a z gal value of 0 is due to very nearby emission located < 1 kpc from the Sun, which has very narrow linewidths. We also note the presence of an asymmetry, especially striking in the curve of median values, with a larger fraction of components with broader linewidths located at negative z gal values.

Potential problems, artefacts, and biases
The BDC tool was designed to estimate distances for spiral arm sources, which means that its default settings have an inherent bias of associating sources with Galactic features from its spiral arm model. Since we use the BDC in assigning distances to the gas emission of an entire Galactic plane survey, we need to be careful in interpreting its results and should be aware of the biases present in the distance calculation. It is a priori not clear which of our BDC runs yields more trustworthy or better distance solutions. Run A has the obvious problem that the gas emission will be preferentially located closer to the Galactic features included in the spiral arm model. For this run we expect biased results in terms of the distribution of emission in spiral arm and interarm regions, with the latter likely severely underestimated. Run B gives more unbiased results with regards to the allocation of the gas to arm and interarm regions. However, we note that for the distance results from Run B an association with maser parallax sources can be a decisive factor for the choice of the most likely distance (cf. left panel of Fig. 2). Since these maser sources do mostly overlap with the Galactic features of the spiral arm model (Fig. 1), the distance results thus still contain an implicit, albeit moderate, association with these Galactic features. Moreover, since Run B is dominated by the KD prior, it is also more strongly affected by the ambiguities and uncertainties of the KD method.
We can identify an accumulation of emission features around the locus of tangent points for both distance estimates. The prob- lem with determining kinematic distances near tangent points is that small changes in the v LSR value result in large changes in the estimated KD value. Thus often a threshold is used for the tangent point distance allocation, where for example all sources with v LSR values within 10 km s −1 of the tangent point velocity are assigned the tangent point distance (e.g. Urquhart et al. 2018). We indicate the corresponding region where v LSR values are within 10 km s −1 of the tangent point velocity in Fig. 21. This threshold of 10 km s −1 corresponds to expected velocity deviations introduced by streaming motions (e.g. Burton 1971; Ramón-Fox & Bonnell 2018). We thus speculate that some of the empty voids within this region might be at least partly due to this confusion around the tangent point velocity, at least for Run B that is dominated by the KD prior. However, a comparison with the default BDC runs (Fig. C.2) shows that our use of literature distance solutions helped to substantially decrease artefacts around the locus of tangent points. Figure 19 shows a comparison of the median associated v LSR values for the distance results. We overplot this figure with curves of constant projected v LSR values that were calculated with the methods included in the BDC. In general, the BDC runs produced distance results that are well in agreement with the assumed Galactic rotation curve model. This good correspondence is not surprising, given that the KD solutions are calculated using the rotation curve model. However, an anticipated problem is that peculiar gas motions, for example introduced by streaming motions within spiral arms, might cause a significant deviation from the expected v LSR velocities of the assumed rotation curve model (e.g. Ramón-Fox & Bonnell 2018). This strongly affects regions with R gal values 5 kpc, for which we expect large peculiar motions due to the influence of the Galactic bar (Reid et al. 2019). The BDC takes this into account by down-weighting the KD prior for regions closer to the Galactic centre (see Fig. 2); this however has a significant impact on the estimated distance uncertainties, which show a substantial increase with decreasing R gal values (Fig. 20). As already noticed in Fig. 11, this effect is much stronger for Run B, since in this case the combined PDF shows broader peaks and corresponding Gaussian fits to these peaks result in higher estimated distance uncertainties. We give a more detailed discussion about the deviations from the rotation curve velocities and the regions where they occur in Appendix C.4. We also note that the v LSR uncertainties of the fit components can have a large impact on the distance calculation routine, as larger uncertainty values can lead to an association with more parallax sources or Galactic features. We illustrate and discuss this effect with an example in Appendix C.1. Moreover, the BDC is expected to have problems at lower Galactic longitudes for both Run A and Run B, since for low longitude ranges emission in the various arm segments along the lines of sight will have similar Galactic latitude and v LSR values, thus complicating the distance allocation.
Since in this work we do not explicitly correlate the distance results of neighbouring lines of sight, it is possible that assigned distance values can show strong variation between neighbouring lines of sight. We can see this effect as emission features that are spread out along the line of sight (reminiscent of the 'Fingers of God effect'; see e.g. the right panel of Fig. 21).
The limited spatial and spectral coverage of the GRS also introduces some artefacts in the distance estimation (Fig. 21). The limited latitude coverage from 14 • 18 • results in missing patches of CO emission at this longitude range. Moreover, the face-on view is restricted by the lower limit of the velocity coverage (v LSR = −5 km s −1 ) and thus contains no emission past d∼ 13 kpc at > 40 • . However, the reduced velocity coverage of −5 v LSR 85 km s −1 for 40 • 56 • should not impact our distance results as we would not expect emission peaks with v LSR > 85 km s −1 at these larger longitude values, as demonstrated in Fig. 21.
We note that the GRS decomposition also has uncertainties that might cause problems for the distance estimation. Especially in the inner part of the Galaxy emission lines can be strongly blended, which could have led to difficulties in the decomposition (see the discussion about flagged components in Sect. 3.1 of Riener et al. 2020). We tried to fold these considerations into the uncertainties of the v LSR position supplied to the BDC (see discussion in Appendix C.1). Moreover, we tested the effects of a quality cut based on the S/N ratio of the fit components A&A proofs: manuscript no. grs-distribution and found that this does not change our overall conclusions (see Sect. 4.4). As already mentioned in previous sections, the feature that seemingly bridges the Perseus and Outer arm and corresponds to emission with v LSR values around 10 km s −1 (yellow dashed ellipse in Fig. 21) is most likely an artefact introduced by the KD prior. As discussed in Riener et al. (2020) and Sect. 3.3, for this v LSR regime there is strong confusion between emission from the solar neighbourhood and the far disk. Moreover, the BDC biases emission lines with v LSR 5 km s −1 towards far distances (cf. Fig. 3). We can estimate the magnitude of this error by counting all components with an unlikely combination of distance, z gal , and σ v values. Choosing d > 8 kpc, z gal < −50 pc, and σ v < 0.5 km s −1 as unlikely combination of parameters, we find that for both distance results about 0.3% of the fit components satisfy these parameters 12 . Since the W CO values of these components account for only about 0.1% of the total emission, we conclude that this problem has a very minor impact on our overall conclusions concerning the fraction of emission located in arm and interarm regions. However, this issue has strong impacts on our conclusions about the σ v distribution in the Perseus and Outer arm (see Sect. 4.5).

Comparison with previous results
The BDC has already been used in the distance estimation to clouds and clumps extracted from other Galactic plane surveys (Urquhart et al. 2018;Rigby et al. 2019). However, since these works used an older version of the BDC (v1.0), it is not straightforward to compare their distance results with the distances obtained in this work. Moreover, our distance estimations are not independent from these previous results, since we use them as input for our KDA prior. Notwithstanding these issues, in Appendix A.4 we discuss how well we are able to match these previous distance results and conclude that we recover the vast majority of literature distance results within the degree of expected uncertainties introduced by the updated rotation curve parameters from BDC v1 to v2.4.
Unfortunately, it is also extremely challenging to compare our results in terms of the spiral arm to interarm fraction and variation of physical properties with previous studies, given that other works used a combination of different tracers, different spiral arm models, or different assumptions about the Galactic rotation curve and the distance to the Galactic centre. It would be necessary to homogenise all data sets before any attempted comparison, which potentially requires recalculating and updating the literature distance results with our assumed Galactic parameters. Since such a homogenisation exceeds the scope of this work, we decided on a strictly qualitative comparison with some of the previous results and do not attempt to account for any of these systematic differences.
Previous works analysing the GRS found a similar overdensity of 13 CO with spiral arm features. Roman-Duval et al. (2009) found for their sample of GRS molecular clouds that the 13 CO surface brightness is strongly enhanced at the location of spiral arms from the model of Vallee (1995). Sawada et al. (2012) also found that the GRS emission shows bright and compact concentrations along spiral arm features, whereas more diffuse and extended emission dominates the interarm regions.
However, recent results from other Galactic plane surveys in the first quadrant found a weaker correspondence of molecular clouds with spiral arms. Colombo et al. (2019) analysed a large 12 CO (3-2) survey overlapping with the GRS and could only attribute about 35% of the flux to molecular clouds associated with spiral arms 13 . Colombo et al. (2019) attribute this low fraction of flux in spiral arm clouds to difficulties in the distance assignments and optical depth effects of the 12 CO (3-2) emission.
Recently, Rigby et al. (2019) found that clumps from a distance limited (6 < d < 9 kpc) sample associated with spiral arms have significantly higher σ v values than clumps at the same distances that are located in interarm regions. They further note that this difference in linewidth is comparable to what has been found in extragalactic work (Colombo et al. 2014) and smoothed particle-hydrodynamics simulations (Duarte-Cabral & Dobbs 2016). We do find a trend for lower σ v values at around the same distances for interarm regions for Run A, but not for Run B (Fig. 12). This is somewhat surprising, given that Rigby et al. (2019) used the BDC without the SA prior for their distance calculation, which should have yielded a better agreement with our Run B. However, we note that Rigby et al. (2019) used a higher-density tracer ( 13 CO (3-2)) and v1 of the BDC 14 , which could both account for any differences compared to our results. 13 Colombo et al. (2019) used the spiral arm model by Vallée (2017) as a comparison, in which positions for the Scutum and Sagittarius arms deviate by up to ∼ 1 kpc compared to the corresponding arms defined by Reid et al. (2019) 14 BDC v2.4 includes new maser parallax sources, updated models for the Galactic rotation curve and spiral arm features, and contains significant changes in the distance estimation, such as a down-weighting of the KD prior in the inner Galaxy to accommodate expected large streaming motions introduced by the Galactic bar. See Reid et al. (2019) for more information.

Conclusions
In this work we present distance estimates for the Gaussian decomposition results of the Galactic Ring Survey presented in Riener et al. (2020). Using the most recent version of the Bayesian Distance Calculator tool Reid et al. (2016Reid et al. ( , 2019, we perform two separate distance calculations for the ∼ 4.6 million individual Gaussian fit components, for which we vary the settings so as to either incorporate or neglect a prior for an association with spiral arm structure (labelled Run A and Run B, respectively). In addition, we include literature distance information of objects overlapping with the GRS coverage as prior information for solving the kinematic distance ambiguity. We also incorporate a size-linewidth prior to solve for the confusion between emission from the solar neighbourhood and the far Galactic disk for emission peaks with line centroids of v LSR < 20 km s −1 .
We find that most of the distance results of the two BDC runs are consistent with each other within their uncertainties, with most of the differences either due to the strong influence of the spiral arm prior for Run A or larger uncertainties introduced by the stronger effect of the kinematic distance prior for Run B. The two distance runs complement each other and show opposing strengths and weaknesses, thus suggesting that the true distribution of the gas emission is closer to a combination of the two results than to each of the individual distance runs.
In the following we present our main findings based on these two distance results: i) The majority of the 13 CO emission is associated with spiral arm features as defined in the model by Reid et al. (2019). The fraction of 13 CO emission located in interarm regions varies from 16% to 24% in terms of the total 13 CO integrated emission and 24% to 34% in terms of the total number of 13 CO velocity components. ii) The vertical distribution of the gas emission has a FWHM extent of ∼ 75 pc. We recover a significant warp of the molecular disk towards positive z gal values of more than 100 pc for the far side of the disk at R gal > 7 kpc and the entire covered longitude range of 14 • < < 56 • . The gas disk shows a significant bend towards negative z gal values at the position of the Sagittarius arm at Galactic longitude values of 35 • 50 • and 5 kpc R gal 7 kpc. iii) We find a trend of higher velocity dispersion values with increasing heliocentric distance, which we attribute mostly to beam averaging effects. Most of the velocity dispersion values also significantly exceed expected values based on an assumed size-linewidth relationship. iv) The 13 CO emission associated with spiral arms and spur features has a similar distribution of velocity dispersion values, which is shifted to higher values compared to the distribution of velocity dispersion values in interarm structures. However, we find that most of this difference is due to the location of a significant fraction of interarm gas at close distances to the Sun, which resulted in spatially better resolved lines and narrower linewidths. While we cannot exclude variations in the linewidth between spiral arm and interarm gas, we conclude that our present results do not support strong differences in σ v between these environments. v) There is strong confusion between 13 CO emission coming from the local solar neighbourhood and regions associated with the Perseus and Outer arm. By using the velocity dispersion values of the fit components as an additional prior we could significantly reduce the confusion between near and far emission for low v LSR velocities (−5 < v LSR < 20 km s −1 ).
While we use the currently best knowledge about the structure of our Galaxy for our distance results, we anticipate that these will be subject to change, in particular due to updates on the BDC method, the Galactic rotation model, and the position of Galactic features, with additional and more precise maser parallax measurements, and new KDA solutions for sources overlapping with the GRS coverage. The BDC tool and its enhancements discussed in this work are designed to be versatile enough to incorporate these changes. We thus conclude that that the approach presented herein should be a helpful contribution to the problem of estimating distances to gas emission features from Galactic plane surveys.

Appendix A: Further details about the KDA prior
Here we give more details about the KDA prior (Sect. 3.2). We describe the method we used to calculate the prior, present the literature results we considered for the prior, and discuss its effect on the distance calculation.

Appendix A.1: Calculation of priors
In the following we describe the iterative loop that is used to determine priors for the KDA solution (see also Fig. A.1). For a given ( , b, v LSR ) coordinate, we first determine how many sources N src from a catalogue are associated with this coordinate. For this we define a Gaussian weight using the definition of a Gaussian function: where a, µ, and Θ denote the amplitude, mean position, and FWHM values, respectively. From this definition we construct a Gaussian weight w g that evaluates to unity at x = Θ/2: with a normalisation factor ofã = exp (ln (2)) and x being the distance to the mean position (in our case µ = 0) in fractions of the FWHM ( f Θ ). We can apply this Gaussian weighting straightforwardly along the spectral axis, where x ≡ f Θ = |v src LSR −v LSR |/Θ src , with v src LSR and Θ src being the measured centroid velocity and linewidth of the catalogue sources, respectively. We define the weight along the velocity axis w V as: where w min V is a user-defined threshold. For example, with w min V = 0.125 all points along the spectral axis for which |v src LSR − v LSR | > Θ src receive a weight of w V = 0.
For the spatial association, we use the elliptical or circular FWHM extent of the sources as defined in the respective catalogue. With the following equation we can check whether a point is located within a rotated ellipse: where in our case x p and y p refer to the and b coordinates of our PPV data point and x 0 , y 0 , a, b, and α are the central and b coordinates, the semi-major and semi-minor axis, and the rotation of the ellipse, respectively. If ≤ 1, the point is located within or on the ellipse. Given that √ corresponds to the distance to the centre of the source expressed in fractions of its spatial FWHM extent, we can define a weight w PP for the association of Galactic or position-position coordinates with a catalogue source as follows: where w min PP is a user-defined threshold. For example, with w min PP = 0.125 all points located beyond twice the extent of the source receive a weight of w PP = 0.
We then combine the spectral and spatial weights to a total PPV weight of w PPV = w PP ·w V . We only retain catalogue sources that have a weight w PPV > 0. If there are no sources from the catalogue that have w PPV > 0 we proceed to the next catalogue and repeat the source association.
If there was at least one catalogue source associated with the coordinate, we calculate w KDA , which gives the weight that the source is located on the near or far distance. The w KDA weight can range from −0.5 (which puts all the weight on the near distance) to 0.5 (which puts all the weight on the far distance). In case of only a single associated catalogue source w KDA = w PPV · f N/F · w CAT , where f N/F is −0.5 or 0.5 if the catalogue source is associated with the near or far KD solution, respectively, and w CAT is a user-defined weight for the catalogue (see App. A.3). If multiple sources are associated, we calculate w KDA as a weighted average: After we searched all catalogues, we use the w KDA with the highest absolute value as our final value to determine our prior for the Article number, page 19 of 27 A&A proofs: manuscript no. grs-distribution kinematic distance solution with P far = 0.5 + w KDA . We did not make the final calculation of the weights cumulative or additive as many of the catalogues we use are not fully independent from each other. For example, the CHIMPS catalogue used many of the other catalogues in resolving the KDA for their clumps. In case our routine yields multiple w KDA values with the same absolute value, we calculate the average w KDA value from these solutions. Thus, if for the same clump two catalogues determined different KDA solutions, the resulting P far value is 0.5, which means that no prior for the KDA will be supplied.
Appendix A.2: Inferring literature KDA solutions We use the literature distance information only for prior information on whether the source is located on the near or far side of the Galactic disk. In case one of the catalogues already supplied an information about the KDA resolution (that means if the near or far distance was chosen) we adopt these KDA results. If the KDA resolution was not stated explicitly, we use one of the following two methods to infer it.
Method 1: If the corresponding catalogue only gives the information about the heliocentric distance d without any further information on the KDA, we use the relation to obtain the Galactocentric radius R gal . With R gal , we then establish the near and far kinematic distances, from which we determine the chosen KDA solution. We only attempt to resolve the KDA if the near and far kinematic distances differ by more than 1 kpc; otherwise we remove the source from the catalogue.
Method 2: In case the KDA cannot be inferred via Method 1, we use functions contained in the BDC tool to calculate kinematic distance solutions and expected tangent point velocities v TP LSR for the catalogue sources. If the v LSR velocity of a catalogue source is within 10 km s −1 or is higher than v TP LSR , we assume that the source is too close to the tangent point to resolve the KDA properly. These sources are subsequently removed from the catalogue.
Next we check for clear KDA solutions. If the v LSR velocity of the source is lower than the near KD solution or higher than the far KD solution we resolve the KDA as 'N' (near) or 'F' (far), respectively.
For the remaining sources we compare the given catalogue distance to the kinematic distance solutions and the tangent point distance. In case the difference of the literature distance to the tangent point is lower than the differences to both of the kinematic distance solutions, we do not attempt to resolve the KDA and remove the source from the catalogue. Otherwise, we choose the kinematic distance solution that has the smallest difference to the literature distance.

Appendix A.3: Literature results used in the KDA prior
We now discuss the catalogues that were used in this work to infer priors for the KDA. We required that the catalogues contain information about molecular gas v LSR velocities, either reported directly or reported indirectly via a given kinematic distance. We only retain the catalogue sources for which we could infer whether the near or far distance solution was chosen; we exclude all catalogue entries which were assigned tangent point distances or which had uncertain KDA resolutions. For this work we did not attempt to incorporate distances obtained from alternative distance estimation methods, such as dust extinction mapping, if there was no information about the association with molecular gas. We also chose not to include catalogues based on 12 CO (1-0) observations.
Where available, we incorporated measured 13 CO (1-0) linewidths for the catalogue sources. If these did not exist, we either settled on linewidth measurements of a higher-density tracer or used median linewidth measurements obtained for comparable sources (i.e. clumps or clouds). We use a w min V threshold of 0.125 for all catalogues, which means that we make a spectral association with a catalogue source if |v src LSR −v LSR | < Θ src . We make a spatial association with sources from the clump catalogues if the ( , b) coordinate of the PPV point is contained within twice the extent of the clump (i.e. w min PP = 0.125). For the more extended sources of the remaining catalogues, we only make a spatial association if the ( , b) coordinate of the PPV point is located within or close to the elliptical or circular extent of the source (with w min PP = 0.9) We give the clump catalogues a higher weight (w CAT = 0.75) than the catalogues of more extended objects, such as molecular clouds and IRDCs (w CAT = 0.5). This was done to favour the KDA information from the clumps on small scales, as the clumps are usually embedded within these more extended objects.
In Table A.1 we give an overview about the catalogues we used as KDA solutions in this work. N GRS src gives the number of sources overlapping with the GRS coverage, and N Θ , N N , and N F give the corresponding numbers of sources with measured linewidths, near, and far KD solutions, respectively. The columns w min PP , w min V , and w CAT list the weights we used for the association of catalogue sources (Sect. A.1); the KDAR column specifies if the KDA resolution was given in the respective catalogue or how we calculated it otherwise. In the last two columns we give the abbreviation for the catalogues we refer to further on in the text and list the main references used to obtain information about the location, size, velocity, and distance information of the catalogue sources. In the following we discuss the individual catalogues in more detail.
ATLASGAL clumps: Urquhart et al. (2018) presented distance results for clumps from the ATLASGAL survey in the inner Galactic plane (|l| < 60 • , |b| < 1.5 • ). The catalogue does not contain explicit information on how the KDA was resolved but lists the kinematic distance solutions, the distance estimated with the BDC (v1), and the chosen distance. With that information we could infer the KDA information ('N', 'F') for 6317 clumps. Of these, 4457 clumps have linewidth measurements, of which 3139 were obtained from the SEDIGISM survey (Urquhart et al., in prep.), 668 measurements were taken from Urquhart et al. (2018), and 292 measurements were taken from Wienen et al. (2012). For the remaining clumps with resolved KDAs but missing linewidth information we assume a FWHM linewidth of 3.367 km s −1 , which corresponds to the median linewidth computed from the clumps with measurements. We took the size information for the ATLASGAL clumps from Urquhart et al. (2014). In total, 1745 ATLASGAL clumps with resolved KDAs overlap with the GRS coverage.
BGPS clumps (v1): Eden et al. (2012Eden et al. ( , 2013 presented KD determinations for clumps of the Bolocam Galactic Plane Survey Notes. (BGPS; Rosolowsky et al. 2010). We only use the sample of 165 BGPS sources whose distances were not inferred via an association with molecular clouds from Roman-Duval et al. (2009). We established the chosen KDA solution via Method 1, using R 0 = 8.5 kpc as assumed by Eden et al. (2012Eden et al. ( , 2013. We take the corresponding position and size information of these clumps from v1 of the BGPS catalogue (Rosolowsky et al. 2010). For the linewidth of the clumps we assume a value of Θ = 3.316 km s −1 , which corresponds to the median linewidth of the BGPS v2.1 sample (see next paragraph).
BGPS clumps (v2.1): Ellsworth-Bowers et al. (2015) resolved the KDA for 1320 BGPS clumps. We took the corresponding position and size information from v2.1 of the BGPS catalogue (Ginsburg et al. 2013). Svoboda et al. (2016) determined linewidths for 610 of these clumps from NH 3 observations. For clumps the associated 13 CO emission has in general broader linewidths than the NH 3 emission (Wienen et al. 2012). We thus decided to multiply the measured NH 3 linewidths of Svoboda et al. (2016) by a factor of two, which is based on the difference found by Wienen et al. (2012). For the remaining clumps without measured linewidths we assume the median NH 3 linewidth value from the Svoboda et al. (2016) sample corrected by a factor two, which corresponds to 3.316 km s −1 and compares very well to the median value from the ATLASGAL sample. (1993) rotation curve. We only retain the sources for which an external indicator was used to solve the KD (flag 'G'). The Elia et al. (2017) catalogue does not contain information about the associated v LSR velocities of the sources. We used the function brand_rotcurve.calc_vlsr from the kinematic distance package presented in Wenger et al. (2018) 15 to infer the v LSR velocities for the longitude and distance values of the sources in the Elia et al. (2017) catalogue. In Fig. A.2 we benchmark these estimated Hi-GAL v LSR velocities for 685 sources that we could associate with ATLASGAL clumps from Urquhart et al. (2018). We associate a Hi-GAL source with an ATLASGAL clump if their central positions are less than 19.2" apart, which corresponds to the ATLASGAL beam size. The left panel in Fig. A.2 shows that the majority of estimated Hi-GAL v LSR velocities match very well with the associated ATLASGAL clump velocities. The fraction of sources for which the v LSR values are not consistent is likely due to wrong associations of spectral lines with the dust features, as there can be multiple molecular gas emission features along the line of sight that the dust feature could be associated with. For this work, we make no attempt to resolve these inconsistent v LSR values. The right panel in Fig. A.2 shows the differences in the estimated distances for the 685 associated sources. Again, for the majority of associated sources the distance values are similar. More important for our context, for 75% of the associated sources the KDA resolution is identical. We take the location and size information for the Hi-GAL clumps from Elia et al. (2017). For the linewidth, we assume for each clump the median linewidth estimated from the measured values from the ATLASGAL survey, which corresponds to Θ = 3.367 km s −1 . Method 1 (with R 0 = 8.5 kpc), we were able to infer the KDA solutions for 652 clouds. We took the position, size, and spectral information of the clouds from Rathborne et al. (2009).

GRS molecular clouds crossmatched with BGPS clumps:
Battisti & Heyer (2014) compiled a catalogue of 437 molecular clouds from the GRS survey, which they associated with BGPS sources from the v1 catalogue (Rosolowsky et al. 2010). They resolve the KDA for their sources but do not explicitly list whether they chose the near or far solution. Using Method 1 (with R 0 = 8.3 kpc), we could infer the chosen KDA solution for 389 clouds.
MSX IRDCs with velocities from GRS: Simon et al. (2006b) determined KDs to 313 IRDCs identified from observations of the Midcourse Space Experiment (Simon et al. 2006a), by morphologically matching the IRDCs to 13 CO (1-0) emission from the GRS. Simon et al. (2006b) argued that since the IRDCs are seen as extinction features they probably will be located in the foreground and thus always resolve the KDA in favour of the near solution. Marshall et al. (2009) used an alternative approach based on modelling the three-dimensional distribution of interstellar extinction towards 115 of these IRDCs, which allowed them to obtain distances that do not suffer from near/far ambiguities. Whenever these were available, we chose the Marshall et al. (2009) distance determinations over the ones obtained by Simon et al. (2006b). Using Method 2 (Sect. A.2), we could resolve the KDA for 272 IRDCs. We take the v LSR and FWHM linewidth information for this sample of IRDCs from Simon et al. (2006b) and take their position and size information from Simon et al. (2006a).
H ii Regions associated with GRS emission:  associated 301 Galactic H ii regions located within the GRS coverage with the corresponding 13 CO (1-0) properties.  resolved the KDA for 266 of these H ii regions using the H i emission/absorption and H i self-absorption methods. We include H ii region sources as prior information if one of the following two conditions was fulfilled: the two methods yielded the same KDA resolution; or one of the methods received a high confidence label, in which case we use its KDA solution. We thus retained 169 sources, which had measured associated 13 CO (1-0) properties and a resolved KDA. We take the position, size, and spectral information of the sources from . Supernova remnants: We include KDA solutions for 23 Supernova remnants (SNRs) that have been obtained from H i 21 cm and GRS 13 CO line emission (Ranasinghe & Leahy 2018a,b;Ranasinghe et al. 2018). In case no information on the spatial extent was given in these works, we adopted the information given in  and Green (2019).

WISE H ii
For the spectral extent, we assume the average linewidth of 3.6 km s −1 that Rathborne et al. (2009) find for their catalogue of molecular clouds of the GRS.

Appendix A.4: Effect of the KDA prior
In this section we discuss the effect of the KDA prior on the BDC results. For our tests we use the catalogues as detailed in Table A.1, so we include only sources that overlap with the GRS coverage and for which we could infer near of far KDA solutions. First, we quantify the effect of the w CAT weight on the distance estimation, for the two cases where the spiral arm priors are included (P SA = 0.5) or switched off (P SA = 0). For this test we use only the KDA information from the ATLASGAL sample and do not consider any of the other catalogues. We perform different distance runs with the BDC for the ATLASGAL sample; for each run, we supply the BDC with the correct KDA solutions for the sources and just vary the weight w CAT , which determines the strength of the resulting P far prior. For example, for w CAT = 0.5 a far KDA solution yields P far = 0.75, whereas with w CAT = 0.75 this increases to P far = 0.875. For w CAT = 1 we would thus expect the highest correspondence between our calculated distances and the distances given in Urquhart et al. (2018) 16 . To test how robust the BDC results are against wrong KDA solutions, we also perform distance calculations for which we intentionally supply the incorrect KDA solutions for the AT-LASGAL sample. Table A.2 lists the performance of the BDC results for 20 runs, for which we vary w CAT between the values 0, 0.25, 0.5, 0.75, and 1, use or switch off the P SA prior, and supply either the correct or incorrect KDA solutions. The δ (x) parameter gives the percentage of calculated distance values whose absolute error is within x kpc of the literature distances; we re-16 However, since Urquhart et al. (2018) used an older version of the BDC (v1), we would not expect a perfect correspondence of the distance results even in this best case scenario. port δ (x) for x intervals of ±0.5, ±1.0, and ±1.5 kpc. The runs with w CAT = 0 correspond to the default BDC distance estimations that do not consider any prior information on the KDA and thus serve as our benchmarks.
The runs for which we supplied the correct KDA solution show a clear increase in the fraction of matching distances with increasing w CAT value. This is expected, as KDA solutions are more enforced with increasing w CAT values. In the runs where we use the prior for spiral arms (P SA = 0.5), the percentage of matching distance values is less; however, the vast majority of the estimated distances is still close to the literature values.
Unsurprisingly, the supply of incorrect KDA solutions yields wrong distance estimates, especially the higher the w CAT value, that means the more we enforce these KDA solutions. This effect is very strong for the runs where the spiral arm prior was switched off and the prior for the kinematic distances was the dominating factor for the BDC results. Using the prior for the spiral arms can mitigate the negative impact of the incorrect KDA solutions; for w CAT = 0.5 almost half the sources have distance results within 1.5 kpc to the literature distances even though we intentionally forced the BDC to prioritise the wrong KDA solution.
This test demonstrated that the BDC run with P SA = 0.5 is more robust against priors using wrong KDA solutions than the run with P SA = 0. Moreover, we find that w CAT values of 0.5 to 0.75 are preferable values for the catalogue weights, as they offer a good balance between recovery of correct distances with the right KDA solutions for P SA = 0 and robustness against incorrect distances with the wrong KDA solutions for P SA = 0.5.
Next, we want to quantify the effect of using all available KDA information with their corresponding weights (Table A.1). Using the ATLASGAL sample, we again perform different BDC runs with P SA = 0.5 and P SA = 0. For the KDA prior we either use none of the catalogues (giving us a benchmark for the default BDC performance), all KDA solutions from Table A.1 excluding the ATLASGAL catalogue itself, and all KDA solutions including the ATLASGAL catalogue. Figure A.3 shows the BDC results plotted against the literature values for these six BDC runs. Table A.3 gives the corresponding percentages of matching distance values within ranges of δ (x) (with x = 0.5, 1, and 1.5 kpc) that are highlighted with the grey-shaded areas in Fig. A.3. The runs which use no KDA solutions (panels a and d) show a large dichotomy between near and far distance solutions. Including all KDA solutions apart from the Urquhart et al. (2018) catalogue itself already manages to improve the correspondence between the distances and indicates that the sources of the remaining catalogues overlap with many of the ATLASGAL clumps. Finally, as expected, the inclusion of the Urquhart et al. (2018) catalogue leads to the best correspondence of the distance results. However, for many sources the spiral arm priors lead to a preference of different KDA resolutions (panel c). By switching the spiral arm prior off, we manage to drastically reduce the instances for which a different KDA solution was favoured. The remaining fraction of clumps for which a different KDA solution was chosen was due to mismatching KDA solutions from different catalogues. For example, Urquhart et al. (2018) give a near distance solution of 3.5 kpc for the clump AGAL020.662-00.139, whereas spatially and spectrally overlapping sources in five other catalogues (A+09, RD+09, BH14, EB+15, E+17) favour a far distance solution, leading to a BDC value of 10.1 kpc.
Finally, we list the performance of the BDC results for the remaining catalogues used for KDA information in Table A.4. We again perform different BDC runs with P SA = 0.5 and P SA = 0 and give the percentage of sources for which the distance was within a range of 1.5 kpc to the literature distance for the cases where no literature KDA solution is used (labelled δ), and KDA solutions from all catalogues excluding and including the one for which the distances are calculated (labelled δ − and δ + , respectively). We see already an improvement in matching distances for the δ − runs, which indicates that there is a good overlap between sources from all catalogues. As expected, we see the highest correspondence between the BDC and literature distance results for the runs in which the spiral arm prior is switched off. In conclusion, our tests showed that the BDC runs with supplied literature KDA solutions are able to match the vast majority of distance results from each of the individual catalogues used to infer KDA priors. This result is not self-evident, given that many of these catalogues use different assumptions about the rotation curve parameters. We thus infer that our obtained distance results are consistent with the vast majority of the literature results.

Appendix B: Effects of beam averaging on the observed linewidth
We designed the following simplified experiment to test how fluctuations of the line centroids can broaden the linewidth via beam averaging effects. We perform different runs for which we vary the spatial resolution of a given PPV cube to simulate observations of regions at different heliocentric distances. For each run we construct PPV cubes with dimension (100, 100, 30) and populate each of the spectra with a single Gaussian component, whose velocity dispersion is two spectral channels. For simplicity we do not assume any noise. The mean position of the Gaussian is centred along the spectral axis with the centroid of the spectrum allowed to vary for each component; the standard deviation of this variation (∆v cen ) is set either to 0.5, 1, or 2 times the velocity dispersion. Assuming the pixel size to be equal to the FWHM of the resolution element or beam, we convolve this cube with a 2D Gaussian kernel whose FWHM is set to either 2, 4, 8, 16, 32, or 64 times the pixel size, thus simulating observations of regions at 2 to 64 times the distance of our original cube, which corresponds approximately to the variation present in the GRS. We then determine the velocity dispersion of a Gaussian fit to the central spectrum of the spatially smoothed cube. Figure B.1 presents the results for 100 different realisations of the PPV cube and shows that the measured σ v in the spatially smoothed cubes increases significantly with increasing ∆v cen . Variations of ∆v cen on the order of the velocity dispersion of the emission line in the resolved cube lead to increases in σ v in the spatially unresolved cubes by a factor of ∼ 1.4. In real observations ∆v cen will not be distributed randomly. Rather, the distribution of line centroids is observed to be highly structured (Riener et al. 2020, Henshaw et al., in press), with coherent gradients, which will result in similar effects as in our simplified case. Moreover, variation in the non-thermal contribution to the linewidth can lead to an additional broadening of the lines at coarser spatial resolution. We thus conclude that due to beam averaging effects it is very unlikely that we observe the same population of linewidths in regions located at far distances as in nearby regions, whose emission lines are spatially better resolved.

Appendix C: Characterisation of the BDC performance
Here we give some further details about the performance of the BDC. We also discuss the effect of the KDA and size-linewidth priors (Sects. 3.2 and 3.3) on our final distance results.
Appendix C.1: Effect of v LSR uncertainties Version 2.4 of the BDC allows to supply uncertainties for the v LSR measurement, which can have strong effects on the distance estimation ( Fig. C.1). For each fit component, we chose either its estimated v LSR uncertainty or its σ v value for ∆v LSR , whichever was the higher value. The median uncertainty of the ∆v LSR values for all fit components was 1.1 km s −1 , with an IQR of 0.7 to 1.9 km s −1 . Figure C.1 illustrates the effect of ∆v LSR on the distance results. The first two panels (a, b) show distance results obtained with identical BDC settings, where only the supplied uncertainty on the v LSR coordinate was different. Increasing the v LSR uncertainty has multiple effects: the KD peaks get broadened and the association with parallax sources is increased. In our example this causes a shift of the estimated most likely distance from the near to the far KD solution. Finally, panel (c) illustrates the effect of ∆v LSR on the association with spiral arms. Larger ∆v LSR values lead to an increase in associations with Galactic features. In our example it led to the consideration of the Aquila Spur and Aquila Rift as possible candidates for an association; however this had only a very limited effect on the combined distance PDF.

Appendix C.2: Distance results without P far priors
Here we discuss the impact of the KDA and size-linewidth priors (see Sect. 3.2 and 3.3) on our distance results. For this purpose we created four more distance runs with the BDC: -Run C: Uses the default settings of the BDC, that means P SA = 0.85, but does not include the KDA and size-linewidth priors. -Run D: Same as Run C, but with the SA prior switched off (P SA = 0), which also sets P GL = 0 as these two priors are combined in the default version of the BDC. -Run E: Same as Run A, but without the size-linewidth prior.
-Run F: Same as Run B, but without the size-linewidth prior.  Fig. 8 reveals substantial differences to Run A and B, respectively. The default BDC settings in Run C lead to a much stronger association with the SA model and the results contain much less emission at close distances (d < 2 kpc). However, compared to Run A, Run C does not put emission in between the Perseus and Outer arm. Run D shows that without the KDA and GL priors the distance results contain a higher fraction of emission-free areas, which is especially notable around the far portion of the Sagittarius arm. Without the size-linewidth prior, Run D also puts significantly more emission from close distances towards the Perseus and Outer arm regions. In terms of association with Galactic features: for Run C 13.8% of the emission (and 18.6% of the fit components) were associated with interarm regions, which increased to 25.6% (34.6% of N comp ) for Run D. Figure C.3 shows the resulting σ v map if we had not used the size-linewidth prior. Since we use this prior only for emission with v LSR < 20 km s −1 , only positions at the largest R gal values are affected by it. A comparison with Run A and B shows that the size-linewidth prior helps in decreasing the confusion between near and far emission that causes the large fraction of emission lines with narrow linewidths at large distances in Run E and F. gives the cumulative distribution of all estimated probabilities. These probabilities were estimated from the integrated areas of Gaussian fit components to the combined distance PDF (Sect. 3.4). We thus get higher probabilities for regions where the combined distance PDF produced a dominant peak, which however could be caused by negative effects. For example, the near distance solution of the KD prior is cut off for low v LSR values (cf. Fig. 3), thus yielding far distance solutions with high estimated probabilities. The KD prior is also down-weighted for lower R gal values, which could lead to strongly blended KD peaks. This could result in broad Gaussian fits over both of these peaks, with high distance uncertainties as well as high estimated probability, which seems to occur at the lowest R gal values (cf. Fig. 20).
The cumulative distribution of the assigned probabilities for the distance values (left panel of Fig. C.5) shows that the chosen distance values from the BDC run with the SA prior have higher associated probabilities. For Run A, 43.8% of the chosen distance values had probabilities > 0.75 and 16.7% of the distance values had probabilities < 0.5; for Run B, these fractions change to 33.6% and 21.0%, respectively. Thus for Run A the Gaussian fits to the combined distance PDF had higher integrated areas, confirming that the addition of the SA prior leads to more welldefined peaks.
The middle panel of Fig. C.5 shows the cumulative distribution of chosen weights for the P far prior for the case where the KDA prior was used (dotted line) and the case where the size-linewidth prior (Sect. 3.3) was used in addition to the KDA (solid line). For the case in which P far was only informed by the KDA prior, 23.1% and 7.6% of the fit components received a preference for the near and far KD solution, respectively. If the size-linewidth prior is used in addition to the KDA prior, these percentages increase to 27.5% and 13.3%, respectively.
Finally, the right panel of Fig. C.5 shows the cumulative distribution for the choice of distance values (Sect. 3.4). The numbers indicate the following conditions: the distance assignment yielded only one distance solution (0); the associated Gaussian fit of one distance solution did not satisfy the criterion for the amplitude threshold (1); the distance solution with the highest probability (i.e. the highest integrated intensity of the associated Gaussian fit) was chosen (2); the distance solution with the lowest absolute distance error was chosen (3); and the near KD solution was picked randomly (4). The cumulative distribution shows that conditions (0), (1), and (2) were responsible for the vast majority of final distance choices (contributing 19.2%, 28.5%, and 51.2% for Run A and 15.9%, 40.4%, and 42.6% for Run B), whereas conditions (3) and (4) only contributed minimally.  for panel c we included the prior for spiral arms. We increase ∆v LSR from 1 km s −1 (panel a) to 10 km s −1 (panels b and c). The meaning of the lines and symbols is the same as in Fig. 2. See App. C.1 for more details.

Appendix C.4: Deviation from Galactic rotation curve
Here we quantify the deviation of our distance results from the expected values from the Galactic rotation curve model. These deviations are interesting as they can identify regions with high peculiar velocities. Figure C.6 shows the number of fit components whose estimated distance values caused a deviation of more than 10 km s −1 from the expected v LSR value based on the Galactic rotation curve. In Run A and B, 2.2% and 6.2% of the components showed such a large v LSR deviation. Since both panels show similar deviations occurring around the positions of the Sagittarius, Scutum, and Norma arms, it is likely that these differences from pure rotation curve velocities are to a large part due to the effect of the maser parallax sources (cf. Fig. 1). For Run B we can also identify an increase in the number of components with deviating v LSR values inside R gal 5 kpc. For this region the BDC downweighted the KD prior, so these deviating components might to a large part simply be due to large associated distance uncertainties. A comparison with Fig. 20 shows that these regions are indeed associated with increased uncertainty values.