From c10308eaa5727a7c705c03a5686d9fef33e9b505 Mon Sep 17 00:00:00 2001 From: Grigory Pomadchin Date: Sun, 7 Jan 2024 19:30:53 -0500 Subject: [PATCH] Use Conda for Mac PDAL releases --- .github/workflows/ci.yml | 19 ++++++------------ .scalafmt.conf | 2 +- build.sbt | 14 +++++++------ .../quick-info-with-metadata-mac.json | 14 +++++-------- .../resources/quick-info-with-metadata.json | 2 +- core/src/test/resources/quick-info.json | 2 +- core/src/test/resources/schema.json | 20 +++++++++++++++++++ .../src/test/scala/io/pdal/PipelineSpec.scala | 3 ++- project/Dependencies.scala | 8 ++++++-- project/build.properties | 2 +- 10 files changed, 51 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87ac103..572ede7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - image: ['daunnc/pdal-ubuntu:2.5.1'] + image: ['daunnc/pdal-ubuntu:2.6.0'] runs-on: ${{ matrix.os }} container: image: ${{ matrix.image }} @@ -43,7 +43,7 @@ jobs: os: [macos-latest] java: [8] distribution: [temurin] - pdal: [2.5.6] + pdal: [2.6.2] runs-on: ${{ matrix.os }} steps: @@ -56,20 +56,13 @@ jobs: distribution: ${{ matrix.distribution }} java-version: ${{ matrix.java }} - - name: Cache Homebrew - uses: actions/cache@v2 + - uses: conda-incubator/setup-miniconda@v3 with: - path: ~/Library/Caches/Homebrew - key: ${{ runner.os }}-homebrew - - - name: Homebrew update & tap PDAL ${{ matrix.pdal }} - run: | - brew update && \ - brew tap-new $USER/local-pdal && \ - brew extract --version=${{ matrix.pdal }} pdal $USER/local-pdal + auto-activate-base: true + activate-environment: "" - name: Install PDAL - run: brew install pdal@${{ matrix.pdal }} || true + run: conda install conda-forge::pdal=${{ matrix.pdal }} - name: Check formatting run: sbt scalafmtCheckAll diff --git a/.scalafmt.conf b/.scalafmt.conf index 9049394..3017fff 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version=3.7.2 +version=3.7.17 runner.dialect = scala3 align.openParenCallSite = true align.openParenDefnSite = true diff --git a/build.sbt b/build.sbt index d4bc06d..871d066 100644 --- a/build.sbt +++ b/build.sbt @@ -71,10 +71,12 @@ lazy val core = project .settings(name := "pdal") .settings(javah / target := (native / nativeCompile / sourceDirectory).value / "include") .settings(sbtJniCoreScope := Compile) - .settings(libraryDependencies ++= Seq( - Dependencies.scalaTest % Test, - Dependencies.circe("parser") % Test - )) + .settings( + libraryDependencies ++= Seq( + Dependencies.scalaTest % Test, + Dependencies.circe("parser") % Test + ) + ) .dependsOn(Environment.dependOnNative(native % Runtime): _*) lazy val native = project @@ -84,9 +86,9 @@ lazy val native = project .settings(nativeCompile / sourceDirectory := sourceDirectory.value) .settings( Compile / unmanagedPlatformDependentNativeDirectories := Seq( - "x86_64-linux" -> target.value / "native/x86_64-linux/bin/", + "x86_64-linux" -> target.value / "native/x86_64-linux/bin/", "x86_64-darwin" -> target.value / "native/x86_64-darwin/bin/", - "arm64-darwin" -> target.value / "native/arm64-darwin/bin/" + "arm64-darwin" -> target.value / "native/arm64-darwin/bin/" ) ) .settings(artifactName := { (sv: ScalaVersion, module: ModuleID, artifact: Artifact) => diff --git a/core/src/test/resources/quick-info-with-metadata-mac.json b/core/src/test/resources/quick-info-with-metadata-mac.json index 7ce7f0a..ef3913e 100644 --- a/core/src/test/resources/quick-info-with-metadata-mac.json +++ b/core/src/test/resources/quick-info-with-metadata-mac.json @@ -1,8 +1,6 @@ { - "readers.las": - { - "bounds": - { + "readers.las": { + "bounds": { "maxx": 638982.55, "maxy": 853535.43, "maxz": 586.38, @@ -10,10 +8,9 @@ "miny": 848899.7, "minz": 406.59 }, - "dimensions": "X, Y, Z, Intensity, ReturnNumber, NumberOfReturns, ScanDirectionFlag, EdgeOfFlightLine, Classification, ScanAngleRank, UserData, PointSourceId, GpsTime, Red, Green, Blue", + "dimensions": "X, Y, Z, Intensity, ReturnNumber, NumberOfReturns, ScanDirectionFlag, EdgeOfFlightLine, Classification, Synthetic, KeyPoint, Withheld, Overlap, ScanAngleRank, UserData, PointSourceId, GpsTime, Red, Green, Blue", "num_points": 1065, - "srs": - { + "srs": { "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\"]]", "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\"]]", "isgeocentric": false, @@ -145,8 +142,7 @@ "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\"]]", "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\"]]", "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", - "units": - { + "units": { "horizontal": "metre", "vertical": "" }, diff --git a/core/src/test/resources/quick-info-with-metadata.json b/core/src/test/resources/quick-info-with-metadata.json index efb78cd..c957e70 100644 --- a/core/src/test/resources/quick-info-with-metadata.json +++ b/core/src/test/resources/quick-info-with-metadata.json @@ -10,7 +10,7 @@ "miny": 848899.7, "minz": 406.59 }, - "dimensions": "X, Y, Z, Intensity, ReturnNumber, NumberOfReturns, ScanDirectionFlag, EdgeOfFlightLine, Classification, ScanAngleRank, UserData, PointSourceId, GpsTime, Red, Green, Blue", + "dimensions": "X, Y, Z, Intensity, ReturnNumber, NumberOfReturns, ScanDirectionFlag, EdgeOfFlightLine, Classification, Synthetic, KeyPoint, Withheld, Overlap, ScanAngleRank, UserData, PointSourceId, GpsTime, Red, Green, Blue", "num_points": 1065, "srs": { diff --git a/core/src/test/resources/quick-info.json b/core/src/test/resources/quick-info.json index 7ce2f01..e53d4a7 100644 --- a/core/src/test/resources/quick-info.json +++ b/core/src/test/resources/quick-info.json @@ -10,7 +10,7 @@ "miny": 848899.7, "minz": 406.59 }, - "dimensions": "X, Y, Z, Intensity, ReturnNumber, NumberOfReturns, ScanDirectionFlag, EdgeOfFlightLine, Classification, ScanAngleRank, UserData, PointSourceId, GpsTime, Red, Green, Blue", + "dimensions": "X, Y, Z, Intensity, ReturnNumber, NumberOfReturns, ScanDirectionFlag, EdgeOfFlightLine, Classification, Synthetic, KeyPoint, Withheld, Overlap, ScanAngleRank, UserData, PointSourceId, GpsTime, Red, Green, Blue", "num_points": 1065 } } diff --git a/core/src/test/resources/schema.json b/core/src/test/resources/schema.json index 180c1fb..21fd4ad 100644 --- a/core/src/test/resources/schema.json +++ b/core/src/test/resources/schema.json @@ -48,6 +48,26 @@ "size": 1, "type": "unsigned" }, + { + "name": "Synthetic", + "size": 1, + "type": "unsigned" + }, + { + "name": "KeyPoint", + "size": 1, + "type": "unsigned" + }, + { + "name": "Withheld", + "size": 1, + "type": "unsigned" + }, + { + "name": "Overlap", + "size": 1, + "type": "unsigned" + }, { "name": "ScanAngleRank", "size": 4, diff --git a/core/src/test/scala/io/pdal/PipelineSpec.scala b/core/src/test/scala/io/pdal/PipelineSpec.scala index b9e0435..0cc1f3c 100644 --- a/core/src/test/scala/io/pdal/PipelineSpec.scala +++ b/core/src/test/scala/io/pdal/PipelineSpec.scala @@ -125,7 +125,7 @@ class PipelineSpec extends TestEnvironmentSpec { it("layout should have a valid number of dims") { val pvi = pipeline.getPointViews() val pv = pvi.next() - pv.layout().dimTypes().length should be(16) + pv.layout().dimTypes().length should be(20) pv.close() pvi.close() } @@ -188,6 +188,7 @@ class PipelineSpec extends TestEnvironmentSpec { it("should get quickInfo") { val p = Pipeline(json) + println(p.getQuickInfo()) parser.parse(p.getQuickInfo()) shouldBe quickInfoJson } diff --git a/project/Dependencies.scala b/project/Dependencies.scala index b502a7f..42c9b54 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -7,7 +7,8 @@ import de.heikoseeberger.sbtheader.HeaderPlugin.autoImport.{headerLicense, heade object Version { val jts = "1.19.0" val scalaTest = "3.2.17" - val circe = "0.14.3" + val circe = "0.14.6" + val circeExtras = "0.14.3" } object Dependencies { @@ -41,7 +42,10 @@ object Dependencies { ) ) - def circe(module: String) = "io.circe" %% s"circe-$module" % Version.circe + def circe(module: String) = module match { + case "generic-extras" => "io.circe" %% s"circe-$module" % Version.circeExtras + case _ => "io.circe" %% s"circe-$module" % Version.circe + } val jtsCore = "org.locationtech.jts" % "jts-core" % Version.jts val scalaTest = "org.scalatest" %% "scalatest" % Version.scalaTest diff --git a/project/build.properties b/project/build.properties index 2743082..e8a1e24 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.6 +sbt.version=1.9.7