diff --git a/demo/demo.py b/demo/demo.py deleted file mode 100644 index bce8a1e..0000000 --- a/demo/demo.py +++ /dev/null @@ -1,29 +0,0 @@ -import startinpy -import numpy as np -import json -import laspy - -las = laspy.read("/Users/hugo/data/ahn4/crop.laz") -d = np.vstack((las.x, las.y, las.z, las.classification)).transpose() -d100 = d[::10000] #-- thinning - -dt = startinpy.DT(extra_attributes=True) -for each in d100: - dt.insert_one_pt(each[0], each[1], each[2], classification=each[3]) - -# a = {'intensity': 155.5, 'reflectance': 111, 'hugo': True} -# dt.set_attribute(50, json.dumps(a)) - -# print("# vertices:", dt.number_of_vertices()) -# print("# triangles:", dt.number_of_triangles()) - -print(dt) - -# a = dt.get_attribute(41) -# print("=>", json.loads(a)) - -i = dt.attributes('classification').astype(int) -# print(np.nanmean(i)) -print(i) - -# print("all extra attributes:", dt.list_all_attributes()) \ No newline at end of file diff --git a/demo/demo2.py b/demo/demo2.py deleted file mode 100644 index d7a99fc..0000000 --- a/demo/demo2.py +++ /dev/null @@ -1,28 +0,0 @@ -import startinpy -import numpy as np -import json -import laspy - -las = laspy.read("../data/small.laz") - -#-- read intensity and store it as extra_attribute in the startinpy DT -d = np.vstack((las.x, las.y, las.z, las.intensity)).transpose() - -dt = startinpy.DT(extra_attributes=True) -for each in d: - dt.insert_one_pt(each[0], each[1], each[2], intensity=each[3]) - -a = {'intensity': 155.5, 'reflectance': 111, 'isvisited': True} -dt.set_attribute(50, json.dumps(a)) - -print(dt) - -print("all extra attributes:", dt.list_attributes()) - -a = dt.get_attribute(50) -print("=>", json.loads(a)) -a = dt.get_attribute(49) -print("=>", json.loads(a)) - -i = dt.attributes('intensity') -print(i) \ No newline at end of file diff --git a/demo/demo3.py b/demo/demo3.py deleted file mode 100644 index 268d4e6..0000000 --- a/demo/demo3.py +++ /dev/null @@ -1,35 +0,0 @@ -import startinpy -import numpy as np - -#-- generate 100 points randomly in the plane -rng = np.random.default_rng() -pts = rng.random((100, 3)) -pts = pts * 100 - -dt = startinpy.DT() -dt.insert(pts) - -#-- remove vertex #4 -try: - dt.remove(4) -except Exception as e: - print(e) - -print("# vertices:", dt.number_of_vertices()) -print("# triangles:", dt.number_of_triangles()) - -print("CH: ", dt.convex_hull()) - -print(dt.is_triangle([4, 12, 6]) ) -print(dt.is_triangle([5, 12, 6]) ) - -print("--- /Points ---") -for each in dt.points: - print(each) -print("--- Points/ ---") - -alltr = dt.triangles -print(alltr[3]) - -zhat = dt.interpolate({"method": "TIN"}, [[55.2, 33.1]]) -print("result: ", zhat[0])