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) :
Region : https://gist.github.com/oanalivia/0db129e0d66d7371e0f76315326ea82f
Department : https://gist.github.com/oanalivia/738d816b3de2d64dbed45aaf9cbc9e7e
Town : https://gist.github.com/oanalivia/94fc3aaca90c88bbf8871dbf698637bc (Please be patient with this one, it contains almost 40K lines 😉 )
Indexes and constraints : https://gist.github.com/oanalivia/040eb8af3d562bf554495de0f1738525
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.
One thought to “French Towns, Departments and Regions (January 2018)”