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.

For my project I am trying to convert the tiger shapefile information for us states into GeoJSON format

However when I use the ogr2ogr tool the data file is about 20 MB. I have seen the geoJSON file of US States elsewhere of around 88KB.

How do I reduce the output to geoJSON file?

share|improve this question

2 Answers 2

You have two ways of reducing the file size:

  1. Remove all the pretty formatting and redundant white space. In some 'XML-style' files this can be a surprisingly large amount and can easily double or even treble your file size. However I doubt it accounts for the difference in your volume and the data you link to above.
  2. Reduce the volume of actual data either by reducing your coordinate precision (e.g. 6 decimal places vs say 12) and/or reducing the actual number of vertices representing the features in your data. I suspect that this accounts for a substantial proportion of the difference in file sizes you are seeing. Much depends on your use-case for how much simplification will be acceptable and only you can decide that.
share|improve this answer
    
Yes I've read about it here - blog.thematicmapping.org/2012/11/… –  nickves Nov 29 '12 at 14:31

Removing properties and simplifying lines are the easiest ways if you want just GeoJSON, TopoJson an modified version of GeoJson and can get some very small sized files especially if you keep it projected

share|improve this answer

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.