Skip to content

Commit

Permalink
Hacky workaround for preventing bounds being calculated twice
Browse files Browse the repository at this point in the history
  • Loading branch information
adeet1 committed May 30, 2024
1 parent 9a66066 commit 2f15551
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ object AbstractFileSystemStorage {
val geom = feature.getDefaultGeometry.asInstanceOf[Geometry]
if (geom != null) {
bounds.expandToInclude(geom.getEnvelopeInternal)
println(s"Expanded bbox for $feature [$this]")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ object ParquetFileSystemStorage extends LazyLogging {

override def write(f: SimpleFeature): Unit = {
writer.write(f)
observer.write(f)
if (!observer.isInstanceOf[AbstractFileSystemStorage.MetadataObserver]) {
observer.write(f)
}
}
override def flush(): Unit = observer.flush()
override def close(): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class SimpleFeatureWriteSupport extends WriteSupport[SimpleFeature] {

// Expand the bounding box for each geometry
(0 until numGeoms).foreach(i => bounds(i).expandToInclude(envelopes(i)))
println(s"Expanded bbox for $feature [$this]")
}

def getBoundingBoxes: Array[Envelope] = bounds
Expand Down

0 comments on commit 2f15551

Please sign in to comment.