Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps - Scraping KML / extract overlays data ( coordinates )

I would like to understand how to scrape / extract KML data from a google map overlay.

I have been trying for last few month without success. I did try using fiddler and my console developer tools to look into the site's source code. I went through almost every line of Javascript and I still cannot figure out how to intercept the KML data or extract it from these maps (see below).

Target Maps

Here is an Overlay that consists of one Satellite footprint.
and Here you can find much more examples of similar maps.

I am not even sure if this is possible and how it can be achieved.
Has anyone been able to do a similar task ? Please I need guidance on how to achieve this.

Thank you for your time.

like image 345
Awena Avatar asked Nov 09 '22 02:11

Awena


1 Answers

I take a look and tn the overlay there aren't data to scrap...

For the KML is simple you can do it server side. opend then kml like an xml file and the scan this dom for placemark, polygon and lineaRing tag inside you find the coordinates in lng, lat format..

Client side you can do this whit jquery loading the xml file and scan for node you need ...

The kml struct is standard...

<Document>
    <Folder>
        <name>Full Satellite Footprint - EIRP</name>
        <Placemark>
            <name>Atlantic Ocean EIRP 40dBW</name>
            <styleUrl>https://www.telesat.com/kml/TelesatKMLStyles.kml#coverageArea</styleUrl>
            <Polygon>
                <outerBoundaryIs>
                    <LinearRing>
                        <coordinates>36.826,55.201,0 37.0055090185901,55.2151134621769,0 36.8423211206917,55.6055987892911,0 36.5363438121321,56.3253739818074,0 36.2041398771245,57.1121727752464,0 35.6982976142624,58.2038341375218,0 35.4781980136987,58.66035224623429,0 35.2392363744069,59.1245171274041,0 34.991585220959,59.5937508918316,0 34.7381410580738,60.0586398991811,0 34.4948230756851,60.5170059779041,0 34.2134913653683,60.9937069314964,0 33.9399744247826,61.4547783456267,0 33.6430131750038
like image 166
ScaisEdge Avatar answered Nov 15 '22 07:11

ScaisEdge