Get country code with web service.

411 views
Skip to first unread message

viktor...@gmail.com

unread,
Jul 23, 2007, 4:32:13 PM7/23/07
to geonames
Hi,

I try to get country-codes with web services:

http://ws.geonames.org/countrycode?lat=-17.931866&lng=122.210026&type=xml
http://ws.geonames.org/countrySubdivision?lat=-17.931866&lng=122.210026

The first service do not give the country code, but the second service
give me country-code and country-name (with same coordinates).

I prefer to use the first service, because I need only country-codes.
Is it a web service bug, or I making somethink wrong?

thansk,
Viktor Szule

Marc Wick

unread,
Jul 24, 2007, 1:22:20 AM7/24/07
to geon...@googlegroups.com
Hi Viktor

The lat/lng you are geocoding in this example are a beach on an
Australian peninsula.
These two reverse geocoding services use polygons describing the coast
line. In this case it happens that the resolution of the two polygons is
not identical and one service identifies the point as on the landmass
whereas the other service identifies it already in the ocean.
There is nothing you are doing wrong nor is it a bug. I am not even sure
whether higher resolution of the polygons would solve this problem
entirely. Is there an exact coast line? At ebb tide or at high tide?

Regards

Marc

viktor...@gmail.com

unread,
Jul 24, 2007, 3:06:31 AM7/24/07
to geonames
Hi,

Would it be possible to create a webservice function which find the
nearest country-name, country-code and country-subdivision of a given
long/lat?

Regards,
Viktor

On júl. 24, 07:22, Marc Wick <m...@geonames.org> wrote:
> Hi Viktor
>
> The lat/lng you are geocoding in this example are a beach on an
> Australian peninsula.
> These two reverse geocoding services use polygons describing the coast
> line. In this case it happens that the resolution of the two polygons is
> not identical and one service identifies the point as on the landmass
> whereas the other service identifies it already in the ocean.
> There is nothing you are doing wrong nor is it a bug. I am not even sure
> whether higher resolution of the polygons would solve this problem
> entirely. Is there an exact coast line? At ebb tide or at high tide?
>
> Regards
>
> Marc
>
>
>
> viktor.sz...@gmail.com wrote:
> > Hi,
>
> > I try to get country-codes with web services:
>

> >http://ws.geonames.org/countrycode?lat=-17.931866&lng=122.210026&type...


> >http://ws.geonames.org/countrySubdivision?lat=-17.931866&lng=122.210026
>
> > The first service do not give the country code, but the second service
> > give me country-code and country-name (with same coordinates).
>
> > I prefer to use the first service, because I need only country-codes.
> > Is it a web service bug, or I making somethink wrong?
>
> > thansk,

> > Viktor Szule- Idézett szöveg elrejtése -
>
> - Idézett szöveg megjelenítése -

Reply all
Reply to author
Forward
0 new messages