7

Is there an easy way to convert MapInfo TAB files into GeoJSON?

I am working on a web-based mapping system which will use GeoJSON to transfer data. I also use MapInfo and would like to be able to convert files from MapInfo into GeoJSON.

I have tried the Universal Translator that comes with MapInfo but it doesn't support GeoJSON.

If there isn't a way to do it I will make a MapInfo plug-in myself (and probably post it online). I just don't want to waste my time making this if there is already one out there.

Update 2012-03-19: You can now export to GeoJSON through QGIS.

3 Answers 3

6

What about just using the command line ogr2ogr, or installing FWTools to access it's pre-configured ogr2ogr command line? The core ogr2ogr appears to support bi-directional conversion from MapInfo to GeoJSON.

Here are a couple of cheat sheets that might help:

ogr_cheatsheet; data loading

2
  • Unless I'm missing a trick, you can't export to GeoJSON from FWTools. ogr2ogr works perfectly. Ideally I would be able to export directly from MapInfo. I might make a MapInfo programme that calls ogr2ogr but until then the command line will do. Thanks!
    – Mr_Chimp
    Jan 21, 2011 at 10:39
  • Correction: Using ogr2ogr via the FWTools command line works perfectly. What doesn't work is doing it via OpenEV_FW (the FWTools GUI).
    – Mr_Chimp
    Jan 21, 2011 at 15:36
2

Here is another tool that runs natively within MapInfo Professional that can also produce GeoJSON files:

http://communitydownloads.pbinsight.com/code-exchange/download/mapinfo2leaflet

It also comes with the source code.

1

The OGR layer converter plugin in QGIS does this. But if you don't want to install QGIS, you could try ogr2gui.

http://www.ogr2gui.ca/en/index.php

It converts MapInfo files to GeoJSON (as well as lots of other formats).

Edit 20/01/2011: Apparently ogr2gui will not convert from MapInfo to GeoJSON. It will convert the other way round though.

3
  • As far as I can see it converts GeoJSON to TAB but not the other way around.
    – Mr_Chimp
    Jan 20, 2011 at 16:35
  • Sorry about that, I thought it would seeing as OGR can. The OGR layer converter does work within QGIS though. I just tried it.
    – James S
    Jan 20, 2011 at 16:47
  • It's strange. OGR supports it but none of the OGR GUIs (FWTools, ) do. I think it might be because GeoJSON is a relatively new format - OGR has implemented it but the GUIs have yet to catch up. You're right that QGIS exports GeoJSON, but loading up a whole other GIS programme is a bit...excessive for my needs. Thanks anyway!
    – Mr_Chimp
    Jan 21, 2011 at 10:43

Your Answer

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

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