From 4e2463a01b9e6f4ba75d8f05810f84db5a105020 Mon Sep 17 00:00:00 2001 From: Grigory Pomadchin Date: Tue, 3 Mar 2020 18:50:19 -0500 Subject: [PATCH 1/2] Bump project version up --- build.sbt | 2 +- scripts/merge-native.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.sbt b/build.sbt index 64ca34a..b7da28b 100644 --- a/build.sbt +++ b/build.sbt @@ -1,7 +1,7 @@ name := "pdal-jni" lazy val commonSettings = Seq( - version := "2.1.3" + Environment.versionSuffix, + version := "2.1.4" + Environment.versionSuffix, scalaVersion := "2.13.1", crossScalaVersions := Seq("2.13.1", "2.12.10", "2.11.12"), organization := "io.pdal", diff --git a/scripts/merge-native.sh b/scripts/merge-native.sh index 166df4a..14a565e 100755 --- a/scripts/merge-native.sh +++ b/scripts/merge-native.sh @@ -17,13 +17,13 @@ done export PDAL_VERSION_SUFFIX=${PDAL_VERSION_SUFFIX-"-SNAPSHOT"} cd ./native/target -rm -f ./pdal-native-2.1.3${PDAL_VERSION_SUFFIX}.jar +rm -f ./pdal-native-2.1.4${PDAL_VERSION_SUFFIX}.jar rm -rf ./tmp; mkdir -p ./tmp -cd tmp; jar -xf ../pdal-native-x86_64-darwin-2.1.3${PDAL_VERSION_SUFFIX}.jar; cd ~- -cd tmp; jar -xf ../pdal-native-x86_64-linux-2.1.3${PDAL_VERSION_SUFFIX}.jar; cd ~- +cd tmp; jar -xf ../pdal-native-x86_64-darwin-2.1.4${PDAL_VERSION_SUFFIX}.jar; cd ~- +cd tmp; jar -xf ../pdal-native-x86_64-linux-2.1.4${PDAL_VERSION_SUFFIX}.jar; cd ~- -jar -cvf pdal-native-2.1.3${PDAL_VERSION_SUFFIX}.jar -C tmp . +jar -cvf pdal-native-2.1.4${PDAL_VERSION_SUFFIX}.jar -C tmp . cd ./tmp From a1cab283066f39d8855bd8744608f0e416981b43 Mon Sep 17 00:00:00 2001 From: Grigory Date: Tue, 3 Mar 2020 21:44:24 -0500 Subject: [PATCH 2/2] Add more Scala syntax (#32) --- CHANGELOG.md | 4 +++ .../scala/io/pdal/pipeline/Implicits.scala | 28 +++++++++++++++++-- examples/pdal-jni/build.sbt | 2 +- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10060c9..ea93257 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.1.4] - 2020-03-03 +### Added +- Add more Scala syntax extensions [#32](https://github.com/PDAL/java/pull/32) + ## [2.1.3] - 2020-03-03 ### Fixed - Fix Scala DSL hierarchy [#31](https://github.com/PDAL/java/issues/31) diff --git a/core-scala/src/main/scala/io/pdal/pipeline/Implicits.scala b/core-scala/src/main/scala/io/pdal/pipeline/Implicits.scala index ebc3617..d14d3c5 100644 --- a/core-scala/src/main/scala/io/pdal/pipeline/Implicits.scala +++ b/core-scala/src/main/scala/io/pdal/pipeline/Implicits.scala @@ -16,13 +16,35 @@ package io.pdal.pipeline -import io.pdal.PointCloud +import io.pdal._ import org.locationtech.jts.geom.Coordinate +import java.util +import java.nio.ByteBuffer + object Implicits extends Implicits with Serializable trait Implicits { - implicit class withPointCloudMethods(pointCloud: PointCloud) { - def getCoordinate(i: Int) = new Coordinate(pointCloud.getX(i), pointCloud.getY(i), pointCloud.getZ(i)) + implicit class withPointCloudMethods(self: PointCloud) { + def getCoordinate(i: Int) = new Coordinate(self.getX(i), self.getY(i), self.getZ(i)) + + def get(idx: Int, dims: SizedDimType*)(implicit d0: DummyImplicit): ByteBuffer = + self.get(idx, dims.toArray) + def get(idx: Int, dims: DimType*)(implicit d0: DummyImplicit, d1: DummyImplicit): ByteBuffer = + self.get(idx, dims.toArray) + def get(idx: Int, dims: String*)(implicit d0: DummyImplicit, d1: DummyImplicit, d2: DummyImplicit): ByteBuffer = + self.get(idx, dims.toArray) + } + + implicit class withPointViewMethods(self: PointView) { + def getPointCloud(dims: DimType*): PointCloud = self.getPointCloud(dims.toArray) + def get(idx: Int, packedPoints: Array[Byte], dims: DimType*): Array[Byte] = self.get(idx, packedPoints, dims.toArray) + def getPackedPoint(idx: Long, dims: DimType*): Array[Byte] = self.getPackedPoint(idx, dims.toArray) + def getPackedPoints(dims: DimType*): Array[Byte] = self.getPackedPoints(dims.toArray) + } + + implicit class withPointLayoutMethods(self: PointLayout) { + def toSizedDimTypes(dimTypes: DimType*): util.Map[String, SizedDimType] = + self.toSizedDimTypes(dimTypes.toArray) } } diff --git a/examples/pdal-jni/build.sbt b/examples/pdal-jni/build.sbt index 4740793..3473b4f 100644 --- a/examples/pdal-jni/build.sbt +++ b/examples/pdal-jni/build.sbt @@ -21,7 +21,7 @@ resolvers ++= Seq( fork := true -val pdalVersion = "2.1.3" +val pdalVersion = "2.1.4" libraryDependencies ++= Seq( "io.pdal" %% "pdal" % pdalVersion,