0

I'm attempting to upload a KML file to Google My Maps. But it says that the file I'm attempting to upload is either non-parse-able, or too large.

Google Maps Error

The KML file in question is generated by a program I've written. I've tried removing all of the polygons save three and the KML parses and uploads correctly. So I'm fairly sure it's not an error in my KML syntax. I've also validated it in

Here is the output from my program:

POLYGONS WRITTEN: 53
TOTAL POINTS WRITTEN: 4418
SELECTED OUTPUT FILE: output.kml

I run:

[foo@localhost test]$ ls -lh

-rw-rw-r--. 1 foo foo 108K Apr 22 16:48 output.kml

and can see that the file size of output.kml is 108 Kilobytes.

According to Google, the max file size is 10MB. So I'm well within the limit - memory-wise.

I don't understand why my file is being rejected. When I remove the majority of the polygons, the file is accepted. So the syntax is fine. But I seem to be within the file size limitations.

What's going on here? And how do I get around it?

8
  • 1
    I think you might be missing something from your own explanation. It seems pretty clear that this isn't a size issue. Your file is well below the allowed size. I think it is an issue with one or more of the features. If the file uploads properly when you remove most of the polygons, that would seem to indicate that the issue is with one of the polygons removed. It sounds like you need to do more testing of your polygon features. If you don't have an idea of which one is the culprit, a thorough way would be to start with the layer that works and add one more at a time to upload and test. Commented Apr 22, 2016 at 21:37
  • The polygons are being generated programatically. If there is something wrong with one polygon, it should be wrong with all of them. However code never works the way it's supposed to and it would be worth taking another look the next time I'm working on the program. Until then any new approaches to this problem would be appreciated.
    – kingsfoil
    Commented Apr 22, 2016 at 21:54
  • 1
    Where are the polygons coming from? How are they being generated? As you've said, when you remove some polygons, the kml works properly, so the format or syntax is not a problem. That leaves an issue with the features themselves. I would look at your program to see if you are getting a polygon that is created with an inadvertent loop or something in it. The more detail you are able to provide about the source of your data, the more likely that someone may have an insight into a solution. Commented Apr 22, 2016 at 21:58
  • 1
    I think the most likely cause is invalid geometry, as pointed out by @GetSpatial. Do any of your polygons create self-crossing lines?
    – BradHards
    Commented Apr 24, 2016 at 0:37
  • 2
    Standard debugging technique: remove half the polygons, repeat until you have smallest failing set and see what's wrong (if removing half the polygons works, try the other half, etc). Binary search.
    – user1462
    Commented Apr 24, 2016 at 15:08

1 Answer 1

0

I ran my KML through an XML validator, and it brought to my attention an extra closing tag somewhere. I fixed my program and now it uploads. Basically, the answer was: My program was broken. My apologies. Thank you all for your help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.