Most recently, Habré was an article from AirBnb -
"Creating a map of the world .
" Good and beautiful article about the administrative division of the world. One minus - the article has one comment, and that is mine.
Take this opportunity to conduct a survey - would you like such a map of administrative divisions?
And then I have it:

You've probably noticed that Google.Maps can
highlight the contours of cities . Recently, this
is on Yandex.Maps . Few people know that
geometry is on eSosedi .
')
But when
such an opportunity appears on your site - now it depends only on you% username%.
To achieve the effect, just go to data.esosedi.org or GitHub , familiarize yourself with the documentation of the osmeRegions library and start using.
PS: 3 signs that the past year has done everything beautifully: 1. Areas 2. Quarters. 3. Detailing to “Residential arrays” is available for some cities.
OSMeRegions is both a library and a service that allows you to display administrative division data based on OpenStreetMap on a map. The older brother of
the Yandex.Maps
regions module .
The initial task was to try to improve the addressing of geo-bound objects on esosedi. Because we have such a job. As
stated in the park :
“Imagine that Lenin Street is in your city. So - in the neighboring town, too.
It all started with the ISO3166-2 standard, which defines the letter indexation of countries and regions. Moscow, for example - RU-MOW. Personally, I never liked addressing objects on “geo” sites - there is no “CNC-like” location indication in the URL. All links are the same and it is not clear what is at stake. At the same time there were problems with the geocoder - with the definition of the administrative address.
In general, it was a sentence, ahead was the unification of OSM data with GeoNames, Wikipedia parsing, implementation of direct and reverse geocoders, finding
Kashcheeva's death , and writing a pack of “detransliterizers” to get the human-readable names of the regions.
(I do not know how to do such gifs, a picture from the AirBnb topic)What do you want - to
paint the country according to a certain scheme , or make
New Moscow Old - your business.
There is only one team:
osmeRegions.geoJSON(addr, options, callback)
Where addr is the name of a region of the world (or simply of the world), a country or region code in the format 3166-2, or OpenStreetMap RelationId. And the rest - schemes, filters, recombinations - at will.
Hint: relationId can be obtained by going to the right place on the esosedi - all information is so indicated. Or use the “navigator” on data.esosedi.org - it was created for this purpose.
This is not some kind of
topojson , it is an API to the “pen” that is ready to give you data on a couple of hundreds of thousands of administrative elements. At the same time GeoJSON comes out of the handle, which you can feed the same d3. In general, this is a
solution .
World
 | Big Moscow
 |
Old Moscow (recombination)
 | New Moscow
 |
Crimea Our (recombination)
 | Crimea is your
 |
A recombination is when you yourself determine how to collect the regions on the client.
PS: Service may contain, contains and will contain errors.
PPS: The data return handle will work “forever” at your own risk. When this article began to be written, I wanted to add this phrase “as long as there is no euro at 70”. As the water looked. But nothing prevents you from saving json data files yourself.
PPPS: The license is simple, but not one - esosedi (CC BY-SA),
OSM (CC-BY-SA + ODbL), Wikipedia (CC BY-SA), GeoNames (CC BY). Special thanks to all forgotten
geo.webnabor.com .
Figuratively speaking:
esosedi , "OpenStreetMap Members" , Wikipedia , GeoNames (Although they do not require)
This story began 7 years ago, in 2008, in the depths of
Wikimapia . This topic was written twice with a gap of one year, and as a result was written one and a half years later than the first terms. There were a lot of interludes, comedies and tragedies, and now it's intermission time. To eat filed -
github.com/esosedi/regions