I'm relatively new to OGR and GIS in general. Most of the sources I look at give a choice of ESRI shapefile and MapInfo formats. I'm using ogr2ogr to convert these to GeoJSON for import into JSON-based databases. Can any experienced OGR users tell me if there is any advantage in the choice of a source format here? I'm more interested in preserving the integrity of the data than speed, etc.


4 Answers 4


ESRI Shapefiles are more widely used, but have some limitations, including that the attribute names are limited in length. Shapefiles can be edited by the wonderful QGIS.

MapInfo files are less widely used, and have a limitation with respect to something called bounds, where the X, Y coordinates are stored as an integer between two doubles. This limits the precision of MapInfo tables to 1 mm, which may not be an issue, but it does ruin topology sometimes. MapInfo TAB files can't be edited in the wonderful QGIS.

I haven't noticed the 'codepage-awareness' that Uffe mentions. I'd go for Shapefile, but practically it will make very little difference for most uses.

  • Note that QGIS can now edit MapInfo TAB files. So long as you manage bounds, i.e., precision, TAB files do have some advantages.
    – Alex Leith
    Mar 16, 2016 at 23:47

TAB files are almost always more compact than SHP, have better "codepage-awareness" and the DAT part allows more specialized field types, that maps better to the database, where the data is coming from (assuming it isn't TAB or SHP).

But SHP files are more "standard" and open, so if you run into issues, it may be easier to deal with them, if you have SHP.

  • Could you please expand on "codepage-awareness" of TAB files? This is the first time I have heard of this phrase, and which to know more. Apr 23, 2013 at 4:43
  • 1
    TAB were born with codepage being part of the file specification. SHP files uses DBF, which didn't have it originally and ESRI made up their own system with the CPG file, but you can't be sure that all software detects the CPG file. Others may read the byte in the DBF header specifying the codepage, which is actually in another system with numbers from 1 to 255. Then some put UTF-8 in the DBF which is technically possible, but also highly non-standard. Apr 23, 2013 at 8:33
  • 1
    Thanks. After more reading, I found this question which might be of help to others who haven't heard of this: gis.stackexchange.com/questions/3529 Apr 23, 2013 at 9:00

AFAIK GeoJSON will give you very easy and pretty fast import/export ways of dealing with your data sets. I use it all the time with postgis and web mapping. Especially for web mapping, this format is easy to work with.


GML formats are good enough to be converted to GeoJSON. GML is another form of xml which is a document interchange format and Javscript Object Notion(JSON) is a data interchange format. The good thing is both can be opened in a text editor and can be saved in databases. ShapeFiles have some limitation for the length of fields and attribute values. But remember OGR provides an abstraction on the different kinds of data formats. The data loss sometimes happens with attributes only(eg: shapefiles). It also depends on the software you use to import the data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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