Skip to content

Commit 5acec9e

Browse files
authored
Remove pipeline.validate() method (#86)
1 parent 9b43198 commit 5acec9e

File tree

14 files changed

+187
-85
lines changed

14 files changed

+187
-85
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
os: [ubuntu-latest, macos-latest]
1717
java: [8]
1818
distribution: [temurin]
19-
pdal: [2.6.2]
19+
pdal: [2.6.3]
2020
runs-on: ${{ matrix.os }}
2121
defaults:
2222
run:
@@ -79,7 +79,7 @@ jobs:
7979
os: [ubuntu-latest]
8080
java: [8]
8181
distribution: [temurin]
82-
pdal: [2.6.2]
82+
pdal: [2.6.3]
8383
runs-on: ${{ matrix.os }}
8484
if: github.event_name != 'pull_request'
8585
needs: [build]

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = 3.7.17
1+
version = 3.8.0
22
runner.dialect = scala3
33
align.openParenCallSite = true
44
align.openParenDefnSite = true

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@ val json =
9797
""".stripMargin
9898

9999
val pipeline = Pipeline(json, LogLevel.Debug5) // initialize and make it really noisy
100-
pipeline.validate() // check if our JSON and options were good
100+
101101
pipeline.execute() // execute the pipeline
102+
102103
val metadata = pipeline.getMetadata() // retrieve metadata
103104
val pvs = pipeline.getPointViews() // iterator over PointViews
104105
val pv = pvs.next() // let's take the first PointView

build.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name := "pdal-jni"
22

3-
val scala212 = "2.12.18"
4-
val scala213 = "2.13.12"
5-
val scala3 = "3.3.1"
3+
val scala212 = "2.12.19"
4+
val scala213 = "2.13.13"
5+
val scala3 = "3.4.0"
66
val scalaVersions = Seq(scala3, scala213, scala212)
77

88
lazy val commonSettings = Seq(

core-scala/src/test/scala/io/pdal/pipeline/PipelineExpressionsSpec.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ class PipelineExpressionsSpec extends AnyFunSpec with Matchers with BeforeAndAft
9696
FilterReprojection(outSrs = "EPSG:3857")
9797

9898
val pipeline = expression.toPipeline
99-
pipeline.validate() shouldBe true
10099
pipeline.execute()
101100
pipeline.close()
102101
}

core/src/main/scala/io/pdal/Pipeline.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class Pipeline private (val json: String, val logLevel: Int) extends Native {
4040
@native def getMetadata(): String
4141
@native def getSchema(): String
4242
@native def getQuickInfo(): String
43-
@native def validate(): Boolean
4443
@native private def getLogLevelInt(): Int
4544

4645
def getLogLevel(): LogLevel.Value = LogLevel.apply(getLogLevelInt())

core/src/test/resources/metadata.json

Lines changed: 172 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,176 @@
11
{
22
"metadata": {
3-
"readers.las": [
4-
{
5-
"compressed": false,
6-
"copc": false,
7-
"count": 1065,
8-
"creation_doy": 0,
9-
"creation_year": 0,
10-
"dataformat_id": 3,
11-
"dataoffset": 229,
12-
"filesource_id": 0,
13-
"global_encoding": 0,
14-
"global_encoding_base64": "AAA=",
15-
"header_size": 227,
16-
"major_version": 1,
17-
"maxx": 638982.55,
18-
"maxy": 853535.43,
19-
"maxz": 586.38,
20-
"minor_version": 2,
21-
"minx": 635619.85,
22-
"miny": 848899.7,
23-
"minz": 406.59,
24-
"offset_x": 0,
25-
"offset_y": 0,
26-
"offset_z": 0,
27-
"point_length": 34,
28-
"project_id": "00000000-0000-0000-0000-000000000000",
29-
"scale_x": 0.01,
30-
"scale_y": 0.01,
31-
"scale_z": 0.01,
32-
"software_id": "TerraScan",
33-
"system_id": ""
34-
}
35-
]
3+
"readers.las": {
4+
"comp_spatialreference": "PROJCS[\"NAD83(HARN) / Oregon LCC (m)\",GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Reference_Network\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"latitude_of_origin\",41.75],PARAMETER[\"central_meridian\",-120.5],PARAMETER[\"standard_parallel_1\",43],PARAMETER[\"standard_parallel_2\",45.5],PARAMETER[\"false_easting\",400000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"2993\"]]",
5+
"compressed": false,
6+
"copc": false,
7+
"count": 1065,
8+
"creation_doy": 0,
9+
"creation_year": 0,
10+
"dataformat_id": 3,
11+
"dataoffset": 229,
12+
"filesource_id": 0,
13+
"global_encoding": 0,
14+
"global_encoding_base64": "AAA=",
15+
"header_size": 227,
16+
"major_version": 1,
17+
"maxx": 638982.55,
18+
"maxy": 853535.43,
19+
"maxz": 586.38,
20+
"minor_version": 2,
21+
"minx": 635619.85,
22+
"miny": 848899.7,
23+
"minz": 406.59,
24+
"offset_x": 0,
25+
"offset_y": 0,
26+
"offset_z": 0,
27+
"point_length": 34,
28+
"project_id": "00000000-0000-0000-0000-000000000000",
29+
"scale_x": 0.01,
30+
"scale_y": 0.01,
31+
"scale_z": 0.01,
32+
"software_id": "TerraScan",
33+
"spatialreference": "PROJCS[\"NAD83(HARN) / Oregon LCC (m)\",GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Reference_Network\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"latitude_of_origin\",41.75],PARAMETER[\"central_meridian\",-120.5],PARAMETER[\"standard_parallel_1\",43],PARAMETER[\"standard_parallel_2\",45.5],PARAMETER[\"false_easting\",400000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"2993\"]]",
34+
"srs": {
35+
"compoundwkt": "PROJCS[\"NAD83(HARN) / Oregon LCC (m)\",GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Reference_Network\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"latitude_of_origin\",41.75],PARAMETER[\"central_meridian\",-120.5],PARAMETER[\"standard_parallel_1\",43],PARAMETER[\"standard_parallel_2\",45.5],PARAMETER[\"false_easting\",400000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"2993\"]]",
36+
"horizontal": "PROJCS[\"NAD83(HARN) / Oregon LCC (m)\",GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Reference_Network\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"latitude_of_origin\",41.75],PARAMETER[\"central_meridian\",-120.5],PARAMETER[\"standard_parallel_1\",43],PARAMETER[\"standard_parallel_2\",45.5],PARAMETER[\"false_easting\",400000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"2993\"]]",
37+
"isgeocentric": false,
38+
"isgeographic": false,
39+
"json": {
40+
"type": "ProjectedCRS",
41+
"name": "NAD83(HARN) / Oregon LCC (m)",
42+
"base_crs": {
43+
"name": "NAD83(HARN)",
44+
"datum": {
45+
"type": "GeodeticReferenceFrame",
46+
"name": "NAD83 (High Accuracy Reference Network)",
47+
"ellipsoid": {
48+
"name": "GRS 1980",
49+
"semi_major_axis": 6378137,
50+
"inverse_flattening": 298.257222101
51+
}
52+
},
53+
"coordinate_system": {
54+
"subtype": "ellipsoidal",
55+
"axis": [
56+
{
57+
"name": "Geodetic latitude",
58+
"abbreviation": "Lat",
59+
"direction": "north",
60+
"unit": "degree"
61+
},
62+
{
63+
"name": "Geodetic longitude",
64+
"abbreviation": "Lon",
65+
"direction": "east",
66+
"unit": "degree"
67+
}
68+
]
69+
},
70+
"id": {
71+
"authority": "EPSG",
72+
"code": 4152
73+
}
74+
},
75+
"conversion": {
76+
"name": "unnamed",
77+
"method": {
78+
"name": "Lambert Conic Conformal (2SP)",
79+
"id": {
80+
"authority": "EPSG",
81+
"code": 9802
82+
}
83+
},
84+
"parameters": [
85+
{
86+
"name": "Latitude of false origin",
87+
"value": 41.75,
88+
"unit": "degree",
89+
"id": {
90+
"authority": "EPSG",
91+
"code": 8821
92+
}
93+
},
94+
{
95+
"name": "Longitude of false origin",
96+
"value": -120.5,
97+
"unit": "degree",
98+
"id": {
99+
"authority": "EPSG",
100+
"code": 8822
101+
}
102+
},
103+
{
104+
"name": "Latitude of 1st standard parallel",
105+
"value": 43,
106+
"unit": "degree",
107+
"id": {
108+
"authority": "EPSG",
109+
"code": 8823
110+
}
111+
},
112+
{
113+
"name": "Latitude of 2nd standard parallel",
114+
"value": 45.5,
115+
"unit": "degree",
116+
"id": {
117+
"authority": "EPSG",
118+
"code": 8824
119+
}
120+
},
121+
{
122+
"name": "Easting at false origin",
123+
"value": 400000,
124+
"unit": "metre",
125+
"id": {
126+
"authority": "EPSG",
127+
"code": 8826
128+
}
129+
},
130+
{
131+
"name": "Northing at false origin",
132+
"value": 0,
133+
"unit": "metre",
134+
"id": {
135+
"authority": "EPSG",
136+
"code": 8827
137+
}
138+
}
139+
]
140+
},
141+
"coordinate_system": {
142+
"subtype": "Cartesian",
143+
"axis": [
144+
{
145+
"name": "Easting",
146+
"abbreviation": "",
147+
"direction": "east",
148+
"unit": "metre"
149+
},
150+
{
151+
"name": "Northing",
152+
"abbreviation": "",
153+
"direction": "north",
154+
"unit": "metre"
155+
}
156+
]
157+
},
158+
"id": {
159+
"authority": "EPSG",
160+
"code": 2993
161+
}
162+
},
163+
"prettycompoundwkt": "PROJCS[\"NAD83(HARN) / Oregon LCC (m)\",\n GEOGCS[\"NAD83(HARN)\",\n DATUM[\"NAD83_High_Accuracy_Reference_Network\",\n SPHEROID[\"GRS 1980\",6378137,298.257222101,\n AUTHORITY[\"EPSG\",\"7019\"]],\n AUTHORITY[\"EPSG\",\"6152\"]],\n PRIMEM[\"Greenwich\",0,\n AUTHORITY[\"EPSG\",\"8901\"]],\n UNIT[\"degree\",0.0174532925199433,\n AUTHORITY[\"EPSG\",\"9122\"]],\n AUTHORITY[\"EPSG\",\"4152\"]],\n PROJECTION[\"Lambert_Conformal_Conic_2SP\"],\n PARAMETER[\"latitude_of_origin\",41.75],\n PARAMETER[\"central_meridian\",-120.5],\n PARAMETER[\"standard_parallel_1\",43],\n PARAMETER[\"standard_parallel_2\",45.5],\n PARAMETER[\"false_easting\",400000],\n PARAMETER[\"false_northing\",0],\n UNIT[\"metre\",1,\n AUTHORITY[\"EPSG\",\"9001\"]],\n AXIS[\"Easting\",EAST],\n AXIS[\"Northing\",NORTH],\n AUTHORITY[\"EPSG\",\"2993\"]]",
164+
"prettywkt": "PROJCS[\"NAD83(HARN) / Oregon LCC (m)\",\n GEOGCS[\"NAD83(HARN)\",\n DATUM[\"NAD83_High_Accuracy_Reference_Network\",\n SPHEROID[\"GRS 1980\",6378137,298.257222101,\n AUTHORITY[\"EPSG\",\"7019\"]],\n AUTHORITY[\"EPSG\",\"6152\"]],\n PRIMEM[\"Greenwich\",0,\n AUTHORITY[\"EPSG\",\"8901\"]],\n UNIT[\"degree\",0.0174532925199433,\n AUTHORITY[\"EPSG\",\"9122\"]],\n AUTHORITY[\"EPSG\",\"4152\"]],\n PROJECTION[\"Lambert_Conformal_Conic_2SP\"],\n PARAMETER[\"latitude_of_origin\",41.75],\n PARAMETER[\"central_meridian\",-120.5],\n PARAMETER[\"standard_parallel_1\",43],\n PARAMETER[\"standard_parallel_2\",45.5],\n PARAMETER[\"false_easting\",400000],\n PARAMETER[\"false_northing\",0],\n UNIT[\"metre\",1,\n AUTHORITY[\"EPSG\",\"9001\"]],\n AXIS[\"Easting\",EAST],\n AXIS[\"Northing\",NORTH],\n AUTHORITY[\"EPSG\",\"2993\"]]",
165+
"proj4": "+proj=lcc +lat_0=41.75 +lon_0=-120.5 +lat_1=43 +lat_2=45.5 +x_0=400000 +y_0=0 +ellps=GRS80 +units=m +no_defs",
166+
"units": {
167+
"horizontal": "metre",
168+
"vertical": ""
169+
},
170+
"vertical": "",
171+
"wkt": "PROJCS[\"NAD83(HARN) / Oregon LCC (m)\",GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Reference_Network\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"latitude_of_origin\",41.75],PARAMETER[\"central_meridian\",-120.5],PARAMETER[\"standard_parallel_1\",43],PARAMETER[\"standard_parallel_2\",45.5],PARAMETER[\"false_easting\",400000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"2993\"]]"
172+
},
173+
"system_id": ""
174+
}
36175
}
37176
}

core/src/test/scala/io/pdal/PipelineSpec.scala

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,16 @@ import scala.collection.JavaConverters._
3131

3232
class PipelineSpec extends TestEnvironmentSpec {
3333
describe("Pipeline execution") {
34-
it("should validate as incorrect json (bad json passed)") {
34+
it("should throw ExecutionException when bad pipeline json passed into the constructor") {
3535
val badPipeline = Pipeline(badJson)
36-
badPipeline.validate() should be(false)
36+
val exception = intercept[ExecutionException](badPipeline.execute())
37+
exception.getMessage should include(
38+
"Unable to open stream for 'nofile.las' with error 'No such file or directory'"
39+
)
3740
badPipeline.close()
3841
badPipeline.ptr() should be(0)
3942
}
4043

41-
it("should validate json") {
42-
pipeline.validate() should be(true)
43-
}
44-
4544
it("should execute pipeline") {
4645
pipeline.execute()
4746
}
@@ -203,7 +202,6 @@ class PipelineSpec extends TestEnvironmentSpec {
203202
}
204203

205204
it("should extract mesh in iterative fashion") {
206-
pipelineDelaunay.validate() should be(true)
207205
pipelineDelaunay.execute()
208206
val pvi = pipelineDelaunay.getPointViews()
209207
val pv = pvi.next()

native/src/JavaPipeline.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,6 @@ PipelineExecutor::PipelineExecutor(string const& json, int level)
6767
m_manager.readPipeline(strm);
6868
}
6969

70-
bool PipelineExecutor::validate()
71-
{
72-
m_manager.prepare();
73-
74-
return true;
75-
}
76-
7770
point_count_t PipelineExecutor::execute()
7871
{
7972

native/src/include/JavaPipeline.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ class PDAL_DLL PipelineExecutor {
6262
PipelineExecutor(std::string const& json, int level);
6363
virtual ~PipelineExecutor() = default;
6464

65-
bool validate();
6665
point_count_t execute();
6766
point_count_t executeStream(point_count_t streamLimit);
6867

0 commit comments

Comments
 (0)