Neighborhoods ... Quarters ...

    Most recently, an article from AirBnb was published on the hub: "Creating a map of the world . " A good and beautiful article about the administrative division of the world. One minus - the article has one comment, and then mine.
    I take this opportunity to conduct a survey - would you like such a map of administrative divisions?
    And then I have it:

    You probably noticed that Google. Maps can highlight the contours of cities . Recently, this is also on Yandex.Maps . Few people know that there is geometry on eSosedi .

    But when such an opportunity appears on your site - now only% username% depends on you.

    To achieve the effect, just go to or GitHub , read the documentation of the osmeRegions library and start using it.

    PS: 3 signs that last year everything was done beautifully: 1. Regions 2. Quarters. 3. Detailing to “Housing estates” 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 elder brother of the Yandex.Maps regions module .

    The initial task was to try to improve the addressing of geo-linked objects to esosedi. Because we have such a job. As the spark said :
    “Imagine that in your city there is Lenin Street. So - in the neighboring city it is also there. ”

    It all started with the ISO3166-2 standard, which defines the alphabetical indexing of countries and regions. Moscow, for example - RU-MOW. Personally, I never liked the addressing of objects on "geo" sites - in the URL there is no "CNC like" location indication. 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 determination of the administrative address.
    In general, it was a saying, ahead of us was combining OSM data with GeoNames, parsing Wikipedia, implementing direct and reverse geocoders, finding the death of Kashcheeva , and writing a bunch of “detranslitizers” to get the names of regions that were readable by our person.

    (I don’t know how to make such gifs, a picture from the AirBnb topic)

    What do you want - paint countries according to a certain pattern, or to make Old Moscow from New Moscow is your business.

    There is only one command:

    osmeRegions.geoJSON(addr, options, callback)

    Where addr is the name of the region of the world (or just the world), the country or region code in the format 3166-2, or OpenStreetMap RelationId. And the rest - circuits, filters, recombinations - at will.
    Hint: relationId can be obtained by going to the right place on esosedi - all information is so indicated. Or use the "navigator" on - it was created for this.
    It’s not some kind of topojson , it’s an API for a “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 can be used to feed the same d3. In general, this is a solution .

    Greater Moscow
    Old Moscow (recombination)
    New Moscow
    Our Crimea (recombination)
    Your Crimea

    Recombination is when you decide on how to collect regions yourself on the client.

    PS: The service may contain, contain and will contain errors.
    PPS: The handle of data output will work "forever" at your own peril and risk. When this article began to be written, I wanted to supplement this phrase "as long as there are no 70 euros." As he looked into the water. But nothing prevents saving json data files to themselves.
    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 the forgotten .
    Figuratively speaking:
    esosedi , «members by OpenStreetMap» , the 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 an interval of a year, and as a result was written a year and a half later than the first dates. There were a lot of interludes, comedies and tragedies, and now the intermission time. Eat served -

    Also popular now: