Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin city populator broken for large countries #979

Closed
jeffwarnica opened this issue Dec 23, 2012 · 5 comments · Fixed by #985
Closed

Admin city populator broken for large countries #979

jeffwarnica opened this issue Dec 23, 2012 · 5 comments · Fixed by #985

Comments

@jeffwarnica
Copy link

See #941 and #670. Opening a new issue as I think I've got the problem understood as a general case.

When a geographically "large" country is selected, the Geonames service will return 0 results.

It seems the root of the problem is that the (free to use) API just gives up when you give it a large "bounding box". One gets what they pay for, I guess. I would suggest that an alternative method would be to not search based on some well known geographical description of the country selected, but to search for cities based on the current previewed map.

@rjmackay
Copy link
Contributor

rjmackay commented Jan 3, 2013

@jeffwarnica searching on the current map view would likely have the same issues for any maps using a wide initial zoom.
We might have to look at using a different source..

@jeffwarnica
Copy link
Author

True, though if/when you get 0 results back you could offer the suggestion
that the search area may be too big. From a map based search, the user can
fix this. At least if their target area is small enough to get free results
for.
On 2013-01-03 5:38 PM, "Robbie MacKay" notifications@github.com wrote:

@jeffwarnica https://github.com/jeffwarnica searching on the current
map view would likely have the same issues for any maps using a wide
initial zoom.
We might have to look at using a different source..


Reply to this email directly or view it on GitHubhttps://github.com//issues/979#issuecomment-11862040.

@rjmackay
Copy link
Contributor

rjmackay commented Jan 3, 2013

I'm just wondering if we can pull a location list from OSM (maybe Nominatim http://wiki.openstreetmap.org/wiki/Nominatim) since then it would match what users see on the map too.

or maybe just parse the full Geonames data dumps http://www.geonames.org/export/

@rjmackay
Copy link
Contributor

rjmackay commented Jan 3, 2013

I think the quick solution here is to use something like:

http://www.overpass-api.de/api/xapi?node[bbox=68.11,20.12,74.48,24.71][place=city]
Note that Overpass expects the bbox as west,south,east,north

source: https://help.openstreetmap.org/questions/13872/how-to-find-list-of-cities-in-a-state-with-overpass-osm-api

Though it would probably make sense to source the bounding box from OSM too rather than using a mix of geonames and OSM

rjmackay added a commit to rjmackay/Ushahidi_Web that referenced this issue Jan 14, 2013
@rjmackay
Copy link
Contributor

#985 should fix this issue by switching to us OSM as data source.

Please try it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants