Skip to content

Commit

Permalink
Merge pull request #99 from databricks/feature/crs-transforms
Browse files Browse the repository at this point in the history
Fix the problem introduced to main.
  • Loading branch information
milos-colic authored Apr 9, 2022
2 parents 224a0a7 + fb6ee05 commit 33fe969
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ trait RequiresCRS {
case HexType => "HEX"
case JSONType => "GEOJSON"
case InternalGeometryType => "COORDS"
case _ => ???
case _ => throw new Error("Format not supported!")
}

def checkEncoding(dataType: DataType): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,6 @@ case class ST_SetSRID(inputGeom: Expression, srid: Expression, geometryAPIName:

override def right: Expression = srid

// override protected def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode =
// nullSafeCodeGen(
// ctx,
// ev,
// leftEval => {
// checkEncoding(inputGeom.dataType)
// val geometryAPI = GeometryAPI.apply(geometryAPIName)
// val (inCode, geomInRef) = ConvertToCodeGen.readGeometryCode(ctx, leftEval, inputGeom.dataType, geometryAPI)
//
// geometryAPIName match {
// case "ESRI" => s"""
// |$inCode
// |${ev.value} = $geomInRef.setEsriSpatialReference().getID();
// |""".stripMargin
// case "JTS" => s"""
// |try {
// |$inCode
// |${ev.value} = $geomInRef.setSRID($);
// |} catch (Exception e) {
// | throw e;
// |}
// |""".stripMargin
//
// }
// }
// )

override protected def withNewChildrenInternal(newLeft: Expression, newRight: Expression): Expression =
copy(inputGeom = newLeft, srid = newRight)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,6 @@ case class ST_Transform(inputGeom: Expression, srid: Expression, geometryAPIName

override def right: Expression = srid

// override protected def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode =
// nullSafeCodeGen(
// ctx,
// ev,
// leftEval => {
// checkEncoding(inputGeom.dataType)
// val geometryAPI = GeometryAPI.apply(geometryAPIName)
// val (inCode, geomInRef) = ConvertToCodeGen.readGeometryCode(ctx, leftEval, inputGeom.dataType, geometryAPI)
//
// geometryAPIName match {
// case "ESRI" => s"""
// |$inCode
// |${ev.value} = $geomInRef.setEsriSpatialReference().getID();
// |""".stripMargin
// case "JTS" => s"""
// |try {
// |$inCode
// |${ev.value} = $geomInRef.setSRID($);
// |} catch (Exception e) {
// | throw e;
// |}
// |""".stripMargin
//
// }
// }
// )

override protected def withNewChildrenInternal(newLeft: Expression, newRight: Expression): Expression =
copy(inputGeom = newLeft, srid = newRight)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ trait MosaicFrameBehaviors { this: AnyFlatSpec =>
.setIndexResolution(3)
.applyIndex()

val mdf2 = MosaicFrame(polyDf(spark), "geometry")
val mdf2 = MosaicFrame(polyDf(spark).limit(1), "geometry")
.setIndexResolution(3)
.applyIndex()

Expand Down

0 comments on commit 33fe969

Please sign in to comment.