Google Maps API V3: How to get region border coordinates (polyline) data?

97,217

This is becoming a FAQ. See the replies to these questions:

Add "Search Area" outline onto google maps result

Google has started highlighting search areas in Pink color. Is this feature available in Google Maps API 3?

Share:
97,217
Harri Virtanen
Author by

Harri Virtanen

Updated on August 31, 2020

Comments

  • Harri Virtanen
    Harri Virtanen over 3 years

    I'm trying to get (specified) region borders as GMaps coordinates (to form a polyline) from Google Maps. Is this possible in some way? (either from maps.google.com or my own GMaps in my own domain).

    Note: I know you can draw/outline regions manually with tools intended for it (like http://www.birdtheme.org/useful/v3tool.html), but covering a large region ACCURATELY is a ton of work. The draw-it-yourself answer is not an option in this case.

    Example:

    1. https://maps.google.com/ -> type in "Uusimaa, Finland"
    2. You can see the pink-ish border that outlines the wanted region
    3. That border is the polyline that I need the coordinates of

    Requirements:

    • Extract the region data coordinates (if available) from a given search (as in the example)
    • If the previous is not possible, a source to an ACCURATE map of the region "Uusimaa, Finland" is required (plain googling did not yield needed results).