Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mapping 400MB KML data in Google Maps - how?

Re,

I have a KML file that's 400MB large - 1 week of travel and 5000km logged. It's already stripped of non-essential data. GPX file from that is around 80MB or 2.5MB zipped. KML file is around 30MB. I am not sure how many waypoints there are but must be hundreds of thousand.

How would I go about mapping it on Google Maps? Is there a way to reduce the file without compromising the quality of my tracks? I am using jQuery and Google Maps API v2 or v3.

Thanks.

like image 867
MarkL Avatar asked Dec 08 '10 16:12

MarkL


People also ask

Can you import multiple KML file into Google maps?

Hi, You can import more than one kml file into Earth for the web. Just repeat the import procedure and the files will be listed in the "KML files" section of the project panel.


1 Answers

Well it is very easy using a KML file with the Google Maps API. An example would be the following:

KmlLayer(http://myserver/kmlfile.kml)

See the API 3.0 Reference on the KmlLayer here.

But you have a problem with your large KML file. The current maximum for an uncompressed KML file is 10MB, a lot smaller than your 30MB. See the reference on KML support here.

In my experience adding large KML files to a map is also very slow. So loading your e.g. 9MB file will take lots of time. What I suggest you do is to reduce the size of the file.
Do you really need all those hundreds of thousands of waypoints? What was your logging stepping? Like each 10 seconds? Do you need to have your location down to the meter, isn't every 100meters enough? Btw: Are you working on an internet-based thing? I remember Google Earth supporting arbitrary large KML files (but certainly larger than the maps API).

I don't know any track-smothing programs or "waypoint remover", but there surely are such things out there and that is what you will need to make your KML file smaller (also 30MB still sounds very large to me, are you sure it is only waypoints or do you have decriptions and the like in the KML? Could you shorten these? Colors? Use global KML colors instead of defining the color for each waypoint!)

like image 86
Dennis G Avatar answered Nov 18 '22 01:11

Dennis G