5 from __future__
import print_function
13 def DM_read_pointfile(filename):
17 imp = pyDM.Import.create(filename, pyDM.DataFormat.auto)
20 print(
"Unable to create import object for '" + filename +
"'")
24 imp.readHeaderSeparately()
25 header = imp.getHeader()
28 print(
"File {} details:".format(filename))
29 print(
"\tFile format:", str(imp.getFileFormat()))
30 print(
"\tPoint count:", str(header.getPointCount()))
31 print(
"\tCRS :", str(header.getCRS()))
33 if len(header.attributes()) > 0:
34 print(
"\tAttributes:")
35 formatStr =
"\t\t{:<25}{:<10}"
36 print(formatStr.format(
"Name",
"Type"))
37 for attr
in header.attributes():
38 print(formatStr.format(attr.getName(), str(attr.getType())))
42 overallPtCount = header.getPointCount()
47 ptsRead += obj.sizePoint()
50 for i
in range(obj.sizePoint()):
51 if ptsToOutput != -1
and ptsOutput >= ptsToOutput:
55 print(
"\t{0:5d} {1:12.3f} {2:12.3f} {3:10.3f}".format(ptsOutput, pt.x,pt.y,pt.z))
58 if ptsToOutput != -1
and ptsOutput >= ptsToOutput:
68 print(
"filename parameter missing")
71 DM_read_pointfile(sys.argv[1])