Dear Totò,

thank you very much. This solves my problem. Explicitly defining datatypes that 
are allowed in a geopackage and formatting the date and time values in the 
csv-file accordingly leads to the required result.

Best regards
Michael

Von: Totò Fiandaca <pigrecoinfin...@gmail.com>
Gesendet: Mittwoch, 20. November 2024 17:18
An: Reetz, Michael (NLPVW) <michael.re...@nlpvw.niedersachsen.de>
Cc: qgis-user@lists.osgeo.org
Betreff: Re: [Qgis-user] Export from csv layer to geopackage changes date and 
time attributes to string


ACHTUNG!! Diese E-Mail erreicht Sie von einem Absender außerhalb der 
niedersächsischen Landesverwaltungs-Infrastruktur mit TLS-Verschlüsselung. 
Bitte klicken Sie auf keine Links oder öffnen Sie keine E-Mail-Anhänge, falls 
Sie den Absender nicht kennen und nicht wissen, ob der Inhalt sicher ist.

Try to create the auxiliary file of the csv file, that is, the file with the 
same name as the csv file, but with the extension csvt.
The csvt file has only one line and contains the data type.

https://anitagraser.com/2011/03/07/how-to-specify-data-types-of-csv-columns-for-use-in-qgis/

saluti

Il giorno mer 20 nov 2024 alle ore 17:02 Reetz, Michael (NLPVW) via QGIS-User 
<qgis-user@lists.osgeo.org<mailto:qgis-user@lists.osgeo.org>> ha scritto:
Dear all,

I have added a csv file as layer to my project. Date and time columns are 
identified correctly. Now I’m trying to export the layer into a geopackage. The 
date and time attributes are all changed into strings although date and 
datetime are possible in a geopackage (as far as I know). Any idea why this 
happens and how to work around this?

Best regards
Michael



*****************************************
Michael Reetz
Datenbanken und Anwendungsentwicklung
Nationalpark-Verwaltung Niedersächsisches Wattenmeer
Virchowstr. 1 | 26382 Wilhelmshaven
Tel.: +49 (0) 4421 911 291
e-mail: 
michael.re...@nlpvw.niedersachsen.de<mailto:michael.re...@nlpv-wattenmeer.niedersachsen.de>
Web: 
https://www.<https://www./>nationalpark-wattenmeer.de<http://nationalpark-wattenmeer.de>
[cid:image001.png@01DB3BEA.D1E3B9B0]


_______________________________________________
QGIS-User mailing list
QGIS-User@lists.osgeo.org<mailto:QGIS-User@lists.osgeo.org>
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


--
Ing. Salvatore Fiandaca
mobile.:+39 327.493.8955
m: pigrecoinfin...@gmail.com<mailto:pigrecoinfin...@gmail.com>
C.F.: FNDSVT71E29Z103G
P.IVA: 06597870820
membro QGIS Italia - http://qgis.it/
socio GFOSS.it - http://gfoss.it/
member OSGeo - https://www.osgeo.org/member/fiandaca/
blog: https://pigrecoinfinito.com/<https://pigrecoinfinito.com/>
FB: Co-admin - https://www.facebook.com/qgis.it/ 
<https://www.facebook.com/qgis.it/>
TW: <http://goog_95411464> https://twitter.com/totofiandaca

37°35'11.4"N 14°10'25.1"E - EPSG:4326

“Se la conoscenza deve essere aperta a tutti,
perchè mai limitarne l’accesso?”
R. Stallman

Questo documento, allegati inclusi, contiene informazioni di proprietà di 
FIANDACA SALVATORE e deve essere utilizzato esclusivamente dal destinatario in 
relazione alle finalità per le quali è stato ricevuto. E' vietata qualsiasi 
forma di riproduzione o divulgazione senza l'esplicito consenso di FIANDACA 
SALVATORE. Qualora fosse stato ricevuto per errore si prega di informare 
tempestivamente il mittente e distruggere la copia in proprio possesso.


_______________________________________________
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to