TransWikia.com

Read / write MapInfo Tab and convert it to CSV format

Geographic Information Systems Asked by user177357 on March 16, 2021

I am very new in python and trying to read MapInfo (.TAB) file and convert it in to CSV format in following way:

import geopandas as gpd

input_file = 'F:/.../QGIS/sites.tab'

test = gpd.read_file(input_file, driver="MapInfo File")


output_file = 'F:/.../QGIS/new_sites_copy'

test.to_file(output_file, driver = "CSV")

The code creates the CSV file which contains only the header similar to MapInfo Tab file but no other attributes are available in csv file in respect to column heading. Below is the snip of output csv file:

enter image description here

And below is the error that showing after executing the code:

enter image description here

I have installed these modules for this purpose:
numpy, pandas, shapely, gdal, fiona, pyproj, rtree, geopandas

Below are the supported drivers by geopandas (gpd.io.file.fiona.drvsupport.supported_drivers):

{‘AeronavFAA’: ‘r’, ‘ARCGEN’: ‘r’, ‘BNA’: ‘rw’, ‘DXF’: ‘rw’, ‘CSV’: ‘raw’, ‘OpenFileGDB’: ‘r’, ‘ESRIJSON’: ‘r’, ‘ESRI Shapefile’: ‘raw’, ‘FlatGeobuf’: ‘rw’, ‘GeoJSON’: ‘raw’, ‘GeoJSONSeq’: ‘rw’, ‘GPKG’: ‘raw’, ‘GML’: ‘rw’, ‘OGR_GMT’: ‘rw’, ‘GPX’: ‘rw’, ‘GPSTrackMaker’: ‘rw’, ‘Idrisi’: ‘r’, ‘MapInfo File’: ‘raw’, ‘DGN’: ‘raw’, ‘PCIDSK’: ‘rw’, ‘OGR_PDS’: ‘r’, ‘S57’: ‘r’, ‘SEGY’: ‘r’, ‘SUA’: ‘r’, ‘TopoJSON’: ‘r’}

How do I solve this?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP