I am trying to create a "perfect" shapefile from the Excel data. "Perfect" means that it should match several factors: proper encoding and original data type.
Excel file basically contains information about point objects and includes five attributes with required types.
Attribute | Type | Description -------------------------------------------------------------------------------- FFA_NR | integer | Object serial number FFA_TXT | text | Object serial number but with leading zeros Name | text | Object name X | real | X-coordinate in Gauß-Krüger CS Y | real | Y-coordinate in Gauß-Krüger CS
X,Y-tuple is based on DHDN / 3-degree Gauß-Krüger zone 5 EPSG:31469
Data sample looks as following (demonstrated in the image below).
My workflow (similar to this Importing Spreadsheets or CSV files.) so far is
- In Excel,
Data > Save As...
- I am trying with
- In QGIS everything visualized nicely in the sense that it is placed correctly. I have done it with several approaches,
Layer > Add Layer > Add spreadsheet layerand
Add Delimited Text Data
- Afterwards, in QGIS, I am saving the opened point layer as a shapefile with
Save vector layer as...
- Then in the Attribute table, I do have several issues with data encoding and data type
1. Data Type
When I import Excel data into QGIS I am partially losing my initial data types. For instance, instead of the desired
035, I do have
35. Obviously, it is about the import data type.
I have seen similar questions on this topic.
- Changing CSV layer attribute value from text to number in QGIS?
- How to keep leading zeros in csv file when working with QGIS
- Keeping leading zeroes in QGIS in big files
- How to format labels with leading zeroes?
- Joining .csv file to a layer in QGIS [closed]
- How to Specify Data Types of CSV Columns for Use in QGIS
However, I can not understand how to create the file with
.csvt extension. What is the workflow? How to create it and where it should be stored?
Of course, in Attribute table I can create a new column, appropriated with a text type, and then proceed with a Filed Calculator, using for instance
lpad("FAA_Nr", 3, '0').
I am working with German text, that contains letters like
ä, ö, ü, ß. When in QGIS, I apply any of the encoding formats (System, UTF-8, ISO-8859-1, ISO-8859-15), none of my specific characters can be visualized.
Check the following graphics for UTF-8 and ISO-8859-15 accordingly.
I have found related topics,
- Exporting from Excel to csv and import in QGIS retaining encoding/special characters with workaround?
- Converting Hebrew Excel file into Shapefile in QGIS
However, I did not discover anything spectacular in the context of my issue. I am guessing that the problem is more with the Excel rather then QGIS, is not it?
Or maybe I apply the encode formatting on a wrong step. When should it be done?
Target: optimizing the efforts required for the data input in QGIS.