Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
utas-raymondng committed Nov 21, 2024
1 parent 5eb1801 commit 770c0f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ public enum PointOrientation {
protected static GeometryPrecisionReducer reducer = null;

// Load a coastline shape file so that we can get a spatial extents that cover sea only
public static void init() {
public static synchronized void init() {
try {
// Reset reducer
reducer = null;

// shp file depends on shx, so need to have shx appear in temp folder.
FileUtils.saveResourceToTemp("land/ne_10m_land.shx", "shapefile.shx");
File tempFile = FileUtils.saveResourceToTemp("land/ne_10m_land.shp", "shapefile.shp");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ public GeometryUtilsTest() throws JAXBException {
@BeforeEach
public void init() {
GeometryUtils.setCoastalPrecision(0.03);
GeometryUtils.init();
}

@Test
public void verifyLandStrippedFromSpatialExtents() throws IOException, JAXBException {
GeometryUtils.setReducerPrecision(null);
GeometryUtils.init();

String xml = readResourceFile("classpath:canned/sample_complex_area.xml");
MDMetadataType source = jaxb.unmarshal(xml);
// Whole spatial extends
Expand Down

0 comments on commit 770c0f6

Please sign in to comment.