Reduce the map loading time.

64 views
Skip to first unread message

Varshal Davda

unread,
Apr 8, 2016, 4:57:01 AM4/8/16
to Leaflet
I am projecting map on browser using data from postgis.
The table has 2000+ rows, so it takes too much time, around 15 minutes to load and project.
Is there any way I can reduce this time?
I am using java , postgis as database and leaflet to project the map.
Thanks 

Matt Travis

unread,
Apr 9, 2016, 3:22:34 AM4/9/16
to Leaflet
Wow. That's a long time for 2000 records. I had a geojson layer once with 35000 polygons and it took maybe a few minutes

There are a few things you can try the most important being making sure you have a spatial index on your postgis table 


Then look at these posts on reducing the geojson size and converting to topojson instead



You might also want to reduce the size of your table by reducing the number of fields you have.

In the long run you might want to investigate using geoserver/mapserver to serve your data as a wms. 

Hope that helps

Matt 

Varshal Davda

unread,
Apr 9, 2016, 4:10:58 AM4/9/16
to leafl...@googlegroups.com
Thanks Matt,
These links are very useful.
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Leaflet" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/leaflet-js/rdFsfJnhCns/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> leaflet-js+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages