forked from databrickslabs/mosaic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request databrickslabs#254 from databrickslabs/fix/duplica…
…ted_indexes Fixed duplicated indexes
- Loading branch information
Showing
2 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/test/scala/com/databricks/labs/mosaic/core/TestMosaic.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.databricks.labs.mosaic.core | ||
|
||
import com.databricks.labs.mosaic.core.geometry.api.GeometryAPI.ESRI | ||
import com.databricks.labs.mosaic.core.index.H3IndexSystem | ||
import org.scalatest.funsuite.AnyFunSuite | ||
|
||
class TestMosaic extends AnyFunSuite { | ||
|
||
test("mosaicFill should not return duplicates with H3") { | ||
// This tests the fix for issue #243 https://github.com/databrickslabs/mosaic/issues/243 | ||
val geom = ESRI.geometry("POLYGON ((4.42 51.78, 4.38 51.78, 4.39 51.83, 4.40 51.83, 4.41 51.8303, 4.417 51.8295, 4.42 51.83, 4.44 51.81, 4.42 51.78))", "WKT") | ||
val result = Mosaic.mosaicFill(geom, 7, true, H3IndexSystem, ESRI) | ||
|
||
assert(result.length == 10) | ||
assert(result.map(x => x.index).distinct.length == 10) | ||
} | ||
} |