将23mb kml文件分成3个偶数块

I have looked here and have not yet found any solutions that match my problem. I looked at my function I used and realized it didn't make any sense as it did not take the size of the file into account or anything.
Could you please let me know what algorithm or method is used to split large kml files. Alternately, I'd like to know if it is possible to serve up a large kml file from the backend? Thanks in advance :-)

You identify the correct first step in your comment, in that you should generate a KMZ. I also look for the following places to save on characters in my KML files:

  1. Check the precision of the coordinates. 5 decimal places gets you ~ 1 metre of accuracy. If you are blindly returning more (13 or so is accurate to the width of a hair) this can reduce the size significantly.
  2. Remove white-space - can help a surprising amount, although if you are using KMZ compression as well much of any gain here is lost.
  3. Choose shortened element, style, and other names, if repeated often this can also save on overall size, but is also a gain which is easily mitigated by using a KMZ.

If you need to split it up just parse the whole document in your script and output x placemarks per output file (with the same parent nodes in each output KML file). I would look at this library for parsing / creating you KML: https://github.com/earelin/php-libkml