A few weeks ago, a project I was working on needed a list of French towns, sorted by department and by region. So I went looking into the official data, and I found a list of towns with names, postal codes, gps coordinates, departments, but no regions. And a list of departments. And another list of regions, with their corresponding departments. A few hours later, I compiled all this (non developer friendly) lists into three big SQL insert queries, corresponding to the following schema :
town (id, name, postalCode, department_id #)
department (id, name, postalCode, region_id #)
region (id, name, code)
Here are the links to the SQL queries (create table and insert values) :
Town : https://gist.github.com/oanalivia/94fc3aaca90c88bbf8871dbf698637bc (Please be patient with this one, it contains almost 40K lines 😉 )
I hope this is will be useful to some developer out there who hates long, uncorrelated lists 😉
These are the new French regions, with their new official names, taking into account the new 2016 schema.
Only metropolitan France is included, without the overseas regions and territories.
Corsica is included.
Monaco is not included.