5

I'm sending geoJSON data to a web page and it's too big causing very slow download times. I'm going to simplify on the server side. My question is what tolerance I should use for my simplification at a given zoom level, is there a straight mapping or does it depend on the screen size?

My first guess is that I should work out how far one pixel is on my screen and simplify to half that distance?

1 Answer 1

2

What you can actually do is store the geojson as topojson on the server side. Topojson is a format that follows topology so when the geojson is converted to topojson the size is reduced upto 60-80% and then with topojson.js library you can convert topojson to geojson on the client side. By doing this the download time is reduced as the file size is low and you need not have to simplify.

2
  • If the geometry are very complex, it could be useful to simplify , not for load time but for cleaner display.
    – J.R
    Sep 20, 2019 at 13:02
  • 1
    And for the simplification what you can actually do is use leaflet to draw the polygon. Leaflet.js automatically simplifies the geojson when zoomed in and out Sep 20, 2019 at 13:16

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.