KML files too large for google maps - how can I shrink the size?

2,168 views
Skip to first unread message

james123

unread,
Jul 26, 2009, 6:52:50 AM7/26/09
to KML Developer Support - Getting Started with KML
Hi all,

This is my first google maps project and I am using KML files to
display country overlays onto google maps. I have a database with lat
long values for each country's polygon and I am extracting this using
PHP and outputting as a KML file. This works for some data however for
large amounts of data I get a file not found error in google maps.
I've been told that this is because my files are too large.

This is the case when I try to display all my data in one KML file
(almost every country in the world) however I have seen examples that
do this so I know it is possible. Can anyone give me any pointers as
to how this is done? Do I need to use less points at higher zoom
levels? If so how would I go about this i.e. which points do I select
and which do I ignore?

For anyone who wants to look the files are here:
http://first4quality.co.uk/neogic/maps/kml2.php
http://first4quality.co.uk/neogic/maps/kml.php

Link one (GB only) works whereas link two (all countries) doesn't.

Thanks in advance,
James

treebles

unread,
Jul 27, 2009, 11:03:49 AM7/27/09
to KML Developer Support - Getting Started with KML
Please, see the current KML rendering limitations in Google Maps.
http://code.google.com/apis/kml/documentation/mapsSupport.html

I doubt that there is going to be any way to show the entire world if
you are using Geometry elements because you need a lot of points to
build them.
I would suggest that the way to go would be to create images of the
shape of the country that you can overlay on the map using the
GroundOverlay element.

On Jul 26, 6:52 am, james123 wrote:
> Hi all,
>
> This is my first google maps project and I am using KML files to
> display country overlays onto google maps. I have a database with lat
> long values for each country's polygon and I am extracting this using
> PHP and outputting as a KML file. This works for some data however for
> large amounts of data I get a file not found error in google maps.
> I've been told that this is because my files are too large.
>
> This is the case when I try to display all my data in one KML file
> (almost every country in the world) however I have seen examples that
> do this so I know it is possible. Can anyone give me any pointers as
> to how this is done? Do I need to use less points at higher zoom
> levels? If so how would I go about this i.e. which points do I select
> and which do I ignore?
>
> For anyone who wants to look the files are here:http://first4quality.co.uk/neogic/maps/kml2.phphttp://first4quality.co.uk/neogic/maps/kml.php
Reply all
Reply to author
Forward
0 new messages