0

Issues when trying to locate a placetype 9 resource

Hello there,

I'm having some issues when trying to locate a province (placetype 9) using the GeoPlanet service. Here goes an example.

There is a province with the name "Cádiz" at Spain. This same name is also used for the provincial capital. And it seems that there are also some other places with that same name around the world. If I try to locate all the provinces with that name, using something like:

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

Or without the single quotes:

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

I get 0 results. The same is true if I try to search substituting the 'a' with the tilde with a regular 'a':

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

But here is the strange behavior: If I look for a city that I know it is inside that province (example: Algeciras):

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

which gives me its WOE = WOE 752067, and then I look for the provinces for which Algeciras belongs to:

http://where.yahooapis.com/v1/place/752067...son&lang=es

then I obtain what I was looking for from the beginning: The WOE of Cádiz, which is 12602096.

Am I doing something wrong with any of the requests? Or is this a bug?

by
3 Replies
  • Sorry, I'm not habituated to the bbcode and the URLs on the previous post suffered some characters substitution. Here it goes the message again with the queries wrapped into codeboxes. Sorry for any inconvenience.

    Hello there,

    I'm having some issues when trying to locate a province (placetype 9) using the GeoPlanet service. Here goes an example.

    There is a province with the name "Cádiz" at Spain. This same name is also used for the provincial capital. And it seems that there are also some other places with that same name around the world. If I try to locate all the provinces with that name, using something like:

    CODE
    http://where.yahooapis.com/v1/places$and(.q('Cádiz'),.type('9'));count=0?appid=MYAPPIDHERE&format=json&lang=es


    Or without the single quotes:

    CODE
    http://where.yahooapis.com/v1/places$and(.q(Cádiz),.type(9));count=0?appid=MYAPPIDHERE&format=json&lang=es


    I get 0 results. The same is true if I try to search substituting the 'a' with the tilde with a regular 'a':

    CODE
    http://where.yahooapis.com/v1/places$and(.q('Cadiz'),.type('9'));count=0?appid=MYAPPIDHERE&format=json&lang=es


    But here is the strange behavior: If I look for a city that I know it is inside that province (example: Algeciras):

    CODE
    http://where.yahooapis.com/v1/places$and(.q('Algeciras'),.type('7'));count=0?appid=MYAPPIDHERE&format=json&lang=es


    which gives me its WOE = WOE 752067, and then I look for the provinces for which Algeciras belongs to:

    CODE
    http://where.yahooapis.com/v1/place/752067/belongtos.type('9')?appid=MYAPPIDHERE&format=json&lang=es


    then I obtain what I was looking for from the beginning: The WOE of Cádiz, which is 12602096.

    Am I doing something wrong with any of the requests? Or is this a bug?
    0
  • There are two issues preventing your query from succeeding. The first issue is that the type filter requires a numeric place type code; if it a string, it is assumed to be a place type name (such as 'town'). The second issue is that GeoPlanet is erroneously hiding Cadiz Province (because it has the same name as the city of Cadiz). This is a bug and will be fixed in a later release. As a workaround, you can use the name 'Cadiz Provincia' to find this place. Here is an example GeoPlanet request:

    CODE
    http://where.yahooapis.com/v1/places$and(.q(Cádiz+Provincia),.type(9);count=0?appid=MYAPPIDHERE&format=json&lang=es"]
    Note that you don't require the type filter since the query matches a unique place.

    You only need quotes in the q filter if the place name includes a comma, such as 'Paris, Texas'.

    For administrative areas, you may get better results by including the area type in the query (such as Provincia). Some administrative areas are named after one of the cities within the area and without context, GeoPlanet cannot know which place to return first.

    Eddie Babcock
    Yahoo! Geo Technologies

    QUOTE (carlosparamio @ Mar 19 2009, 12:02 PM) <{POST_SNAPBACK}>
    Hello there,

    I'm having some issues when trying to locate a province (placetype 9) using the GeoPlanet service. Here goes an example.

    There is a province with the name "Cádiz" at Spain. This same name is also used for the provincial capital. And it seems that there are also some other places with that same name around the world. If I try to locate all the provinces with that name, using something like:

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

    Or without the single quotes:

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

    I get 0 results. The same is true if I try to search substituting the 'a' with the tilde with a regular 'a':

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

    But here is the strange behavior: If I look for a city that I know it is inside that province (example: Algeciras):

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

    which gives me its WOE = WOE 752067, and then I look for the provinces for which Algeciras belongs to:

    http://where.yahooapis.com/v1/place/752067...son&lang=es

    then I obtain what I was looking for from the beginning: The WOE of Cádiz, which is 12602096.

    Am I doing something wrong with any of the requests? Or is this a bug?
    0
  • Thanks, Eddie. Your tips worked as a charm. We just needed to escape the 'á' at 'Cádiz' to build a wellformed query. We will use the suggested workaround to locate administrative areas in the meantime.

    Carlos Paramio
    Evolve Studio

    QUOTE (Eddie B @ Mar 26 2009, 03:53 AM) <{POST_SNAPBACK}>
    There are two issues preventing your query from succeeding. The first issue is that the type filter requires a numeric place type code; if it a string, it is assumed to be a place type name (such as 'town'). The second issue is that GeoPlanet is erroneously hiding Cadiz Province (because it has the same name as the city of Cadiz). This is a bug and will be fixed in a later release. As a workaround, you can use the name 'Cadiz Provincia' to find this place. Here is an example GeoPlanet request:

    CODE
    http://where.yahooapis.com/v1/places$and(.q(Cádiz+Provincia),.type(9);count=0?appid=MYAPPIDHERE&format=json&lang=es"]
    Note that you don't require the type filter since the query matches a unique place.

    You only need quotes in the q filter if the place name includes a comma, such as 'Paris, Texas'.

    For administrative areas, you may get better results by including the area type in the query (such as Provincia). Some administrative areas are named after one of the cities within the area and without context, GeoPlanet cannot know which place to return first.

    Eddie Babcock
    Yahoo! Geo Technologies
    0
This forum is locked.

Recent Posts

in GeoPlanet General Discussion