8

I have downloaded a database cities

`Country`  `City`        `AccentCity`  `Region`  `Population`  `Latitude`  `Longitude`
af     amir kalay       Amir Kalay      16        0             34.6333     70.3333 
ad     aixas            Aixas           06        0             42.4833     1.4667 
and lot more records

I have downloaded another database called fips_10_4 to show the state of the city

country,Region,State
AD,02,"Canillo"
AD,03,"Encamp"
AD,04,"La Massana"
AD,05,"Ordino"
AD,06,"Sant Julia de Loria"
AD,07,"Andorra la Vella"
AD,08,"Escaldes-Engordany"
AE,01,"Abu Dhabi"

Now if you are thinking that Iam asking for some sql query then you are wrong. Everything was working fine but then I came to know that the file i downloaded from
Maxmind website is incomplete as 'fips_10_4' has no record for country 'af' and region '16' .May anybody help me to deal this problem and tell me the correct place to download this complete file

4

3 回答 3

9

FIPS 10-4 has changed. The list of changes can be found here.

In particular, AF16 (Laghman) has changed to AF35. MaxMind uses the new list.

If you need both the old and the new codes, you can find them here. You can parse the contents of the file, and replace your database table with the information found there.

于 2012-05-28T21:14:29.613 回答
9

AF is the two digit ISO code (IS0-3166-2) for Afghanistan, which ISO are currently trying to sell for the frankly astonishing sum of CHF 244 (Swiss Francs).

As Teleo says FIPS 10-4 has changed as detailed on the ITL website and the link Teleo has given provides the data in a more usable format. MaxMind also provides it in a better format.

I would be extremely wary about using this. Both MaxMind & Teleo's link are being provided, for free, by an external company/person that has no particular interest in keeping their data up-to-date. I notice, for instance, that the following countries are missing:

  • South Sudan
  • Sint Martaan (Dutch Part)
  • Bonaire, Sint Eustatius and Saba
  • Curaçao

The last three were part of the Netherlands Antilles, which was dissolved on 10th October 2010. Incidentally, the Netherlands Antilles, which hasn't existed for a year and a half, is still on this file.

The reason for all of this? FIPS 10-4 was withdrawn almost a decade ago on 8th September 2002. To quote the ITS website (my emphasis):

“For a replacement to FIPS 10-4, INCITS L1 is coordinating with other standards developers and interested parties to determine whether processing a draft proposed American National Standard or adopting an ISO standard would be the better way forward. For more information on the status of this activity, contact Rick Pearsall (Richard.A.Pearsall@nga.mil).”</p>

A quick Google brings the news the INCITS L1 is next meeting on the 12th June 2012. I wouldn't hold your breath.

Another reason not to use FIPS is that it is unlikely to be used much outside of the USA (obviously some people will still use it). While this may not matter immediately I would future proof your systems as a matter of course.

I would highly recommend using the ISO 3166 standard. It is a globally recognised way of categorising country data.

The CommonDataHub maintains a great version, which includes country and state in the same manner as FIPS 10-4. They also have other ISO states databases, which are more normalised and worth investigating.

It also maintains a list of all cities with a population greater than 5,000.

ISO maintain a copy on their website of the 3166-2 standard, which will take a bit of coding to ensure it's you're always updated at least you'll be sure it's correct. Wikipedia is also surprisingly good at keeping up-to-date. It beat CommonDataHub by a month when South Sudan was created, due to problems telling people that the data existed.

There are other places out there where this data exists, this just details what I use.

If you want to avoid databases all-together then the Yahoo! PlaceFinder API is a good place to start. It has some documented problems keeping up-to-date but at least there's a place where you can tell them they've got it wrong.

tl;dr

Don't use FIPS, it was withdrawn a decade ago. Use the globally recognised ISO standard instead.

于 2012-05-29T20:47:09.457 回答
3

I am not sure what is your true goal, but here is a great resource of countries and cities and all...

于 2012-05-29T19:16:59.943 回答