1

I have a 6mb KML file I am using with the Leaflet API/Ominvore plugin. It is just a centerline of a long distance trail. What would be the best way to make it smaller? Reduce complexity etc.

  • Are you willing to aggregate the vertices? This would reduce the number of points but it won't be as accurate. – Trevor J. Smith Feb 19 at 19:26
  • I think you should write an answer based on your comment. – PolyGeo Feb 20 at 0:52
  • your can remove all styles tag,put all placemark in only one placemark usin MultiGeometry tag for example – Fran Raga Feb 20 at 19:44
2

You can do this via the command line with OGR:

ogr2ogr -f KML output.kml input.kml -simplify 0.0001

The simplify parameter is in the units of whatever the units are for the input file. For example, if you are working in decimal degrees, 0.0001 degrees works out to around 10 m (depending on where you are on the Earth). The simplification tosses out verticies closer together than the 0.0001 decimal degree (~10 m) threshold.

0

I used this site: https://labs.easyblog.it/maps/gpx-simplify-optimizer/ Worked well. Zoomed out pretty far so the accuracy wasnt too important.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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