Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a very specific problem. I am trying to build an offline map on leaflet, rhomobile(based on ruby) and OSM data. The problem is that I am making now a offline layer images folder with the city data rendered and in average a big city is 200mb . In case that OSM data file is only 5mb .

What is the optimal way to do it less? Maybe geojson or something else?

I know for Tilemill you can export data to .mbtiles which is sqlite3 database, but the weight of the file is the same and even bigger ... What you would suggest?

share|improve this question
Do you need the performance provided by pre-rendered tiles or can you live with rendering on request? – underdark Jan 3 '13 at 22:12
both is OK. But I need to reduce my App size on device from 200mb to something like 50mb at least – MR.GEWA Jan 3 '13 at 23:28
up vote 0 down vote accepted

If you are looking to cut down the size of your map data there are in general 3 things you can do:

  1. Generalize the geometries (i.e. removed nodes of lines/polygons. The Douglas-Peucker algorithm is a good bet here, used in PostGIS:
  2. Remove attributes of your data (I'm not sure how much the attributes on OSM-data contributes to the size, but in some cases the attribute data can outnumber the actual geographical data, worth looking into)
  3. Choose a file-format that is less verbose. As a general rule, binary formats use less space than text-bases ones. For ultimate compression, take a look at TinyWKB ( If you want a text-based format I think TopoJSON is worth considering (
share|improve this answer

You will need to create a data format that is suitable for what you are trying to do. The data format would compress the data, and generally be optimised for what you are trying to do.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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