Skip to content

Commit c57a4b5

Browse files
committed
Add java example into the examples project
1 parent 0b3a335 commit c57a4b5

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

examples/pdal-jni/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# PDAL JNI usage example
22

33
To run this demo just launch `./sbt run` command and choose `1`
4-
to run a basic `pdal-core` example, choose `2` to run as basic `pdal-scala` example.
4+
to run a basic `pdal-core` example, choose `2` to run a basic `pdal-core` example in Java, and choose `3` to run as basic `pdal-scala` example.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.azavea;
2+
3+
import io.pdal.LogLevel;
4+
import io.pdal.Pipeline;
5+
6+
class MainJava {
7+
// to check laz "filename":"data/autzen_trim.laz"
8+
static String json = "{\"pipeline\":[{\"filename\":\"data/1.2-with-color.las\",\"spatialreference\":\"EPSG:2993\"},{\"type\":\"filters.reprojection\",\"out_srs\":\"EPSG:3857\"}]}";
9+
10+
public static void main(String[] args) {
11+
// can be replaced via io.pdal.Pipeline$.MODULE$.apply(json, LogLevel.Error());
12+
// which incapsulates initialize() call
13+
var pipeline = new Pipeline(json, LogLevel.Error());
14+
pipeline.initialize();
15+
pipeline.execute();
16+
System.out.println("pipeline.getMetadata():" + pipeline.getMetadata());
17+
pipeline.close();
18+
}
19+
}

0 commit comments

Comments
 (0)