Skip to content

Commit

Permalink
todo spatial backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
adeet1 committed Mar 20, 2024
1 parent b3a4694 commit ff87753
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,30 @@ object FilterConverter {
sft: SimpleFeatureType,
name: String,
filter: Filter,
col: String): (Option[FilterPredicate], Option[Filter]) = (None, Some(filter))
col: String): (Option[FilterPredicate], Option[Filter]) = {
// TODO: need backwards compatibility for old parquet files
// val (spatial, nonSpatial) = FilterExtractingVisitor(filter, name, sft, SpatialFilterStrategy.spatialCheck)
// val predicate = spatial.map(FilterHelper.extractGeometries(_, name)).flatMap { extracted =>
// Some(extracted).filter(e => e.nonEmpty && !e.disjoint).map { e =>
// val xy = e.values.map(GeometryUtils.bounds).reduce { (a, b) =>
// (math.min(a._1, b._1), math.min(a._2, b._2), math.max(a._3, b._3), math.max(a._4, b._4))
// }
// val xcol = FilterApi.doubleColumn(s"$col.x")
// val ycol = FilterApi.doubleColumn(s"$col.y")
// val filters = Seq[FilterPredicate](
// FilterApi.gtEq(xcol, Double.box(xy._1)),
// FilterApi.gtEq(ycol, Double.box(xy._2)),
// FilterApi.ltEq(xcol, Double.box(xy._3)),
// FilterApi.ltEq(ycol, Double.box(xy._4))
// )
// filters.reduce(FilterApi.and)
// }
// }
// (predicate, nonSpatial)

// For geoparquet files
(None, Some(filter))
}

private def temporal(
sft: SimpleFeatureType,
Expand Down

0 comments on commit ff87753

Please sign in to comment.