-
Notifications
You must be signed in to change notification settings - Fork 8
Using MapInfo to QGIS style generator.
Here is a quick run though on how to use the MapInfo to QGIS style generator.
Open MapInfo and open the table that you wish to generate the QGIS style for.
Run the following commands in the MapBasic windows, replacing anything in {} with your info
Select {Your value column}, Str$(ObjectInfo(obj,2)) from {Your Table}
Where Str$(ObjectInfo(obj,1)) = "5" Group By {Your value column} Into outputTable
Export "outputTable" Into "{Your output file}.txt" Type "ASCII" Delimiter "|" CharSet "WindowsLatin1"
Follow the instructions below or usage guide to generate QML file.
1: Download the latest version from https://github.com/NathanW2/MapInfo-to-QGIS-style-generator/downloads
2: Extract downloaded zip file anywhere you like.
3: Open OSGeo4W Shell from Start->OSGeo4W->OsGeo4W->OSGeo4W Shell.
4: Change into extracted directory
5: Run python mapinfoToQgis.py {your input file}.txt out.qml -c {your column}
Example
`C:\Temp\NathanW2-MapInfo-to-QGIS-style-generator-f070e6c>python mapinfoToQgis.py
testInput.txt output.qml -c FittingType`
testInput.txt is included with the download as a example of the file format mapinfoToQgis.py uses.
6: Open layer in QGIS and open layer properties.
7: Select Load Style [1] and select output.qml
8: Symbols should match what was used in MapInfo (minus custom MapInfo 3.0 symbols)
A few symbols are missing due to them being custom MapInfo 3.0 Symbols.
The first step of preparing the txt file can be skipped by using the --UseMapInfo switch with mapinfoToQgis.py
Example
python mapinfoToQgis.py my.TAB out.qml -c FittingType --UseMapInfo
Will load MapInfo and generate the needed txt file and pass that to the QML generator, saving you from having to run queries to get the data into the correct format in MapInfo.