gxpy -gxdb.create_line_name
Hi All
I have been using a script that imports LiDAR data to a gdb. It has stopped working recently due to a line that creates the line name to write, as follows:
with gxdb.Geosoft_gdb.open(saveFileName) as gdb:
line_name = gxdb.create_line_name(lineName, gxdb.LINE_TYPE_RANDOM, 0)
gdb.write_line(line_name, xyz, channel_names)
lineName is generated from the LiDAR .asc file name as a string (with extension removed).
The problem is that line_name ends up being an empty string and the write_line fails.
No matter what i put in the args for gxdb.create_line, the line_name is always blank.
Any clue why??
Many thanks.
I have been using a script that imports LiDAR data to a gdb. It has stopped working recently due to a line that creates the line name to write, as follows:
with gxdb.Geosoft_gdb.open(saveFileName) as gdb:
line_name = gxdb.create_line_name(lineName, gxdb.LINE_TYPE_RANDOM, 0)
gdb.write_line(line_name, xyz, channel_names)
lineName is generated from the LiDAR .asc file name as a string (with extension removed).
The problem is that line_name ends up being an empty string and the write_line fails.
No matter what i put in the args for gxdb.create_line, the line_name is always blank.
Any clue why??
Many thanks.
0
Best Answer
-
'D1' is a perfectly valid line name. This is basic stuff, so something mysterious is going on.
9.5 was released just last week, but I doubt it is related to the version number. Perhaps installing to make sure all versions are synchronized will fix it.
Sorry about the challenge here...5
Answers
-
@TimNixon I have tried everything I can to get a blank return, but I always get something back. Perhaps put some prints to give me an idea of the what the lineName looks like?
print(lineName) line_name = gxdb.create_line_name(lineName, gxdb.LINE_TYPE_RANDOM, 0) print(line_name)
0 -
Hi Ian, thanks for looking at this.
print(lineName)
returns'1_1'
(I am trying short file names to test)print(line_name)
returns''
(ie. empty string, visible in Spyder's variable explorer).0 -
Tim, sorry works here with 9.5 as "D1_1" is returned. I suspect something else is messed up with your installation, or we are both missing something obvious here.
I suggest you change the line to: line_name = 'D' + lineName
This will move you past this failure and on to the next and maybe that will give us another clue.
Are you using 9.4 or 9.5?0 -
Ian, still getting an error.
GdbException: Invalid line name 'D1'. Use create_line_name() to create a valid name.
I will try to update gxpy and see if that makes a difference.0
This discussion has been closed.