Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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
add comment

2 Answers 2

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: http://postgis.org/docs/ST_Simplify.html)
  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 (http://blog.jordogskog.no/2013/04/09/tiny-wkb/). If you want a text-based format I think TopoJSON is worth considering (https://github.com/mbostock/topojson/wiki)
share|improve this answer
add comment

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
add comment

Your Answer

 
discard

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.