Over the past two years, 18 cities have reported how many bookstores they have, and 20 have reported on their public libraries.
Hong Kong leads the pack with 21 bookshops per 100,000 people, though last time Buenos Aires sent in its count, in 2013, it was the leader, with 25. New York does OK, with around 840 bookstores for 8.4 million people, but London, whose population is only slightly bigger than New York, counts only 360 stores.
Taipei and Madrid do well too. In terms of what you actually get, I think of Buenos Aires and Madrid as standing at the top. My casual impression is that a lot of the Asian bookstores are more vocational than useful to a reader such as myself or Michael Orthofer.
For libraries Edinburgh is #1 by more than a factor of five.