We have started using ogr2ogr to upload MapInfo tables into Microsoft SQL server in my workplace. Some of the tables are massive (>1,20,000 records) and there is no way of knowing how far the script has progressed without a status bar.

I was wondering if there is a command that can be used within the ogr2ogr script which actually tells us how much more of the processing is still left/pending (e.g. 50% complete etc.).


You are looking for the -progress switch

ogr2ogr -progress ...

You can see the other options by doing ogr2ogr --help

Usage: ogr2ogr [--help-general] [-skipfailures] [-append] [-update]
               [-select field_list] [-where restricted_where]
               [-progress] [-sql <sql statement>] [-dialect dialect]
               [-preserve_fid] [-fid FID]
               [-spat xmin ymin xmax ymax]
               [-a_srs srs_def] [-t_srs srs_def] [-s_srs srs_def]
               [-f format_name] [-overwrite] [[-dsco NAME=VALUE] ...]
               dst_datasource_name src_datasource_name
               [-lco NAME=VALUE] [-nln name] [-nlt type] [layer [layer ...]]

Advanced options :
               [-gt n]
               [-clipsrc [xmin ymin xmax ymax]|WKT|datasource|spat_extent]
               [-clipsrcsql sql_statement] [-clipsrclayer layer]
               [-clipsrcwhere expression]
               [-clipdst [xmin ymin xmax ymax]|WKT|datasource]
               [-clipdstsql sql_statement] [-clipdstlayer layer]
               [-clipdstwhere expression]
               [[-simplify tolerance] | [-segmentize max_dist]]
               [-fieldTypeToString All|(type1[,type2]*)]
               [-splitlistfields] [-maxsubfields val]
               [-explodecollections] [-zfield field_name]
| improve this answer | |
  • Hi Nathan. Thanks a lot for such a quick response. Really appreciate your help. I'm a complete novice in ogr2ogr. Are you able to provide an example of a typical SQL statement that must go in the SQL argument? What about the dialect? Again, thanks for your help! Cheers, VG – user20637 Aug 2 '13 at 2:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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