In order to answer this question, first I define a region around the equator.
eq = GeoBoundsRegion[{{-3, 3}, {-180, 180}}]
GeoGraphics[eq]
Next, I wanted to find cities within this band but could not use GeoWithinQ
directly. Instead, I used GeoNearest
to find three cities that are in close proximity, every 10th longitude along the equator. This takes a good minute of waiting on my machine with every new restart.
cities03 =
Union@Flatten@(GeoNearest[Entity["City"], GeoPosition[{0, #}], 3] & /@
Range[-180, 180, 10])
Now I could locate cities within the band shown above.
cities03Within = Pick[cities03, GeoWithinQ[eq, #] & /@ cities03]
The timing was twice as bad than for the last task but it worked in the end.
EDIT
cities03Within = Select[cities03, GeoWithinQ[eq]]
takes a second to complete. Why?
#["Population"] & /@ cities03Within
Total@%
Quantity[6070496, "People"]
Motivation
Out of the six million people, 2M+ live is in Manaus, Brazil. Other significant populations are in Indonesian cities. I would like to find out population stats for various latitude ranges. An important task, eventually, would be to find the available land area in a latitude band. There isn't that much land near the equator but that would be a different question, if I can't figure it out on my own.
Question
How do I improve this workflow, so that I can locate cities within a GeoBoundsRegion
that are above a certain population threshold? Is the number I calculated close to reality or is there a problem with this calculation?
Thanks for your help in advance.