-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Layer Delimited Text with coordinates in DMS does not work with ' and " #57480
Comments
The issue is not actually related to the parsing of the DMS coordinates, but to the parsing of the provided CSV file. It looks like the provided CSV file doesn't strictly adhere to the RFC-4180 https://www.ietf.org/rfc/rfc4180.txt "Common Format and MIME Type for Comma-Separated Values (CSV) Files" due to the presence of a double quote The RFC-4180 states that:
Thus, e.g. the field value Using the You can avoid the issue and allow to import such non standard CSV file, e.g. just selecting "File Format"->"Custom delimiters", set the "Comma" as delimiter and remove the "Quote" character. Anyway, since the OGR provider can import the same file as a table without errors (just dragging and dropping it in QGIS or using "Add Vector Layer"), I think there is room for improving the CSV parser of the As a side note, it seems to me that actually the provided CSV file cannot be correctly parsed by cs2cs PROJ utility. |
Hi @agiudiceandrea , you are right, it cannot work with a wrong CSV. I have created a TSV, with two rows without field name
And I'm not able to use it in the add layer wizard, values are read as strings I gave the example of TSV, because it is the default one in cs2cs:
And I confirm that it works, and it returns me this
Probably QGIS wizard reads only prime and double prime. |
@aborruso, you need to specify the "X field" and "Y field" parameters. Video_2024-05-19_081908.mp4 |
Now I'm not at the PC, but it doesn't seem to work . I will try again in the next few hours. Thank you |
You are right, I don't have to write messages on Sunday morning as soon as I wake up
@pigreco using your CSV with these settings you have it in the map view, without changing anything in the input I don't know what could be improved in the documentation. Here you need to pay attention to the CSV parameters, because it is not standard, and then - since these are DMS - set the DMS check. What integration do you propose? |
Thank you for the quick response and the technical details. I noticed that the CSV file I shared reads correctly using the 2024-05-19_10h12_03.mp4I verified that the CSV file must use the the expressions |
You don't have to use |
If I hadn't opened this issue, where could I have read the solutions proposed above? |
I, too, often realize something I hadn't noticed, only after comparing others. Here, if you don't realize you have a wrong file, you may think there is something wrong with the software or in the documentation. |
So, good to close? |
What is the bug or the crash?
I have this CSV file with long and lat coordinates expressed in DMS (
7°26'20.5"E, 45°8'41.3"N
), but by importing the file with Add delimited text layer, nothing is loaded, the writing '107 record' appears incorrectly formatted discarded from sample data'.Where can I find documentation on how to properly format coordinates in DMS?
the same file is read correctly by cs2cs
Steps to reproduce the issue
Versions
OSGeo4W 64 b Win 11 PRO
Versione di QGIS 3.34.6-Prizren
Revisione codice QGIS 623828f
Versione Qt 5.15.13
Versione Python 3.12.3
Versione GDAL/OGR 3.8.5
Versione PROJ 9.4.0
Versione database del Registro EPSG v11.004 (2024-02-24)
Versione GEOS 3.12.1-CAPI-1.18.1
Versione SQLite 3.45.1
Versione PDAL 2.6.3
Versione client PostgreSQL 16.2
Versione SpatiaLite 5.1.0
Versione QWT 6.2.0
Versione QScintilla2 2.14.1
Versione SO Windows 11 Version 2009
Plugins Python attivi DataPlotly 4.1.0
eurostat_downloader 0.2.1
felt 2.0.1
kmltools 3.1.33
mapswipetool_plugin 1.2
nominatim_locator_filter 0.3.2
quick_map_services 0.19.34
valuetool 3.0.19
db_manager 0.1.20
grassprovider 2.12.99
MetaSearch 0.3.6
processing 2.12.99
Supported QGIS version
New profile
Additional context
CSV files:
inputddmmsstastiera.csv
The text was updated successfully, but these errors were encountered: