pelias / api

HTTP API for Pelias Geocoder
http://pelias.io
MIT License
221 stars 162 forks source link

Get population value from reverse geocoding result #1623

Open iddqd2d opened 2 years ago

iddqd2d commented 2 years ago

I can get the population value for forward geocoding, but not for reverse geocoding: image

How can I get the population value for reverse geocoding?

orangejulius commented 2 years ago

Hi @iddqd2d,

Thanks for the report. I can confirm this is true.

Here's a reverse geocoding query for a location in Paris. The results don't include population:

/v1/reverse?layers=locality&point.lat=48.854&point.lon=2.358

Whereas a forward geocoding query for Paris does return population:

/v1/search?text=paris, france

I think this is because coarse reverse geocoding uses the Point-in-Polygon service, which either doesn't include or doesn't return population information. Whereas forward geocoding uses the main Elasticsearch datastore, which does.