In the newer versions of QGIS it's possible to export a layer as a Mapinfo Tab file and include the Feature Symbology. Does anyone know if you can access this as part of the 'Save Vector Features To File' algorithm or PyQGIS?
1 Answer
Apply the symbologyExport=QgsVectorFileWriter.FeatureSymbology
parameter when writing and it will keep its symbology when opened in MapInfo.
from os.path import abspath
from qgis.utils import iface
_vlayer = iface.activeLayer()
_writer = QgsVectorFileWriter.writeAsVectorFormat(
layer=_vlayer,
fileName=abspath("D:/test_file.tab"),
fileEncoding="utf-8",
driverName="MapInfo File",
symbologyExport=QgsVectorFileWriter.FeatureSymbology
)
-
-
it doesn't seem to work with points but it does work with polygons. Haven't checked lines yet. That's a pain, as it will read MapInfo point symbology into QGIS– ProsperMay 22 at 7:43
-
I have asked a question about it 2 years ago. It is here: gis.stackexchange.com/questions/388797/…– KVOMay 27 at 12:41
-
is it possible to export a layer from QGIS to MapInfo .MIF format retaining MapInfo symbology by a PyQGIS script? MIF format is human readable and a .MIF file can be edited by simple text editor such as blocknote or Notepad++– KVOOct 16 at 12:59