diff --git a/src/main/scala/com/databricks/labs/mosaic/core/raster/MosaicRaster.scala b/src/main/scala/com/databricks/labs/mosaic/core/raster/MosaicRaster.scala index 02b8b4a53..f08440e47 100644 --- a/src/main/scala/com/databricks/labs/mosaic/core/raster/MosaicRaster.scala +++ b/src/main/scala/com/databricks/labs/mosaic/core/raster/MosaicRaster.scala @@ -3,7 +3,7 @@ package com.databricks.labs.mosaic.core.raster import com.databricks.labs.mosaic.core.geometry.MosaicGeometry import com.databricks.labs.mosaic.core.geometry.api.GeometryAPI import com.databricks.labs.mosaic.core.index.IndexSystem -import com.databricks.labs.mosaic.core.raster.gdal_raster.{RasterCleaner, RasterWriter} +import com.databricks.labs.mosaic.core.raster.io.{RasterCleaner, RasterWriter} import org.gdal.gdal.Dataset import org.gdal.osr.SpatialReference diff --git a/src/main/scala/com/databricks/labs/mosaic/core/raster/MosaicRasterBand.scala b/src/main/scala/com/databricks/labs/mosaic/core/raster/MosaicRasterBand.scala index 23a5b2a1a..6f485f08e 100644 --- a/src/main/scala/com/databricks/labs/mosaic/core/raster/MosaicRasterBand.scala +++ b/src/main/scala/com/databricks/labs/mosaic/core/raster/MosaicRasterBand.scala @@ -8,6 +8,7 @@ trait MosaicRasterBand extends Serializable { def isNoDataMask: Boolean + /** @return Return the status flags of the mask band associated with the band */ def maskFlags: Seq[Any] /** @return Returns the bandId of the band. */ diff --git a/src/main/scala/com/databricks/labs/mosaic/core/raster/api/GDAL.scala b/src/main/scala/com/databricks/labs/mosaic/core/raster/api/GDAL.scala new file mode 100644 index 000000000..8bed27771 --- /dev/null +++ b/src/main/scala/com/databricks/labs/mosaic/core/raster/api/GDAL.scala @@ -0,0 +1,29 @@ +package com.databricks.labs.mosaic.core.raster.api + +import com.databricks.labs.mosaic.core.raster.gdal.MosaicRasterGDAL + +import org.gdal.gdal.gdal + +/** + * GDAL Raster API. It uses [[MosaicRasterGDAL]] as the [[RasterReader]]. + */ +object GDAL extends RasterAPI(MosaicRasterGDAL) { + + override def name: String = "GDAL" + + /** + * Enables GDAL on the worker nodes. GDAL requires drivers to be + * registered on the worker nodes. This method registers all the + * drivers on the worker nodes. + */ + override def enable(): Unit = { + gdal.UseExceptions() + if (gdal.GetDriverCount() == 0) gdal.AllRegister() + } + + override def getExtension(driverShortName: String): String = { + val driver = gdal.GetDriverByName(driverShortName) + driver.GetMetadataItem("DMD_EXTENSION") + } + +} diff --git a/src/main/scala/com/databricks/labs/mosaic/core/raster/api/RasterAPI.scala b/src/main/scala/com/databricks/labs/mosaic/core/raster/api/RasterAPI.scala index c6023f55a..7a463f90e 100644 --- a/src/main/scala/com/databricks/labs/mosaic/core/raster/api/RasterAPI.scala +++ b/src/main/scala/com/databricks/labs/mosaic/core/raster/api/RasterAPI.scala @@ -1,11 +1,12 @@ package com.databricks.labs.mosaic.core.raster.api import com.databricks.labs.mosaic.core.raster._ -import com.databricks.labs.mosaic.core.raster.gdal_raster.{MosaicRasterGDAL, RasterCleaner, RasterReader, RasterTransform} +import com.databricks.labs.mosaic.core.raster.gdal.MosaicRasterGDAL +import com.databricks.labs.mosaic.core.raster.io.{RasterCleaner, RasterReader} +import com.databricks.labs.mosaic.core.raster.operator.transform.RasterTransform import com.databricks.labs.mosaic.utils.PathUtils import org.apache.spark.sql.types.{BinaryType, DataType, StringType} import org.apache.spark.unsafe.types.UTF8String -import org.gdal.gdal.gdal import java.util.UUID @@ -165,28 +166,6 @@ object RasterAPI extends Serializable { case "GDAL" => MosaicRasterGDAL } - /** - * GDAL Raster API. It uses [[MosaicRasterGDAL]] as the [[RasterReader]]. - */ - object GDAL extends RasterAPI(MosaicRasterGDAL) { - - override def name: String = "GDAL" - - /** - * Enables GDAL on the worker nodes. GDAL requires drivers to be - * registered on the worker nodes. This method registers all the - * drivers on the worker nodes. - */ - override def enable(): Unit = { - gdal.UseExceptions() - if (gdal.GetDriverCount() == 0) gdal.AllRegister() - } - override def getExtension(driverShortName: String): String = { - val driver = gdal.GetDriverByName(driverShortName) - driver.GetMetadataItem("DMD_EXTENSION") - } - - } } diff --git a/src/main/scala/com/databricks/labs/mosaic/core/raster/MosaicRasterBandGDAL.scala b/src/main/scala/com/databricks/labs/mosaic/core/raster/gdal/MosaicRasterBandGDAL.scala similarity index 97% rename from src/main/scala/com/databricks/labs/mosaic/core/raster/MosaicRasterBandGDAL.scala rename to src/main/scala/com/databricks/labs/mosaic/core/raster/gdal/MosaicRasterBandGDAL.scala index 8d5ebacb2..909676295 100644 --- a/src/main/scala/com/databricks/labs/mosaic/core/raster/MosaicRasterBandGDAL.scala +++ b/src/main/scala/com/databricks/labs/mosaic/core/raster/gdal/MosaicRasterBandGDAL.scala @@ -1,5 +1,6 @@ -package com.databricks.labs.mosaic.core.raster +package com.databricks.labs.mosaic.core.raster.gdal +import com.databricks.labs.mosaic.core.raster.MosaicRasterBand import org.gdal.gdal.Band import org.gdal.gdalconst.gdalconstConstants diff --git a/src/main/scala/com/databricks/labs/mosaic/core/raster/gdal_raster/MosaicRasterGDAL.scala b/src/main/scala/com/databricks/labs/mosaic/core/raster/gdal/MosaicRasterGDAL.scala similarity index 99% rename from src/main/scala/com/databricks/labs/mosaic/core/raster/gdal_raster/MosaicRasterGDAL.scala rename to src/main/scala/com/databricks/labs/mosaic/core/raster/gdal/MosaicRasterGDAL.scala index 82b80f426..6f21c0b87 100644 --- a/src/main/scala/com/databricks/labs/mosaic/core/raster/gdal_raster/MosaicRasterGDAL.scala +++ b/src/main/scala/com/databricks/labs/mosaic/core/raster/gdal/MosaicRasterGDAL.scala @@ -1,10 +1,11 @@ -package com.databricks.labs.mosaic.core.raster.gdal_raster +package com.databricks.labs.mosaic.core.raster.gdal import com.databricks.labs.mosaic.GDAL import com.databricks.labs.mosaic.core.geometry.MosaicGeometry import com.databricks.labs.mosaic.core.geometry.api.GeometryAPI import com.databricks.labs.mosaic.core.index.IndexSystem import com.databricks.labs.mosaic.core.raster._ +import com.databricks.labs.mosaic.core.raster.io.{RasterCleaner, RasterReader} import com.databricks.labs.mosaic.core.raster.operator.clip.RasterClipByVector import com.databricks.labs.mosaic.core.types.model.GeometryTypeEnum.POLYGON import com.databricks.labs.mosaic.utils.PathUtils diff --git a/src/main/scala/com/databricks/labs/mosaic/core/raster/gdal_raster/RasterCleaner.scala b/src/main/scala/com/databricks/labs/mosaic/core/raster/io/RasterCleaner.scala similarity index 95% rename from src/main/scala/com/databricks/labs/mosaic/core/raster/gdal_raster/RasterCleaner.scala rename to src/main/scala/com/databricks/labs/mosaic/core/raster/io/RasterCleaner.scala index a08542a20..37692dbfb 100644 --- a/src/main/scala/com/databricks/labs/mosaic/core/raster/gdal_raster/RasterCleaner.scala +++ b/src/main/scala/com/databricks/labs/mosaic/core/raster/io/RasterCleaner.scala @@ -1,4 +1,4 @@ -package com.databricks.labs.mosaic.core.raster.gdal_raster +package com.databricks.labs.mosaic.core.raster.io import com.databricks.labs.mosaic.core.raster.MosaicRaster import com.databricks.labs.mosaic.core.types.model.MosaicRasterTile diff --git a/src/main/scala/com/databricks/labs/mosaic/core/raster/gdal_raster/RasterReader.scala b/src/main/scala/com/databricks/labs/mosaic/core/raster/io/RasterReader.scala similarity index 97% rename from src/main/scala/com/databricks/labs/mosaic/core/raster/gdal_raster/RasterReader.scala rename to src/main/scala/com/databricks/labs/mosaic/core/raster/io/RasterReader.scala index 4e4109513..e6203146c 100644 --- a/src/main/scala/com/databricks/labs/mosaic/core/raster/gdal_raster/RasterReader.scala +++ b/src/main/scala/com/databricks/labs/mosaic/core/raster/io/RasterReader.scala @@ -1,4 +1,4 @@ -package com.databricks.labs.mosaic.core.raster.gdal_raster +package com.databricks.labs.mosaic.core.raster.io import com.databricks.labs.mosaic.core.raster.{MosaicRaster, MosaicRasterBand} import org.apache.spark.internal.Logging diff --git a/src/main/scala/com/databricks/labs/mosaic/core/raster/gdal_raster/RasterWriter.scala b/src/main/scala/com/databricks/labs/mosaic/core/raster/io/RasterWriter.scala similarity index 93% rename from src/main/scala/com/databricks/labs/mosaic/core/raster/gdal_raster/RasterWriter.scala rename to src/main/scala/com/databricks/labs/mosaic/core/raster/io/RasterWriter.scala index 5a76c8272..fa6848d65 100644 --- a/src/main/scala/com/databricks/labs/mosaic/core/raster/gdal_raster/RasterWriter.scala +++ b/src/main/scala/com/databricks/labs/mosaic/core/raster/io/RasterWriter.scala @@ -1,4 +1,4 @@ -package com.databricks.labs.mosaic.core.raster.gdal_raster +package com.databricks.labs.mosaic.core.raster.io /** * RasterWriter is a trait that defines the interface for writing raster data diff --git a/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/NDVI.scala b/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/NDVI.scala index 3b99b7196..4b02dfcab 100644 --- a/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/NDVI.scala +++ b/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/NDVI.scala @@ -1,7 +1,7 @@ package com.databricks.labs.mosaic.core.raster.operator import com.databricks.labs.mosaic.core.raster.MosaicRaster -import com.databricks.labs.mosaic.core.raster.gdal_raster.MosaicRasterGDAL +import com.databricks.labs.mosaic.core.raster.gdal.MosaicRasterGDAL import com.databricks.labs.mosaic.utils.PathUtils object NDVI { diff --git a/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/gdal/GDALBuildVRT.scala b/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/gdal/GDALBuildVRT.scala index 896f99cba..50d9ef2f4 100644 --- a/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/gdal/GDALBuildVRT.scala +++ b/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/gdal/GDALBuildVRT.scala @@ -1,7 +1,8 @@ package com.databricks.labs.mosaic.core.raster.operator.gdal import com.databricks.labs.mosaic.core.raster.MosaicRaster -import com.databricks.labs.mosaic.core.raster.gdal_raster.{MosaicRasterGDAL, RasterCleaner} +import com.databricks.labs.mosaic.core.raster.gdal.MosaicRasterGDAL +import com.databricks.labs.mosaic.core.raster.io.RasterCleaner import org.gdal.gdal.{BuildVRTOptions, Dataset, WarpOptions, gdal} object GDALBuildVRT { diff --git a/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/gdal/GDALTranslate.scala b/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/gdal/GDALTranslate.scala index cab594a06..79c7d510e 100644 --- a/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/gdal/GDALTranslate.scala +++ b/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/gdal/GDALTranslate.scala @@ -1,7 +1,7 @@ package com.databricks.labs.mosaic.core.raster.operator.gdal import com.databricks.labs.mosaic.core.raster.MosaicRaster -import com.databricks.labs.mosaic.core.raster.gdal_raster.MosaicRasterGDAL +import com.databricks.labs.mosaic.core.raster.gdal.MosaicRasterGDAL import org.gdal.gdal.{TranslateOptions, gdal} import java.nio.file.{Files, Paths} diff --git a/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/gdal/GDALWarp.scala b/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/gdal/GDALWarp.scala index 4bc4a3af0..a54660d63 100644 --- a/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/gdal/GDALWarp.scala +++ b/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/gdal/GDALWarp.scala @@ -1,7 +1,7 @@ package com.databricks.labs.mosaic.core.raster.operator.gdal import com.databricks.labs.mosaic.core.raster.MosaicRaster -import com.databricks.labs.mosaic.core.raster.gdal_raster.MosaicRasterGDAL +import com.databricks.labs.mosaic.core.raster.gdal.MosaicRasterGDAL import org.gdal.gdal.{WarpOptions, gdal} import java.nio.file.{Files, Paths} diff --git a/src/main/scala/com/databricks/labs/mosaic/core/raster/gdal_raster/RasterTransform.scala b/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/transform/RasterTransform.scala similarity index 96% rename from src/main/scala/com/databricks/labs/mosaic/core/raster/gdal_raster/RasterTransform.scala rename to src/main/scala/com/databricks/labs/mosaic/core/raster/operator/transform/RasterTransform.scala index 347f5b8c8..d8056a942 100644 --- a/src/main/scala/com/databricks/labs/mosaic/core/raster/gdal_raster/RasterTransform.scala +++ b/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/transform/RasterTransform.scala @@ -1,4 +1,4 @@ -package com.databricks.labs.mosaic.core.raster.gdal_raster +package com.databricks.labs.mosaic.core.raster.operator.transform object RasterTransform { diff --git a/src/main/scala/com/databricks/labs/mosaic/datasource/gdal/ReTileOnRead.scala b/src/main/scala/com/databricks/labs/mosaic/datasource/gdal/ReTileOnRead.scala index bc9f4e302..3fc0f94f4 100644 --- a/src/main/scala/com/databricks/labs/mosaic/datasource/gdal/ReTileOnRead.scala +++ b/src/main/scala/com/databricks/labs/mosaic/datasource/gdal/ReTileOnRead.scala @@ -3,7 +3,8 @@ package com.databricks.labs.mosaic.datasource.gdal import com.databricks.labs.mosaic.core.index.{IndexSystem, IndexSystemFactory} import com.databricks.labs.mosaic.core.raster.MosaicRaster import com.databricks.labs.mosaic.core.raster.api.RasterAPI -import com.databricks.labs.mosaic.core.raster.gdal_raster.{MosaicRasterGDAL, RasterCleaner} +import com.databricks.labs.mosaic.core.raster.gdal.MosaicRasterGDAL +import com.databricks.labs.mosaic.core.raster.io.RasterCleaner import com.databricks.labs.mosaic.core.raster.operator.retile.BalancedSubdivision import com.databricks.labs.mosaic.core.types.RasterTileType import com.databricks.labs.mosaic.core.types.model.MosaicRasterTile diff --git a/src/main/scala/com/databricks/labs/mosaic/datasource/gdal/ReadInMemory.scala b/src/main/scala/com/databricks/labs/mosaic/datasource/gdal/ReadInMemory.scala index 75e10b087..96fcb70e7 100644 --- a/src/main/scala/com/databricks/labs/mosaic/datasource/gdal/ReadInMemory.scala +++ b/src/main/scala/com/databricks/labs/mosaic/datasource/gdal/ReadInMemory.scala @@ -2,7 +2,8 @@ package com.databricks.labs.mosaic.datasource.gdal import com.databricks.labs.mosaic.core.index.{IndexSystem, IndexSystemFactory} import com.databricks.labs.mosaic.core.raster.api.RasterAPI -import com.databricks.labs.mosaic.core.raster.gdal_raster.{MosaicRasterGDAL, RasterCleaner} +import com.databricks.labs.mosaic.core.raster.gdal.MosaicRasterGDAL +import com.databricks.labs.mosaic.core.raster.io.RasterCleaner import com.databricks.labs.mosaic.core.types.RasterTileType import com.databricks.labs.mosaic.datasource.Utils import com.databricks.labs.mosaic.datasource.gdal.GDALFileFormat._ diff --git a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/RST_MergeAgg.scala b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/RST_MergeAgg.scala index e117bfb21..b8e96c60e 100644 --- a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/RST_MergeAgg.scala +++ b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/RST_MergeAgg.scala @@ -2,7 +2,7 @@ package com.databricks.labs.mosaic.expressions.raster import com.databricks.labs.mosaic.core.index.IndexSystemFactory import com.databricks.labs.mosaic.core.raster.api.RasterAPI -import com.databricks.labs.mosaic.core.raster.gdal_raster.RasterCleaner +import com.databricks.labs.mosaic.core.raster.io.RasterCleaner import com.databricks.labs.mosaic.core.raster.operator.merge.MergeRasters import com.databricks.labs.mosaic.core.types.RasterTileType import com.databricks.labs.mosaic.core.types.model.MosaicRasterTile diff --git a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/RST_PixelHeight.scala b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/RST_PixelHeight.scala index 906fcc5f8..d0560f00b 100644 --- a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/RST_PixelHeight.scala +++ b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/RST_PixelHeight.scala @@ -1,6 +1,6 @@ package com.databricks.labs.mosaic.expressions.raster -import com.databricks.labs.mosaic.core.raster.gdal_raster.RasterCleaner +import com.databricks.labs.mosaic.core.raster.io.RasterCleaner import com.databricks.labs.mosaic.core.types.model.MosaicRasterTile import com.databricks.labs.mosaic.expressions.base.{GenericExpressionFactory, WithExpressionInfo} import com.databricks.labs.mosaic.expressions.raster.base.RasterExpression diff --git a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/RST_PixelWidth.scala b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/RST_PixelWidth.scala index c89e3fccc..61e8d58ec 100644 --- a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/RST_PixelWidth.scala +++ b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/RST_PixelWidth.scala @@ -1,6 +1,6 @@ package com.databricks.labs.mosaic.expressions.raster -import com.databricks.labs.mosaic.core.raster.gdal_raster.RasterCleaner +import com.databricks.labs.mosaic.core.raster.io.RasterCleaner import com.databricks.labs.mosaic.core.types.model.MosaicRasterTile import com.databricks.labs.mosaic.expressions.base.{GenericExpressionFactory, WithExpressionInfo} import com.databricks.labs.mosaic.expressions.raster.base.RasterExpression diff --git a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/RST_Tile.scala b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/RST_Tile.scala index 977143b29..b7cf30062 100644 --- a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/RST_Tile.scala +++ b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/RST_Tile.scala @@ -3,7 +3,7 @@ package com.databricks.labs.mosaic.expressions.raster import com.databricks.labs.mosaic.core.geometry.api.GeometryAPI import com.databricks.labs.mosaic.core.index.{IndexSystem, IndexSystemFactory} import com.databricks.labs.mosaic.core.raster.api.RasterAPI -import com.databricks.labs.mosaic.core.raster.gdal_raster.RasterCleaner +import com.databricks.labs.mosaic.core.raster.io.RasterCleaner import com.databricks.labs.mosaic.core.types.RasterTileType import com.databricks.labs.mosaic.datasource.gdal.ReTileOnRead import com.databricks.labs.mosaic.expressions.base.{GenericExpressionFactory, WithExpressionInfo} diff --git a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/Raster1ArgExpression.scala b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/Raster1ArgExpression.scala index 41e74557d..b7436674b 100644 --- a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/Raster1ArgExpression.scala +++ b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/Raster1ArgExpression.scala @@ -1,7 +1,7 @@ package com.databricks.labs.mosaic.expressions.raster.base import com.databricks.labs.mosaic.core.raster.api.RasterAPI -import com.databricks.labs.mosaic.core.raster.gdal_raster.RasterCleaner +import com.databricks.labs.mosaic.core.raster.io.RasterCleaner import com.databricks.labs.mosaic.core.types.model.MosaicRasterTile import com.databricks.labs.mosaic.expressions.base.GenericExpressionFactory import com.databricks.labs.mosaic.functions.MosaicExpressionConfig diff --git a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/Raster2ArgExpression.scala b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/Raster2ArgExpression.scala index 7f68d046d..83a54a2d0 100644 --- a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/Raster2ArgExpression.scala +++ b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/Raster2ArgExpression.scala @@ -2,7 +2,7 @@ package com.databricks.labs.mosaic.expressions.raster.base import com.databricks.labs.mosaic.core.raster.MosaicRaster import com.databricks.labs.mosaic.core.raster.api.RasterAPI -import com.databricks.labs.mosaic.core.raster.gdal_raster.RasterCleaner +import com.databricks.labs.mosaic.core.raster.io.RasterCleaner import com.databricks.labs.mosaic.core.types.model.MosaicRasterTile import com.databricks.labs.mosaic.expressions.base.GenericExpressionFactory import com.databricks.labs.mosaic.functions.MosaicExpressionConfig diff --git a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterArrayExpression.scala b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterArrayExpression.scala index 70b1b15c9..46a8707f2 100644 --- a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterArrayExpression.scala +++ b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterArrayExpression.scala @@ -1,7 +1,7 @@ package com.databricks.labs.mosaic.expressions.raster.base import com.databricks.labs.mosaic.core.raster.api.RasterAPI -import com.databricks.labs.mosaic.core.raster.gdal_raster.RasterCleaner +import com.databricks.labs.mosaic.core.raster.io.RasterCleaner import com.databricks.labs.mosaic.core.types.model.MosaicRasterTile import com.databricks.labs.mosaic.expressions.base.GenericExpressionFactory import com.databricks.labs.mosaic.functions.MosaicExpressionConfig diff --git a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterBandExpression.scala b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterBandExpression.scala index 366e111a1..3e0bd5228 100644 --- a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterBandExpression.scala +++ b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterBandExpression.scala @@ -2,7 +2,7 @@ package com.databricks.labs.mosaic.expressions.raster.base import com.databricks.labs.mosaic.core.raster.MosaicRasterBand import com.databricks.labs.mosaic.core.raster.api.RasterAPI -import com.databricks.labs.mosaic.core.raster.gdal_raster.RasterCleaner +import com.databricks.labs.mosaic.core.raster.io.RasterCleaner import com.databricks.labs.mosaic.core.types.model.MosaicRasterTile import com.databricks.labs.mosaic.expressions.base.GenericExpressionFactory import com.databricks.labs.mosaic.functions.MosaicExpressionConfig diff --git a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterExpression.scala b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterExpression.scala index 38b3d5b71..67aee780c 100644 --- a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterExpression.scala +++ b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterExpression.scala @@ -2,7 +2,7 @@ package com.databricks.labs.mosaic.expressions.raster.base import com.databricks.labs.mosaic.core.index.{IndexSystem, IndexSystemFactory} import com.databricks.labs.mosaic.core.raster.api.RasterAPI -import com.databricks.labs.mosaic.core.raster.gdal_raster.RasterCleaner +import com.databricks.labs.mosaic.core.raster.io.RasterCleaner import com.databricks.labs.mosaic.core.types.model.MosaicRasterTile import com.databricks.labs.mosaic.expressions.base.GenericExpressionFactory import com.databricks.labs.mosaic.functions.MosaicExpressionConfig diff --git a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterExpressionSerialization.scala b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterExpressionSerialization.scala index bbfa9a163..e432b3a0c 100644 --- a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterExpressionSerialization.scala +++ b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterExpressionSerialization.scala @@ -2,7 +2,7 @@ package com.databricks.labs.mosaic.expressions.raster.base import com.databricks.labs.mosaic.core.index.IndexSystemFactory import com.databricks.labs.mosaic.core.raster.api.RasterAPI -import com.databricks.labs.mosaic.core.raster.gdal_raster.RasterCleaner +import com.databricks.labs.mosaic.core.raster.io.RasterCleaner import com.databricks.labs.mosaic.core.types.RasterTileType import com.databricks.labs.mosaic.core.types.model.MosaicRasterTile import com.databricks.labs.mosaic.functions.MosaicExpressionConfig diff --git a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterGeneratorExpression.scala b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterGeneratorExpression.scala index 6efa94a82..969ef3762 100644 --- a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterGeneratorExpression.scala +++ b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterGeneratorExpression.scala @@ -3,7 +3,7 @@ package com.databricks.labs.mosaic.expressions.raster.base import com.databricks.labs.mosaic.core.geometry.api.GeometryAPI import com.databricks.labs.mosaic.core.index.{IndexSystem, IndexSystemFactory} import com.databricks.labs.mosaic.core.raster.api.RasterAPI -import com.databricks.labs.mosaic.core.raster.gdal_raster.RasterCleaner +import com.databricks.labs.mosaic.core.raster.io.RasterCleaner import com.databricks.labs.mosaic.core.types.RasterTileType import com.databricks.labs.mosaic.core.types.model.MosaicRasterTile import com.databricks.labs.mosaic.expressions.base.GenericExpressionFactory diff --git a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterTessellateGeneratorExpression.scala b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterTessellateGeneratorExpression.scala index 28c942575..67fb67cd5 100644 --- a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterTessellateGeneratorExpression.scala +++ b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterTessellateGeneratorExpression.scala @@ -3,7 +3,7 @@ package com.databricks.labs.mosaic.expressions.raster.base import com.databricks.labs.mosaic.core.geometry.api.GeometryAPI import com.databricks.labs.mosaic.core.index.{IndexSystem, IndexSystemFactory} import com.databricks.labs.mosaic.core.raster.api.RasterAPI -import com.databricks.labs.mosaic.core.raster.gdal_raster.RasterCleaner +import com.databricks.labs.mosaic.core.raster.io.RasterCleaner import com.databricks.labs.mosaic.core.types.RasterTileType import com.databricks.labs.mosaic.core.types.model.MosaicRasterTile import com.databricks.labs.mosaic.expressions.base.GenericExpressionFactory diff --git a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterToGridExpression.scala b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterToGridExpression.scala index d144a46fa..105199418 100644 --- a/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterToGridExpression.scala +++ b/src/main/scala/com/databricks/labs/mosaic/expressions/raster/base/RasterToGridExpression.scala @@ -2,7 +2,7 @@ package com.databricks.labs.mosaic.expressions.raster.base import com.databricks.labs.mosaic.core.geometry.api.GeometryAPI import com.databricks.labs.mosaic.core.index.{IndexSystem, IndexSystemFactory} -import com.databricks.labs.mosaic.core.raster.gdal_raster.RasterCleaner +import com.databricks.labs.mosaic.core.raster.io.RasterCleaner import com.databricks.labs.mosaic.core.types.model.MosaicRasterTile import com.databricks.labs.mosaic.expressions.raster.RasterToGridType import com.databricks.labs.mosaic.functions.MosaicExpressionConfig diff --git a/src/main/scala/com/databricks/labs/mosaic/package.scala b/src/main/scala/com/databricks/labs/mosaic/package.scala index 2959d977d..72c4081db 100644 --- a/src/main/scala/com/databricks/labs/mosaic/package.scala +++ b/src/main/scala/com/databricks/labs/mosaic/package.scala @@ -11,7 +11,7 @@ package object mosaic { val JTS: GeometryAPI = mosaic.core.geometry.api.JTS val ESRI: GeometryAPI = mosaic.core.geometry.api.ESRI - val GDAL: RasterAPI = mosaic.core.raster.api.RasterAPI.GDAL + val GDAL: RasterAPI = mosaic.core.raster.api.GDAL val H3: IndexSystem = mosaic.core.index.H3IndexSystem val BNG: IndexSystem = mosaic.core.index.BNGIndexSystem diff --git a/src/main/scala/com/databricks/labs/mosaic/sql/extensions/MosaicSQL.scala b/src/main/scala/com/databricks/labs/mosaic/sql/extensions/MosaicSQL.scala index 73e2ba802..409ad5c95 100644 --- a/src/main/scala/com/databricks/labs/mosaic/sql/extensions/MosaicSQL.scala +++ b/src/main/scala/com/databricks/labs/mosaic/sql/extensions/MosaicSQL.scala @@ -3,7 +3,7 @@ package com.databricks.labs.mosaic.sql.extensions import com.databricks.labs.mosaic._ import com.databricks.labs.mosaic.core.geometry.api.{ESRI, JTS} import com.databricks.labs.mosaic.core.index.{BNGIndexSystem, H3IndexSystem} -import com.databricks.labs.mosaic.core.raster.api.RasterAPI.GDAL +import com.databricks.labs.mosaic.core.raster.api.GDAL import com.databricks.labs.mosaic.functions.MosaicContext import org.apache.spark.internal.Logging import org.apache.spark.sql.SparkSessionExtensions diff --git a/src/main/scala/com/databricks/labs/mosaic/sql/extensions/MosaicSQLDefault.scala b/src/main/scala/com/databricks/labs/mosaic/sql/extensions/MosaicSQLDefault.scala index d888a9d22..5fd9dd8b7 100644 --- a/src/main/scala/com/databricks/labs/mosaic/sql/extensions/MosaicSQLDefault.scala +++ b/src/main/scala/com/databricks/labs/mosaic/sql/extensions/MosaicSQLDefault.scala @@ -2,7 +2,7 @@ package com.databricks.labs.mosaic.sql.extensions import com.databricks.labs.mosaic.core.geometry.api.JTS import com.databricks.labs.mosaic.core.index.H3IndexSystem -import com.databricks.labs.mosaic.core.raster.api.RasterAPI.GDAL +import com.databricks.labs.mosaic.core.raster.api.GDAL import com.databricks.labs.mosaic.functions.MosaicContext import org.apache.spark.internal.Logging import org.apache.spark.sql.SparkSessionExtensions diff --git a/src/test/scala/com/databricks/labs/mosaic/codegen/TestAsHexCodegen.scala b/src/test/scala/com/databricks/labs/mosaic/codegen/TestAsHexCodegen.scala index 0749ebee8..544140921 100644 --- a/src/test/scala/com/databricks/labs/mosaic/codegen/TestAsHexCodegen.scala +++ b/src/test/scala/com/databricks/labs/mosaic/codegen/TestAsHexCodegen.scala @@ -1,7 +1,7 @@ package com.databricks.labs.mosaic.codegen import com.databricks.labs.mosaic.core.geometry.api.{ESRI, JTS} -import com.databricks.labs.mosaic.core.raster.api.RasterAPI.GDAL +import com.databricks.labs.mosaic.core.raster.api.GDAL import com.databricks.labs.mosaic.core.index.H3IndexSystem import com.databricks.labs.mosaic.functions.MosaicContext import com.databricks.labs.mosaic.test.SparkCodeGenSuite diff --git a/src/test/scala/com/databricks/labs/mosaic/codegen/TestAsJSONCodegen.scala b/src/test/scala/com/databricks/labs/mosaic/codegen/TestAsJSONCodegen.scala index 148ba49d2..eaf25e99c 100644 --- a/src/test/scala/com/databricks/labs/mosaic/codegen/TestAsJSONCodegen.scala +++ b/src/test/scala/com/databricks/labs/mosaic/codegen/TestAsJSONCodegen.scala @@ -1,7 +1,7 @@ package com.databricks.labs.mosaic.codegen import com.databricks.labs.mosaic.core.geometry.api.{JTS, ESRI} -import com.databricks.labs.mosaic.core.raster.api.RasterAPI.GDAL +import com.databricks.labs.mosaic.core.raster.api.GDAL import com.databricks.labs.mosaic.core.index.H3IndexSystem import com.databricks.labs.mosaic.functions.MosaicContext import com.databricks.labs.mosaic.test.SparkCodeGenSuite diff --git a/src/test/scala/com/databricks/labs/mosaic/core/raster/TestRasterBandGDAL.scala b/src/test/scala/com/databricks/labs/mosaic/core/raster/TestRasterBandGDAL.scala index 7ea57a47b..f5dbc11c7 100644 --- a/src/test/scala/com/databricks/labs/mosaic/core/raster/TestRasterBandGDAL.scala +++ b/src/test/scala/com/databricks/labs/mosaic/core/raster/TestRasterBandGDAL.scala @@ -1,6 +1,6 @@ package com.databricks.labs.mosaic.core.raster -import com.databricks.labs.mosaic.core.raster.gdal_raster.MosaicRasterGDAL +import com.databricks.labs.mosaic.core.raster.gdal.{MosaicRasterBandGDAL, MosaicRasterGDAL} import com.databricks.labs.mosaic.test.mocks.filePath import org.apache.spark.sql.test.SharedSparkSessionGDAL import org.scalatest.matchers.should.Matchers._ diff --git a/src/test/scala/com/databricks/labs/mosaic/core/raster/TestRasterGDAL.scala b/src/test/scala/com/databricks/labs/mosaic/core/raster/TestRasterGDAL.scala index b4575d2bd..acfcaf8c6 100644 --- a/src/test/scala/com/databricks/labs/mosaic/core/raster/TestRasterGDAL.scala +++ b/src/test/scala/com/databricks/labs/mosaic/core/raster/TestRasterGDAL.scala @@ -2,7 +2,7 @@ package com.databricks.labs.mosaic.core.raster import com.databricks.labs.mosaic.core.raster.api.RasterAPI import com.databricks.labs.mosaic.GDAL -import com.databricks.labs.mosaic.core.raster.gdal_raster.MosaicRasterGDAL +import com.databricks.labs.mosaic.core.raster.gdal.MosaicRasterGDAL import com.databricks.labs.mosaic.sql.extensions.MosaicGDAL import com.databricks.labs.mosaic.test.mocks.filePath import org.apache.spark.sql.test.SharedSparkSessionGDAL diff --git a/src/test/scala/com/databricks/labs/mosaic/datasource/OGRFileFormatTest.scala b/src/test/scala/com/databricks/labs/mosaic/datasource/OGRFileFormatTest.scala index f83d33757..be98782f0 100644 --- a/src/test/scala/com/databricks/labs/mosaic/datasource/OGRFileFormatTest.scala +++ b/src/test/scala/com/databricks/labs/mosaic/datasource/OGRFileFormatTest.scala @@ -1,7 +1,7 @@ package com.databricks.labs.mosaic.datasource import com.databricks.labs.mosaic.{H3, JTS} -import com.databricks.labs.mosaic.core.raster.api.RasterAPI.GDAL +import com.databricks.labs.mosaic.core.raster.api.GDAL import com.databricks.labs.mosaic.expressions.util.OGRReadeWithOffset import com.databricks.labs.mosaic.functions.MosaicContext import com.databricks.labs.mosaic.utils.PathUtils diff --git a/src/test/scala/com/databricks/labs/mosaic/expressions/constructors/TestConstructors.scala b/src/test/scala/com/databricks/labs/mosaic/expressions/constructors/TestConstructors.scala index a997f9b68..8c22c17b9 100644 --- a/src/test/scala/com/databricks/labs/mosaic/expressions/constructors/TestConstructors.scala +++ b/src/test/scala/com/databricks/labs/mosaic/expressions/constructors/TestConstructors.scala @@ -1,7 +1,7 @@ package com.databricks.labs.mosaic.expressions.constructors import com.databricks.labs.mosaic.core.geometry.api.{ESRI, JTS} -import com.databricks.labs.mosaic.core.raster.api.RasterAPI.GDAL +import com.databricks.labs.mosaic.core.raster.api.GDAL import com.databricks.labs.mosaic.core.index.H3IndexSystem import com.databricks.labs.mosaic.functions.MosaicContext import com.databricks.labs.mosaic.test.SparkSuite diff --git a/src/test/scala/com/databricks/labs/mosaic/sql/extensions/TestSQLExtensions.scala b/src/test/scala/com/databricks/labs/mosaic/sql/extensions/TestSQLExtensions.scala index d1d697006..06db900d8 100644 --- a/src/test/scala/com/databricks/labs/mosaic/sql/extensions/TestSQLExtensions.scala +++ b/src/test/scala/com/databricks/labs/mosaic/sql/extensions/TestSQLExtensions.scala @@ -3,7 +3,7 @@ package com.databricks.labs.mosaic.sql.extensions import com.databricks.labs.mosaic._ import com.databricks.labs.mosaic.core.geometry.api.{ESRI, JTS} import com.databricks.labs.mosaic.core.index.{BNGIndexSystem, H3IndexSystem} -import com.databricks.labs.mosaic.core.raster.api.RasterAPI.GDAL +import com.databricks.labs.mosaic.core.raster.api.GDAL import com.databricks.labs.mosaic.functions.MosaicContext import com.databricks.labs.mosaic.test.SparkSuite import org.apache.spark.SparkConf