The GeoJSON files contain hundreds or thousands of points, making them potentially quite large. The country with the most complex data and largest file size is Canada which weighs in at 1.3MB. If a few of these countries are plotted on a map then the page size is potentially huge and the cache may cause problems with the database.

TopoJSON files are potentially a lot smaller and more efficient to load and render. Unfortunately leaflet doesn't natively support them but it can be extended to support them. The next issue is in loading the files, maybe this could be done through ajax to keep the data stored in the db lower and the initial page load quicker.

CommentFileSizeAuthor
#4 use_topojson_instead_of-2841688-4.patch13.73 KBtanc

Comments

tanc created an issue. See original summary.

tanc’s picture

When Canada is quantised to have a maximum of 1e10 points using geo2topo the size is reduced to 8.7k, quite a saving! I need to test whether the loss is acceptable or whether to increase the amount of data in the conversion.

tanc’s picture

Title: Look into TopoJSON as alternative to large GeoJSON files » Use TopoJSON instead of GeoJSON
tanc’s picture

StatusFileSize
new13.73 KB

  • tanc committed c814700 on 8.x-1.x
    Issue #2841688 by tanc: Use TopoJSON instead of GeoJSON
    
tanc’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.