0

error: España (spain) as Town type

i am using the query type to retireve items type Town...


http://where.yahooapis.com/v1/places$and(....PID&lang=en

http://where.yahooapis.com/v1/places$and(....PID&lang=es


both queries (my app its multilingual) returns Espaa or Spain as town.

by
5 Replies
  • In our data the town is called "España" in both English and Spanish. Do you expect the English version as "Espana" ?
    0
  • QUOTE (Walter @ Dec 16 2009, 03:26 AM) <{POST_SNAPBACK}>
    In our data the town is called "España" in both English and Spanish. Do you expect the English version as "Espana" ?


    no, the error it seems that appears the country Spain (or España) as Town, there is no town called "España" or "Spain"and could confuse my users because i am trying to filter the location in my app only by Town.
    0
  • no ideas? no clues? pleaseeee give me some feedback :u
    0
  • Sorry for the late reply.

    Firstly there is a town called Espana : http://maps.yahoo.com/#mvt=m&lat=40.62...=Espana%2C%20ES
    That is not the only case, as there are a lot of towns that share their name with countries.

    GeoPlanet by default always returns the single most likely place, so for "Espana", "Brazil" or "Australia" you will get a country:

    http://where.yahooapis.com/v1/places.q(Esp...ppid=YOUR_APPID

    If you use a filter by type Town, like you did, GeoPlanet returns the most likely town, even though we are much more sure that "Espana" is usually a country. So what you need to do is not use a filter, and do the filtering yourself by looking at the "placeTypeName" result in the XML (or JSON).

    For example, you will display Madrid because you have <placeTypeName code="7">Town</placeTypeName> in the XML:
    http://where.yahooapis.com/v1/places.q(Mad...ppid=YOUR_APPID

    I hope this helps,
    Walter
    0
  • thanks Walter! so embarrasing to know that a town called spain exists...

    i will try with your suggestion, or maybe do a special case for this town.

    Thanks again for your support! :)
    0
This forum is locked.

Recent Posts

in GeoPlanet General Discussion