Geolicious / qgis2leaf

A QGIS plugin to create a working leaflet based webmap from it
127 stars 30 forks source link

Large shapefiles eats memory #52

Closed luca76 closed 10 years ago

luca76 commented 10 years ago

Hi, if I use large shapefiles, the browser eats too much memory and makes system unusable.

Test them on (click on "SHP" text at the middle of page, after the description) Street numbers - http://dati.trentino.it/dataset/comune-di-trento-numeri-civici Street graph - http://dati.trentino.it/dataset/comune-di-trento-stradario

marcobra commented 10 years ago

Tested, there are 32.000 housenumbers points.

Resulting size:

22.195.569 mag 26 09:27 exp_civiciweb.js

Seems using topoJson instead of geojson can be better

1.665.931 mag 26 09:44 civi_web.topojson

Also split the layer and/or reducing linked data attributes can help. (qgis2leaf could have an option to not have unwanted fields attributes into the result data)

Please see https://github.com/Geolicious/qgis2leaf/issues/28

Please also be sure to activate the "Visible layer" "show none" at export...

luca76 commented 10 years ago

Ok, since there is already #28, I close this :-) reopen it if you want...

riccardoklinger commented 10 years ago

@luca76 can you Share your Knowledge about topojson creation in QGis/ Python? I was Not able to find an answer online...

riccardoklinger commented 10 years ago

To enable the user to select fields that should be exported is a nice idea but hard for me to implement. One could trigger it by asking the user to use special name restrictions on their attribute names but this seems hard. The other option for choosing names individually and at runtime could be a pain in the ass as well if you have 12 shape files with 25 attributes each...

luca76 commented 10 years ago

@riccardoklinger It's not me about topojson, but @marcobra

riccardoklinger commented 10 years ago

@marcobra can you share your knowledge about topojson creation in qgis/ python as I don't know how to implement it and i don't know how to create topojsons either?!

sabas commented 10 years ago

https://github.com/calvinmetcalf/topojson.py This could help?

marcobra commented 10 years ago

+1 sabas

i've also sent mail with this thread link to https://github.com/mbostock the topojson developer

riccardoklinger commented 10 years ago

I thought topojson would be great for polygons only... But looking at the numbers above point extraction would benefit from it as well.

sabas commented 10 years ago

Example for points http://bl.ocks.org/mbostock/4408297