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

Postalcodes are not included in alternate names #91

Open
DeaconDesperado opened this issue Dec 23, 2015 · 4 comments
Open

Postalcodes are not included in alternate names #91

DeaconDesperado opened this issue Dec 23, 2015 · 4 comments

Comments

@DeaconDesperado
Copy link

The geonames database exposes US postal codes as an alternate name with language "post".

 alternatenameid | geonameid | isolanguage |                    alternatename                    | ispreferredname | isshortname | iscolloquial | ishistoric
-----------------+-----------+-------------+-----------------------------------------------------+-----------------+-------------+--------------+------------
         2732459 |   4838652 | post        | 06460                                               |                 |             |              |
         3006455 |   4838652 | link        | http://en.wikipedia.org/wiki/Milford%2C_Connecticut |                 |             |              |
         3045158 |   4838652 | ru          | Милфорд                                             |                 |             |              |
         8220181 |   4838652 | kk          | Милфорд                                             |                 |             |              |
         8220182 |   4838652 | uk          | Мілфорд                                             |                 |             |              |
         8220183 |   4838652 | mr          | मिलफोर्ड                                             |                 |             |              |
         8220184 |   4838652 | ko          | 밀퍼드                                              |                 |             |              |
         8220185 |   4838652 | zh          | 米尔福德                                            |                 |             |              |
         8710578 |   4838652 | sr          | Милфорд                                             |                 |             |              |
        10726156 |   4838652 | post        | 06466                                               |                 |             |              |
(10 rows)

Is there a way to include this name during the index building phase?

@DeaconDesperado
Copy link
Author

@parkan
Copy link
Contributor

parkan commented Dec 23, 2015

Postcodes are parsed separately, see

def parseFromPostalCodeLine(index: Int, line: String): Option[GeonamesFeature] = {

@DeaconDesperado
Copy link
Author

Thanks @parkan!

Do you perhaps know how this is exposed in the responses? I started out looking for it in names since that's how geonames saves them. Is there another key that is dedicated to the postalCodes?

@rahulpratapm
Copy link
Contributor

http://demo.twofishes.net/static/geocoder.html?query=10038

As you can see here, postal codes are just like any other features. There's no dedicated key, although the way we hack ids for these features in the geonamezip namespace allows you to parse out the country and postal code pretty easily. Notice the ids field for the feature above has a single FeatureId object whose source is geonamezip and id is US-10038

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

No branches or pull requests

3 participants