The strong, positive relationship between productivity and density has been used as evidence for the existence of agglomeration forces such as productivity spillovers. This paper presents an alternative hypothesis: The sorting of heterogeneous entrepreneurs drives the density-productivity relationship. Sorting generates differences in market access and prices, and relationships between location and firm characteristics arise endogenously. I introduce a new method for solving continuous space geography models. Indexing locations according to their endogenous desirability, I solve the model in two steps, first with respect to the index and then mapping locations to index values. This change of variable approach dramatically reduces the complexity of the continuous space geography, allowing me to characterize multiple equilibria and derive relationships between location and firm characteristics. I use establishment-level Census data to document these relationships, and I find they are consistent with the model. Finally, I use the predictions of the model to test the sorting hypothesis. Positive shocks to density can lead to negative productivity changes through changes in the composition of firms, inconsistent with models of agglomeration forces without sorting. I test for these composition effects, instrumenting for the supply of new construction using the inter-city linkages of REITs, and present evidence of firm sorting.