GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Incomplete data? Wrong country subdivision.  XML
Forum Index -> Administrative Divisions
Author Message
wafflecop



Joined: 10/04/2008 15:10:46
Messages: 5
Offline

I have a question about - Country Subdivision / reverse geocoding: http://www.geonames.org/export/web-services.html#countrysubdiv
On some parts of the world I get region, and on others I get nearest city. What's wrong and do you have a list of countries in which the service works properly?
Is there another way to get Country + Region of the given point?

Thanks for the reply.
marc



Joined: 08/12/2005 07:39:47
Messages: 3993
Offline

Do you have an example for nearest cities? It is hard to believe and I would say the cities you see happen to be the name of the administrative division.

Marc

[WWW]
wafflecop



Joined: 10/04/2008 15:10:46
Messages: 5
Offline

http://ws.geonames.org/countrySubdivision?lat=52.64&lng=16.81
On the map it points to a village "Oborniki" it is in Region "Wielkopolska" or administrative name "Wojewodztwo Wielkopolskie" both of those exists in your PL.text data file. Your service points to "Poznan" witch is the center of "Wielkopolska" / "Wojewodztwo Wielkopolskie" and it is a city near "Oborniki".

http://ws.geonames.org/countrySubdivision?lat=51.72&lng=18.13
It points to a city "Kalisz" witch is also in "Wielkopolska" and in "Wojewodztwo Wielkopolskie". And as a result we get "Kalisz".

http://ws.geonames.org/countrySubdivision?lat=50.5&lng=18
"Opole" where should be "Wojewodztwo Opolskie" so we get nearest city.

I also got the city of Ariana in Tunesia:
http://ws.geonames.org/countrySubdivision?lat=37.03&lng=10.2

http://ws.geonames.org/countrySubdivision?lat=51.75&lng=19.46&maxRows=10&radius=40
Here you also get only cities.

While i'm almost certain that here:
http://ws.geonames.org/countrySubdivision?lat=47.03&lng=10.2&maxRows=10&radius=40
You get regions.
marc



Joined: 08/12/2005 07:39:47
Messages: 3993
Offline

For some countries we do not have the newest boundary information. Poland had a reform in 1999 and it seems we have the boundary information prior to that reform. Do you know where we can get the current boundary information for Polish provinces?

Marc

[WWW]
wafflecop



Joined: 10/04/2008 15:10:46
Messages: 5
Offline

What do you need?
And what are other countries without the newest boundary information?
marc



Joined: 08/12/2005 07:39:47
Messages: 3993
Offline

We need polygons in high resolution, in shapefile or other format.

Marc

[WWW]
wafflecop



Joined: 10/04/2008 15:10:46
Messages: 5
Offline

KK, got what is shapefile will look for it

What about the city of Ariana in Tunesia? And other countries? Do they all work?
pigletto



Joined: 16/04/2008 08:36:48
Messages: 2
Location: Poland
Offline

I've found shapefiles with boundaries of Polish administrative divisions.

They're located at:
http://www.geovertical.pl/pl/product_6.htm
in section "Podział administracyjny Polski".
Direct link is:
http://www.geovertical.pl/downloads/adm_ai_shp.zip

I've opened it in qgis and found that names of divisions have no i18n letters, so I've updated this and fixed version of the above is available at:
http://static.moto-notes.com/other/poland_adm.tar.gz

I hope these files would be useful.

One more thing:
At the geovertical.pl page there are also maps of cities that are Capitals of Administrative regions (I've not checked these data):
http://www.geovertical.pl/downloads/city_ai_shp.zip

--
http://moto-notes.com
[WWW]
marc



Joined: 08/12/2005 07:39:47
Messages: 3993
Offline

Thanks, this is a fantastic resource.
I cannot read Polish. What does the page say about licenses? Are we allowed to use it?


Marc

[WWW]
pigletto



Joined: 16/04/2008 08:36:48
Messages: 2
Location: Poland
Offline

Page:
http://www.geovertical.pl/pl/product_2.php

says:
"Mapa województw jest dostępna bezpłatnie. Aby ściągnąć przejdź do sekcji download"

which means that "Map of administrative divisions is freely available. To get it go to download section". So there are no restrictions.
Same thing applies to map of Capitals of Administrative Divisions (second resource I've mentioned in previous post).

--
http://moto-notes.com
[WWW]
wafflecop



Joined: 10/04/2008 15:10:46
Messages: 5
Offline

Thx pigletto I couldn't find that myself.
marc



Joined: 08/12/2005 07:39:47
Messages: 3993
Offline

I have deleted the out-of-date boundary polygons for Poland and replaced them with the new polygons. Enjoy.

Thanks a lot, Pigletto for your help.

Marc

[WWW]
ext



Joined: 16/04/2008 09:30:39
Messages: 5
Offline

marc wrote:
I have deleted the out-of-date boundary polygons for Poland and replaced them with the new polygons. Enjoy.

Thanks a lot, Pigletto for your help.

Marc 

Cool it is changed but... Isn't it possible to change adminCode1 for object inside thes polygons to the correct one? There is still a mess with adminCode1 names.

Here is a sql which updates adminCode1 simply mapping old code to the new one. It means that if an object was in Bielsko Voivodeship and now Bielsko Voivodeship is incorporated into Slaskie Voivodeship the object is also moved to Slaskie. However there were some exceptions to the above algorithm for example there are objects which were in Bielsko and are in Malopolskie Voivodeship. Anyway - this makes data much better than they are now - you always get an existing Voivodeship.

Code:
 -- slaskie
 update geoname 
    set admin1 = 83
  where country='PL' 
        and admin1 in ('83', '25', '29', '35');
 
 -- lubelskie
 update geoname 
    set admin1 = 75
  where country='PL' 
        and admin1 in ('75', '23', '45', '27', '70');
 
 -- kujawsko-pomorskie
 update geoname 
    set admin1 = 73
  where country='PL' 
        and admin1 in ('73', '26', '65', '68');
 
 -- warminsko-mazurskie
 update geoname 
    set admin1 = 85
  where country='PL' 
        and admin1 in ('85', '30', '47');
 
 -- pomorskie
 update geoname 
    set admin1 = 82
  where country='PL' 
        and admin1 in ('82','31', '60');
 
 -- malopolskie
 update geoname 
    set admin1 = 77
  where country='PL' 
        and admin1 in ('77','32', '39', '46', '64');
 
 -- dolnoslaskie
 update geoname 
    set admin1 = 72
  where country='PL' 
        and admin1 in ('72','33', '41', '66', '69');
 
 -- lubuskie
 update geoname 
    set admin1 = 76
  where country='PL' 
        and admin1 in ('76','71');
 
 -- wielkopolskie
 update geoname 
    set admin1 = 86
  where country='PL' 
        and admin1 in ('86','37', '42', '50', '53', '34');
 
 -- swietokrzyskie
 update geoname 
    set admin1 = 84
  where country='PL' 
        and admin1 in ('84','36');
 
 -- zachodniopomorskie
 update geoname 
    set admin1 = 87
  where country='PL' 
        and admin1 in ('87','38', '62');
 
 -- podkarpackie
 update geoname 
    set admin1 = 80
  where country='PL' 
        and admin1 in ('80','40', '54', '56', '63');
 
 -- lodzkie
 update geoname 
    set admin1 = 74
  where country='PL' 
        and admin1 in ('74', '59', '58', '51', '43');
 
 -- podlaskie
 update geoname 
    set admin1 = 81
  where country='PL' 
        and admin1 in ('81', '61', '24', '44');
 
 -- opolskie
 update geoname 
    set admin1 = 79
  where country='PL' 
        and admin1 in ('79', '48');
 
 -- mazowieckie
 update geoname 
    set admin1 = 78
  where country='PL' 
        and admin1 in ('78', '49', '52', '55', '57', '67', '28');
 
marc



Joined: 08/12/2005 07:39:47
Messages: 3993
Offline

Thanks, ext.

I have run the updates. They are available with todays daily dump.

Marc

[WWW]
ext



Joined: 16/04/2008 09:30:39
Messages: 5
Offline

marc wrote:
Thanks, ext.

I have run the updates. They are available with todays daily dump.

Marc 

Hi! Thanks for updating, but I'd like to know how are data in the files related with data served by geonames webservices. I ask because when I load data from the dump I can run:

select * from geoname where country='PL' and admin1='83' and name ilike 'lipnik';

which gives me a row (in fact two rows but the one I'm interested in is below):
id: 3093281
name: Lipnik
admin1: 83
...

but when I call:

http://ws.geonames.org/search?q=lipnik&adminCode1=83&country=PL

I get nothing, but (look at different values in admin1Code):

http://ws.geonames.org/search?q=lipnik&adminCode1=25&country=PL

returns a record:

id: 3093281
name: Lipnik
admin1: 25
...

So the data in dump is not the data served by WS.
marc



Joined: 08/12/2005 07:39:47
Messages: 3993
Offline

GeoNames is using several servers. I have manually updated the main database and the modification will become visible on the other servers and services when we update the database and webservice index on all servers.

Marc

[WWW]
 
Forum Index -> Administrative Divisions
Go to:   
Powered by JForum 2.1.5 © JForum Team