[GRASS-user] Error importing 3d csv in grass
Helmut Kudrnovsky
hellik at web.de
Wed May 11 11:32:14 PDT 2022
[always include the mailing list!]
Vajont_Export.csv:
num,x,y,z,res,cond,ip,sen,sen_vol
1,1015611.625,1048406.75,2664.856,4.026,0.248397,1.395,3.4428,0.2129
2,1015613.5,1048406.75,2664.668,4.315,0.231769,0.9846,12.586,6.983
v.in.ascii -z input=D:\temp\Vajont_Export.csv output=Vajont_Export separator=comma skip=1 x=2 y=3 z=4 cat=1
Scanne die Eingabe zur Ermittelung der Spaltentypen...
Number of columns: 9
Number of data rows: 448
Standard Treiber / Datenbank ist:
Treiber: sqlite
Datenbank: $GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db
Importiere Punkte...
Fülle Tabelle...
Erstelle Topologie für die Vektorkarte <Vajont_Export at vinascii>...
Registriere Primitive...
v.report map=Vajont_Export at vinascii option=coor
int_1|dbl_1|dbl_2|dbl_3|dbl_4|dbl_5|dbl_6|dbl_7|dbl_8|x|y|z
1|1015611.625|1048406.75|2664.856|4.026|0.248397|1.395|3.4428|0.2129|1015611.625|1048406.75|2664.856
2|1015613.5|1048406.75|2664.668|4.315|0.231769|0.9846|12.586|6.983|1015613.5|1048406.75|2664.668
3|1015615.5|1048406.75|2664.575|0.869|1.1501|1.498|16.567|9.0172|1015615.5|1048406.75|2664.575
4|1015617.375|1048406.75|2664.817|5.579|0.179251|21.05|7.4337|4.0941|1015617.375|1048406.75|2664.817
5|1015619.375|1048406.75|2665.524|10.582|0.094502|23.16|1.4138|0.7497|1015619.375|1048406.75|2665.524
###############
Vajont_Export_res.csv:
x,y,z,res
1015611.625,1048406.75,2664.856,4.026
1015613.5,1048406.75,2664.668,4.315
v.in.ascii -z input=D:\temp\Vajont_Export_res.csv output=Vajont_Export_res separator=comma skip=1 z=3
Scanne die Eingabe zur Ermittelung der Spaltentypen...
Number of columns: 4
Number of data rows: 448
Importiere Punkte...
Fülle Tabelle...
Erstelle Topologie für die Vektorkarte <Vajont_Export_res at vinascii>...
Registriere Primitive...
v.report map=Vajont_Export_res at vinascii option=coor
cat|dbl_1|dbl_2|dbl_3|dbl_4|x|y|z
1|1015611.625|1048406.75|2664.856|4.026|1015611.625|1048406.75|2664.856
2|1015613.5|1048406.75|2664.668|4.315|1015613.5|1048406.75|2664.668
3|1015615.5|1048406.75|2664.575|0.869|1015615.5|1048406.75|2664.575
4|1015617.375|1048406.75|2664.817|5.579|1015617.375|1048406.75|2664.817
5|1015619.375|1048406.75|2665.524|10.582|1015619.375|1048406.75|2665.524
##############
Vajont_Export_res_integer.csv:
num,x,y,z,res
1,1015612,1048407,2665,4
3,1015616,1048407,2665,1
v.in.ascii -z input=D:\temp\Vajont_Export_res_integer.csv output=Vajont_Export_res_integer2 separator=comma skip=1 x=2 y=3 z=4 cat=1
Scanne die Eingabe zur Ermittelung der Spaltentypen...
Number of columns: 5
Number of data rows: 82
Importiere Punkte...
Fülle Tabelle...
Erstelle Topologie für die Vektorkarte <Vajont_Export_res_integer2 at vinascii>...
Registriere Primitive...
v.report map=Vajont_Export_res_integer2 at vinascii option=coor
int_1|int_2|int_3|int_4|int_5|x|y|z
1|1015612|1048407|2665|4|1015612|1048407|2665
3|1015616|1048407|2665|1|1015616|1048407|2665
4|1015617|1048407|2665|6|1015617|1048407|2665
5|1015619|1048407|2666|11|1015619|1048407|2666
##############
all 3 shared csv files are imported correctly here. integers are reckognized as integers and doubles are reckognized as doubles.
tested with
GRASS Version: 8.0.1
Code revision: exported
Build date: 2022-05-10
Build platform: x86_64-w64-mingw32
GDAL: 3.4.3
PROJ: 9.0.0
GEOS: 3.10.2
SQLite: 3.38.1
Python: 3.9.5
wxPython: 4.1.1
Platform: Windows-10-10.0.19044-SP0 (OSGeo4W)
which GRASS version are you using?
kind regards
Helmut
--------------------------------------------------
Gesendet: Sonntag, 08. Mai 2022 um 12:19 Uhr
Von: "Enrique Torres Moya"
Betreff: Re: Error importing 3d csv in grass
Helmut good day, thanks for your interest, I am sharing the full dataset, and also the data where I deleted the duplicate values, so you can see the problem.
I would like any opinion, because I want to use grass in my compañy, but I need some solution.
Vajont_Export_Res.csv
Thanks a lot
Best regards
Atentamente,
Enrique Torres Moya
Cel: 3102495375
El dom, 8 may 2022 a las 1:12, Helmut Kudrnovsky (<hellik at web.de[mailto:hellik at web.de]>) escribió:>v.in.ascii --overwrite
>input=/home/etorresm/Desktop/Vajont_Export_res_integer.csv
>output=voxel_res_int separator=comma skip=1 x=2 y=3 z=4 cat=5
[...]
>UNIQUE constraint failed: voxel_res_int.int_5
>DBMI-SQLite driver error:
>Error in sqlite3_step():
>UNIQUE constraint failed: voxel_res_int.int_5
>ERROR: Unable to insert new record: insert into voxel_res_int values ( 2,
>1015614, 1048407, 2665, 4)
>WARNING: Table <voxel_res_int> linked to vector map <voxel_res_int> does
>not exist
can you share the 10 first lines of the input ascii file?
kind regards
Helmut
More information about the grass-user
mailing list