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 many folders, each with a collection of MapInfo tab files (each folder has the same table names). For each folder I want to merge the tab files into one spatialite DB.

My current method is to use ogr2ogr to convert the tab files into shapefiles, and then use .loadshp to load each one into the DB. This truncates my column names, which is irritating.

Is there a way to avoid the shapefile part of this process? ogr2ogr can convert to spatialite, but I do not know how to go about merging multiple spatialite files.

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

You should be able to go directly from .tab to spatialite using OGR. See the spatialite format page for more details. You also don't have to create multiple dbs and merge them, just 'append' them all together from the start.

share|improve this answer
    
could you give an example of the command? –  Matthew Finlay Aug 18 '11 at 6:47
1  
Hi Matthew. Using the -append flag in ogr2ogr (see gdal.org/ogr2ogr.html), it would look something like: mkdir merged for %f in (*.tab) do ( if not exist merged\merged.sqlite ( ogr2ogr -f "SQLite" merged\merged.sqlite %f) else ( ogr2ogr -f "SQLite" -update -append merged\merged.sqlite %f -nln Merged ) ) - note that I haven't tried this, but it should be pretty close.. –  Darren Cope Aug 18 '11 at 19:21
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.