Skip to content

Commit

Permalink
Add java example into the examples project
Browse files Browse the repository at this point in the history
  • Loading branch information
pomadchin committed Nov 3, 2023
1 parent 0b3a335 commit c57a4b5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/pdal-jni/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PDAL JNI usage example

To run this demo just launch `./sbt run` command and choose `1`
to run a basic `pdal-core` example, choose `2` to run as basic `pdal-scala` example.
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.
19 changes: 19 additions & 0 deletions examples/pdal-jni/src/main/java/com/azavea/MainJava.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.azavea;

import io.pdal.LogLevel;
import io.pdal.Pipeline;

class MainJava {
// to check laz "filename":"data/autzen_trim.laz"
static String json = "{\"pipeline\":[{\"filename\":\"data/1.2-with-color.las\",\"spatialreference\":\"EPSG:2993\"},{\"type\":\"filters.reprojection\",\"out_srs\":\"EPSG:3857\"}]}";

public static void main(String[] args) {
// can be replaced via io.pdal.Pipeline$.MODULE$.apply(json, LogLevel.Error());
// which incapsulates initialize() call
var pipeline = new Pipeline(json, LogLevel.Error());
pipeline.initialize();
pipeline.execute();
System.out.println("pipeline.getMetadata():" + pipeline.getMetadata());
pipeline.close();
}
}

0 comments on commit c57a4b5

Please sign in to comment.