pelias / whosonfirst

Importer for Who's on First gazetteer
MIT License
28 stars 42 forks source link

Convert string lat/lon values to numbers #445

Closed orangejulius closed 5 years ago

orangejulius commented 5 years ago

While Elasticsearch ultimately does not care about whether lat/lon values are numbers or strings, other parts of code do care, specifically detecting whether records are on Null Island, and therefore likely invalid.

In particular, the work in https://github.com/pelias/whosonfirst/pull/370 assumed only the string value '0.0' would be possible for lat/lons.

By converting to numbers, we should finally be correctly filtering out the many postal codes that are on Null Island.

Connects https://github.com/pelias/pelias/issues/692

orangejulius commented 5 years ago

Oops, I forgot that the null island checks run very early in the import pipeline (this is good for performance), so this code has no effect. https://github.com/pelias/whosonfirst/pull/447 solves the problem.